summaryrefslogtreecommitdiff
path: root/tests/test_cases
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_cases')
-rw-r--r--tests/test_cases/deps/TARGETS19
-rw-r--r--tests/test_cases/deps/prebuilt/TARGETS71
-rw-r--r--tests/test_cases/deps/prebuilt/bar.hpp8
-rw-r--r--tests/test_cases/deps/prebuilt/foo.hpp8
4 files changed, 98 insertions, 8 deletions
diff --git a/tests/test_cases/deps/TARGETS b/tests/test_cases/deps/TARGETS
index 3e31861..c4cfdbc 100644
--- a/tests/test_cases/deps/TARGETS
+++ b/tests/test_cases/deps/TARGETS
@@ -98,7 +98,12 @@
}
, "prebuilt_tests":
{ "type": "tree"
- , "deps": [["test_cases/deps/prebuilt", "TARGETS"], ["TREE", null, "shared"]]
+ , "deps":
+ [ ["test_cases/deps/prebuilt", "foo.hpp"]
+ , ["test_cases/deps/prebuilt", "bar.hpp"]
+ , ["test_cases/deps/prebuilt", "TARGETS"]
+ , ["TREE", null, "shared"]
+ ]
}
, "prebuilt":
{ "type": ["test_rules", "test_case"]
@@ -112,6 +117,8 @@
, "+test_uses_bar"
, "+test_uses_bar_s"
, "+test_uses_main"
+ , "+install_foo"
+ , "+install_bar"
, "+install_main"
, "+test_uses_foobar"
, "+test_uses_foobar_s"
@@ -122,12 +129,22 @@
, "test -f foo/foo/foo.hpp"
, "test -f bar/libbar.so"
, "test -f bar/bar/bar.hpp"
+ , "test -f install_foo/share/pkgconfig/foo/foo.cflags"
+ , "test -f install_foo/share/pkgconfig/foo/foo.ldflags"
+ , "test -f install_bar/share/pkgconfig/foo/foo.cflags"
+ , "test -f install_bar/share/pkgconfig/foo/foo.ldflags"
+ , "test -f install_bar/share/pkgconfig/bar/bar.cflags"
+ , "test -f install_bar/share/pkgconfig/bar/bar.ldflags"
, "./install_main/bin/main_uses_bar | grep main"
, "./install_main/bin/main_uses_bar | grep bar"
, "./install_main/bin/main_uses_bar | grep foo"
, "test -f install_foobar/lib/libfoo.so.1.2.3"
, "test -f install_foobar/lib/libbar.so"
, "test -f install_foobar/share/pkgconfig/foobar.pc"
+ , "grep 'Cflags:.*@${prefix}/share/pkgconfig/bar/foobar.cflags' install_foobar/share/pkgconfig/foobar.pc"
+ , "grep -- '-DUSE_BAR=1 -DUSE_FOO=1' install_foobar/share/pkgconfig/bar/foobar.cflags"
+ , "grep 'Libs:.*@${prefix}/share/pkgconfig/bar/foobar.ldflags' install_foobar/share/pkgconfig/foobar.pc"
+ , "grep -- '-lm -lpthread' install_foobar/share/pkgconfig/bar/foobar.ldflags"
]
, "data": ["prebuilt_tests"]
}
diff --git a/tests/test_cases/deps/prebuilt/TARGETS b/tests/test_cases/deps/prebuilt/TARGETS
index d94dea2..c923995 100644
--- a/tests/test_cases/deps/prebuilt/TARGETS
+++ b/tests/test_cases/deps/prebuilt/TARGETS
@@ -1,32 +1,68 @@
-{ "foo":
+{ "foo.pc":
+ { "type": "file_gen"
+ , "name": "foo.pc"
+ , "data":
+ { "type": "join"
+ , "separator": "\n"
+ , "$1":
+ [ "Name: foo"
+ , "Version: 1.2.3"
+ , "Description: test prebuilt foo"
+ , "URL: unknown"
+ , "Cflags: -I/usr/include -DUSE_FOO=1"
+ , "Libs: -L/usr/lib -lfoo -lpthread"
+ ]
+ }
+ }
+, "foo":
{ "type": ["@", "rules", "CC/prebuilt", "library"]
, "name": ["foo"]
, "version": ["1", "2", "3"]
- , "hdrs": [["shared", "foo.hpp"]]
+ , "hdrs": ["foo.hpp"]
, "lib": [["shared", "foo"]]
+ , "pkg-config": ["foo.pc"]
, "stage": ["foo"]
}
, "foo_s":
{ "type": ["@", "rules", "CC/prebuilt", "library"]
, "name": ["foo"]
, "version": ["1", "2", "3"]
- , "hdrs": [["shared", "foo.hpp"]]
+ , "hdrs": ["foo.hpp"]
, "lib": [["shared", "foo_s"]]
+ , "pkg-config": ["foo.pc"]
, "stage": ["foo"]
}
+, "bar.pc":
+ { "type": "file_gen"
+ , "name": "bar.pc"
+ , "data":
+ { "type": "join"
+ , "separator": "\n"
+ , "$1":
+ [ "Name: bar"
+ , "Version: unknown"
+ , "Description: test prebuilt bar"
+ , "URL: unknown"
+ , "Cflags: -I/usr/include -DUSE_BAR=1"
+ , "Libs: -L/usr/lib -lbar -lpthread -lm"
+ ]
+ }
+ }
, "bar":
{ "type": ["@", "rules", "CC/prebuilt", "library"]
, "name": ["bar"]
- , "hdrs": [["shared", "bar.hpp"]]
+ , "hdrs": ["bar.hpp"]
, "lib": [["shared", "bar"]]
+ , "pkg-config": ["bar.pc"]
, "stage": ["bar"]
, "deps": ["foo"]
}
, "bar_s":
{ "type": ["@", "rules", "CC/prebuilt", "library"]
, "name": ["bar"]
- , "hdrs": [["shared", "bar.hpp"]]
+ , "hdrs": ["bar.hpp"]
, "lib": [["shared", "bar_s"]]
+ , "pkg-config": ["bar.pc"]
, "stage": ["bar"]
, "deps": ["foo"]
}
@@ -66,22 +102,43 @@
, "test": [["shared", "test_uses_main.sh"]]
, "deps": ["main_uses_bar"]
}
+, "install_foo":
+ {"type": ["@", "rules", "CC", "install-with-deps"], "targets": ["foo"]}
+, "install_bar":
+ {"type": ["@", "rules", "CC", "install-with-deps"], "targets": ["bar"]}
, "install_main":
{ "type": ["@", "rules", "CC", "install-with-deps"]
, "targets": ["main_uses_bar"]
}
+, "foobar.pc":
+ { "type": "file_gen"
+ , "name": "foobar.pc"
+ , "data":
+ { "type": "join"
+ , "separator": "\n"
+ , "$1":
+ [ "Name: foobar"
+ , "Version: unknown"
+ , "Description: test compound prebuilt foobar"
+ , "URL: unknown"
+ , "Requires: bar, foo >= 1.2.3"
+ ]
+ }
+ }
, "foobar":
{ "type": ["@", "rules", "CC/prebuilt", "library"]
, "name": ["foobar"]
- , "hdrs": [["shared", "bar.hpp"]]
+ , "hdrs": ["bar.hpp"]
, "lib": [["shared", "bar"], ["shared", "foo"]]
+ , "pkg-config": ["foobar.pc", "foo.pc", "bar.pc"]
, "stage": ["bar"]
}
, "foobar_s":
{ "type": ["@", "rules", "CC/prebuilt", "library"]
, "name": ["foobar"]
- , "hdrs": [["shared", "bar.hpp"]]
+ , "hdrs": ["bar.hpp"]
, "lib": [["shared", "bar_s"], ["shared", "foo_s"]]
+ , "pkg-config": ["foobar.pc", "foo.pc", "bar.pc"]
, "stage": ["bar"]
}
, "test_uses_foobar":
diff --git a/tests/test_cases/deps/prebuilt/bar.hpp b/tests/test_cases/deps/prebuilt/bar.hpp
new file mode 100644
index 0000000..243dba6
--- /dev/null
+++ b/tests/test_cases/deps/prebuilt/bar.hpp
@@ -0,0 +1,8 @@
+#ifndef BAR_HPP
+#define BAR_HPP
+
+#ifdef USE_BAR
+int bar();
+#endif
+
+#endif
diff --git a/tests/test_cases/deps/prebuilt/foo.hpp b/tests/test_cases/deps/prebuilt/foo.hpp
new file mode 100644
index 0000000..4f040d4
--- /dev/null
+++ b/tests/test_cases/deps/prebuilt/foo.hpp
@@ -0,0 +1,8 @@
+#ifndef FOO_HPP
+#define FOO_HPP
+
+#ifdef USE_FOO
+int foo();
+#endif
+
+#endif