summaryrefslogtreecommitdiff
path: root/tests/test_cases/deps/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_cases/deps/cmake')
-rw-r--r--tests/test_cases/deps/cmake/TARGETS76
-rw-r--r--tests/test_cases/deps/cmake/main.cpp8
-rw-r--r--tests/test_cases/deps/cmake/test.cpp3
-rw-r--r--tests/test_cases/deps/cmake/test.sh5
4 files changed, 92 insertions, 0 deletions
diff --git a/tests/test_cases/deps/cmake/TARGETS b/tests/test_cases/deps/cmake/TARGETS
new file mode 100644
index 0000000..2c02f53
--- /dev/null
+++ b/tests/test_cases/deps/cmake/TARGETS
@@ -0,0 +1,76 @@
+{ "gtest":
+ { "type": ["@", "rules", "CC/foreign/cmake", "library"]
+ , "name": ["gtest"]
+ , "version": ["1", "13", "0"]
+ , "project": [["@", "googletest", "", "tree"]]
+ , "out_hdr_dirs": ["gtest"]
+ , "out_libs": ["libgtest.a"]
+ , "pkg-config": ["gtest.pc"]
+ }
+, "testlib":
+ { "type": ["@", "rules", "CC", "library"]
+ , "name": ["testlib"]
+ , "shared": ["yes"]
+ , "srcs": ["main.cpp"]
+ , "private-deps": ["gtest"]
+ }
+, "test":
+ { "type": ["@", "rules", "CC/test", "test"]
+ , "name": ["test"]
+ , "private-deps": ["testlib", "gtest"]
+ }
+, "gtest_main":
+ { "type": ["@", "rules", "CC/foreign/cmake", "library"]
+ , "name": ["gtest_main"]
+ , "version": ["1", "13", "0"]
+ , "project": [["@", "googletest", "", "tree"]]
+ , "defines": ["BUILD_SHARED_LIBS=ON"]
+ , "out_hdr_dirs": ["gtest"]
+ , "out_libs": ["libgtest_main.so.1.13.0", "libgtest.so.1.13.0"]
+ , "pkg-config": ["gtest_main.pc", "gtest.pc"]
+ }
+, "testbin":
+ { "type": ["@", "rules", "CC", "binary"]
+ , "name": ["test"]
+ , "srcs": ["test.cpp"]
+ , "private-deps": ["gtest_main"]
+ }
+, "shell_test":
+ { "type": ["@", "rules", "shell/test", "script"]
+ , "name": ["shell_test"]
+ , "test": ["test.sh"]
+ , "deps": ["testbin"]
+ }
+, "install_gtest":
+ {"type": ["@", "rules", "CC", "install-with-deps"], "targets": ["gtest"]}
+, "install_gtest_main":
+ { "type": ["@", "rules", "CC", "install-with-deps"]
+ , "targets": ["gtest_main"]
+ }
+, "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"]
+ , "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"]}
+}
diff --git a/tests/test_cases/deps/cmake/main.cpp b/tests/test_cases/deps/cmake/main.cpp
new file mode 100644
index 0000000..575a358
--- /dev/null
+++ b/tests/test_cases/deps/cmake/main.cpp
@@ -0,0 +1,8 @@
+#include <gtest/gtest.h>
+
+TEST(CastTest, float) { EXPECT_EQ(42.0f, float(42)); }
+
+int main(int argc, char **argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/tests/test_cases/deps/cmake/test.cpp b/tests/test_cases/deps/cmake/test.cpp
new file mode 100644
index 0000000..b1811d8
--- /dev/null
+++ b/tests/test_cases/deps/cmake/test.cpp
@@ -0,0 +1,3 @@
+#include <gtest/gtest.h>
+
+TEST(CastTest, double) { EXPECT_EQ(42.0, double(42)); }
diff --git a/tests/test_cases/deps/cmake/test.sh b/tests/test_cases/deps/cmake/test.sh
new file mode 100644
index 0000000..80b7965
--- /dev/null
+++ b/tests/test_cases/deps/cmake/test.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+set -e
+
+./test | grep PASSED