diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2022-12-20 12:33:06 +0100 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2023-01-10 14:47:55 +0100 |
commit | a514f75625633a167bb5518b7c90ca4219058d5f (patch) | |
tree | aa8ac17d4021eba89b265d4d654ddb5cf564696b /tests | |
parent | 995722725a4e7b94bbb0d15de1e8cfcd64dade7b (diff) | |
download | rules-cc-a514f75625633a167bb5518b7c90ca4219058d5f.tar.gz |
tests: Test rule "install-with-deps"
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_cases/deps/TARGETS | 37 | ||||
-rw-r--r-- | tests/test_cases/deps/private/TARGETS | 2 | ||||
-rw-r--r-- | tests/test_cases/deps/public/TARGETS | 2 | ||||
-rw-r--r-- | tests/test_cases/deps/shared/TARGETS | 8 |
4 files changed, 47 insertions, 2 deletions
diff --git a/tests/test_cases/deps/TARGETS b/tests/test_cases/deps/TARGETS index 0af783f..93aa167 100644 --- a/tests/test_cases/deps/TARGETS +++ b/tests/test_cases/deps/TARGETS @@ -2,7 +2,12 @@ { "type": ["test_rules", "test_case"] , "name": ["deps_private"] , "targets": - ["+foo", "-main_includes_foo", "+main_links_foo", "+main_links_bar_foo"] + [ "+foo" + , "-main_includes_foo" + , "+main_links_foo" + , "+main_links_bar_foo" + , "+install_bar" + ] , "asserts": [ "test -f foo/foo/libfoo.a" , "test -f foo/foo/foo.hpp" @@ -10,6 +15,10 @@ , "./main_links_foo/main | grep foo" , "./main_links_bar_foo/main | grep bar" , "./main_links_bar_foo/main | grep foo" + , "test -f install_bar/lib/bar/libbar.a" + , "test -f install_bar/include/bar/bar.hpp" + , "test -f install_bar/lib/foo/libfoo.a" + , "! test -f install_bar/include/foo/foo.hpp" ] , "data": [["TREE", null, "private"]] } @@ -17,7 +26,12 @@ { "type": ["test_rules", "test_case"] , "name": ["deps_public"] , "targets": - ["+foo", "+main_includes_foo", "+main_links_foo", "+main_links_bar_foo"] + [ "+foo" + , "+main_includes_foo" + , "+main_links_foo" + , "+main_links_bar_foo" + , "+install_bar" + ] , "asserts": [ "test -f foo/foo/libfoo.a" , "test -f foo/foo/foo.hpp" @@ -26,6 +40,10 @@ , "./main_links_foo/main | grep foo" , "./main_links_bar_foo/main | grep bar" , "./main_links_bar_foo/main | grep foo" + , "test -f install_bar/lib/bar/libbar.a" + , "test -f install_bar/include/bar/bar.hpp" + , "test -f install_bar/lib/foo/libfoo.a" + , "test -f install_bar/include/foo/foo.hpp" ] , "data": [["TREE", null, "public"]] } @@ -43,6 +61,9 @@ , "+test_uses_baz" , "+test_uses_main" , "+test_diamond" + , "+install_bar_s" + , "+install_baz" + , "+install_main" ] , "asserts": [ "test -f foo/libfoo.so.1.2.3" @@ -50,6 +71,18 @@ , "test -f bar/libbar.so" , "test -f bar/bar/bar.hpp" , "! test -f bar/foo/foo.hpp" + , "test -f install_bar_s/lib/bar/libbar.a" + , "test -f install_bar_s/include/bar/bar.hpp" + , "test -f install_bar_s/lib/libfoo.so.1.2.3" + , "! test -f install_bar_s/include/foo/foo.hpp" + , "test -f install_baz/lib/libbaz.so" + , "test -f install_baz/include/baz/baz.hpp" + , "! test -f install_baz/lib/foo/libfoo.a" + , "! test -f install_baz/include/foo/foo.hpp" + , "./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 -d install_main/include" ] , "data": [["TREE", null, "shared"]] } diff --git a/tests/test_cases/deps/private/TARGETS b/tests/test_cases/deps/private/TARGETS index 582af60..dd72948 100644 --- a/tests/test_cases/deps/private/TARGETS +++ b/tests/test_cases/deps/private/TARGETS @@ -31,4 +31,6 @@ , "srcs": ["main_links_bar_foo.cpp"] , "private-deps": ["bar"] } +, "install_bar": + {"type": ["@", "rules", "CC", "install-with-deps"], "targets": ["bar"]} } diff --git a/tests/test_cases/deps/public/TARGETS b/tests/test_cases/deps/public/TARGETS index 504333e..bc1807a 100644 --- a/tests/test_cases/deps/public/TARGETS +++ b/tests/test_cases/deps/public/TARGETS @@ -31,4 +31,6 @@ , "srcs": ["main_links_bar_foo.cpp"] , "private-deps": ["bar"] } +, "install_bar": + {"type": ["@", "rules", "CC", "install-with-deps"], "targets": ["bar"]} } diff --git a/tests/test_cases/deps/shared/TARGETS b/tests/test_cases/deps/shared/TARGETS index 82a5818..f89ce0a 100644 --- a/tests/test_cases/deps/shared/TARGETS +++ b/tests/test_cases/deps/shared/TARGETS @@ -88,4 +88,12 @@ , "srcs": ["test_diamond.cpp"] , "private-deps": ["foo_s", "baz"] } +, "install_bar_s": + {"type": ["@", "rules", "CC", "install-with-deps"], "targets": ["bar_s"]} +, "install_baz": + {"type": ["@", "rules", "CC", "install-with-deps"], "targets": ["baz"]} +, "install_main": + { "type": ["@", "rules", "CC", "install-with-deps"] + , "targets": ["main_uses_bar"] + } } |