summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSascha Roloff <sascha.roloff@huawei.com>2023-05-30 19:05:56 +0200
committerSascha Roloff <sascha.roloff@huawei.com>2023-05-31 13:09:29 +0200
commit06e3d7e45db8edcac37b5ba34837e8ddab4d549f (patch)
treefbbb0f6c5412c966871224dfc88fe45f32cad750 /tests
parenta56a6ebae4a116486df48d96705cc8c8b8d81857 (diff)
downloadrules-cc-06e3d7e45db8edcac37b5ba34837e8ddab4d549f.tar.gz
Add testcase for cmake dependencies
Diffstat (limited to 'tests')
-rw-r--r--tests/test_cases/deps/TARGETS4
-rw-r--r--tests/test_cases/deps/cmake/TARGETS28
2 files changed, 31 insertions, 1 deletions
diff --git a/tests/test_cases/deps/TARGETS b/tests/test_cases/deps/TARGETS
index 909cb4b..10a6749 100644
--- a/tests/test_cases/deps/TARGETS
+++ b/tests/test_cases/deps/TARGETS
@@ -151,7 +151,7 @@
, "cmake":
{ "type": ["test_rules", "test_case"]
, "name": ["deps_cmake"]
- , "libs": ["googletest"]
+ , "libs": ["googletest", "libz", "libcurl"]
, "targets":
[ "+gtest"
, "+test"
@@ -161,6 +161,7 @@
, "+install_gtest"
, "+install_gtest_main"
, "+install_testbin"
+ , "+install_libcurl"
]
, "asserts":
[ "test -f gtest/libgtest.a"
@@ -184,6 +185,7 @@
, "grep 'Libs.*libgtest_main.so.1.13.0' install_gtest_main/lib/pkgconfig/gtest_main.pc"
, "grep 'Libs.*lib/pkgconfig/gtest_main.ldflags' install_gtest_main/lib/pkgconfig/gtest_main.pc"
, "./install_testbin/bin/test | grep 'PASSED.*1 test'"
+ , "path=$(ldd install_libcurl/lib/libcurl.so.4.8.0 | awk '/libz/{print $3}') && test -z \"${path##$(pwd)*}\""
]
, "data": [["TREE", null, "cmake"]]
}
diff --git a/tests/test_cases/deps/cmake/TARGETS b/tests/test_cases/deps/cmake/TARGETS
index 74633b9..7b3bf6f 100644
--- a/tests/test_cases/deps/cmake/TARGETS
+++ b/tests/test_cases/deps/cmake/TARGETS
@@ -49,4 +49,32 @@
}
, "install_testbin":
{"type": ["@", "rules", "CC", "install-with-deps"], "targets": ["testbin"]}
+, "libz":
+ { "type": ["@", "rules", "CC/foreign/cmake", "library"]
+ , "name": ["libz"]
+ , "version": ["1", "2", "13"]
+ , "project": [["@", "libz", "", "tree"]]
+ , "defines": ["BUILD_SHARED_LIBS=ON"]
+ , "post_cmds":
+ [ "cp lib/libz.so.1.2.13 lib/libz.so"
+ , "cp lib/libz.so.1.2.13 lib/libz.so.1"
+ ]
+ , "out_hdrs": ["zconf.h", "zlib.h"]
+ , "out_libs": ["libz.so", "libz.so.1", "libz.so.1.2.13"]
+ , "pc_prefix": ["share/pkgconfig"]
+ , "pkg-config": ["zlib.pc"]
+ }
+, "libcurl":
+ { "type": ["@", "rules", "CC/foreign/cmake", "library"]
+ , "name": ["libcurl"]
+ , "version": ["8", "0", "1"]
+ , "project": [["@", "libcurl", "", "tree"]]
+ , "defines": ["BUILD_SHARED_LIBS=ON", "CURL_ENABLE_SSL=OFF", "USE_ZLIB=ON"]
+ , "out_hdr_dirs": ["curl"]
+ , "out_libs": ["libcurl.so.4.8.0"]
+ , "pkg-config": ["libcurl.pc"]
+ , "deps": ["libz"]
+ }
+, "install_libcurl":
+ {"type": ["@", "rules", "CC", "install-with-deps"], "targets": ["libcurl"]}
}