diff options
Diffstat (limited to 'tests/test_cases/deps/install')
-rw-r--r-- | tests/test_cases/deps/install/TARGETS | 69 | ||||
-rw-r--r-- | tests/test_cases/deps/install/bar.cpp | 7 | ||||
-rw-r--r-- | tests/test_cases/deps/install/bar.hpp | 8 | ||||
-rw-r--r-- | tests/test_cases/deps/install/baz.cpp | 7 | ||||
-rw-r--r-- | tests/test_cases/deps/install/baz.hpp | 10 | ||||
-rw-r--r-- | tests/test_cases/deps/install/foo.cpp | 10 | ||||
-rw-r--r-- | tests/test_cases/deps/install/foo.hpp | 8 | ||||
-rw-r--r-- | tests/test_cases/deps/install/main.cpp | 10 | ||||
-rw-r--r-- | tests/test_cases/deps/install/qux.hpp | 8 |
9 files changed, 137 insertions, 0 deletions
diff --git a/tests/test_cases/deps/install/TARGETS b/tests/test_cases/deps/install/TARGETS new file mode 100644 index 0000000..c2cab52 --- /dev/null +++ b/tests/test_cases/deps/install/TARGETS @@ -0,0 +1,69 @@ +{ "baz": + { "type": ["@", "rules", "CC", "library"] + , "name": ["baz"] + , "hdrs": ["baz.hpp"] + , "srcs": ["baz.cpp"] + , "stage": ["baz"] + } +, "foo": + { "type": ["@", "rules", "CC", "library"] + , "name": ["foo"] + , "hdrs": ["foo.hpp"] + , "private-hdrs": ["qux.hpp"] + , "srcs": ["foo.cpp"] + , "private-deps": ["baz"] + , "stage": ["foo"] + } +, "bar": + { "type": ["@", "rules", "CC", "library"] + , "name": ["bar"] + , "hdrs": ["bar.hpp"] + , "srcs": ["bar.cpp"] + , "deps": ["foo"] + , "stage": ["bar"] + } +, "main": + { "type": ["@", "rules", "CC", "binary"] + , "name": ["main"] + , "srcs": ["main.cpp"] + , "private-deps": ["bar"] + } +, "install_bar_release": + {"type": ["@", "rules", "CC", "install-with-deps"], "targets": ["bar"]} +, "install_main_release": + {"type": ["@", "rules", "CC", "install-with-deps"], "targets": ["main"]} +, "bar debug": + { "type": "configure" + , "target": "bar" + , "config": + { "type": "let*" + , "bindings": [["DEBUG", true], ["ADD_CXXFLAGS", ["-g"]]] + , "body": {"type": "env", "vars": ["DEBUG", "ADD_CXXFLAGS"]} + } + } +, "main debug": + { "type": "configure" + , "target": "main" + , "config": + { "type": "let*" + , "bindings": [["DEBUG", true], ["ADD_CXXFLAGS", ["-g"]]] + , "body": {"type": "env", "vars": ["DEBUG", "ADD_CXXFLAGS"]} + } + } +, "install_bar_debug": + {"type": ["@", "rules", "CC", "install-with-deps"], "targets": ["bar debug"]} +, "install_main_debug": + { "type": ["@", "rules", "CC", "install-with-deps"] + , "targets": ["main debug"] + } +, "install_bar_debug_slim": + { "type": ["@", "rules", "CC", "install-with-deps"] + , "skip-debug-stage": ["yes"] + , "targets": ["bar debug"] + } +, "install_main_debug_slim": + { "type": ["@", "rules", "CC", "install-with-deps"] + , "skip-debug-stage": ["yes"] + , "targets": ["main debug"] + } +} diff --git a/tests/test_cases/deps/install/bar.cpp b/tests/test_cases/deps/install/bar.cpp new file mode 100644 index 0000000..6cc1260 --- /dev/null +++ b/tests/test_cases/deps/install/bar.cpp @@ -0,0 +1,7 @@ +#include "bar.hpp" +#include <iostream> + +int bar(Foo *foo) { + std::cout << "bar" << std::endl; + return (foo == nullptr) ? -1 : foo->foo(); +} diff --git a/tests/test_cases/deps/install/bar.hpp b/tests/test_cases/deps/install/bar.hpp new file mode 100644 index 0000000..ec9c165 --- /dev/null +++ b/tests/test_cases/deps/install/bar.hpp @@ -0,0 +1,8 @@ +#ifndef BAR_HPP +#define BAR_HPP + +#include "foo/foo.hpp" + +int bar(Foo *foo); + +#endif diff --git a/tests/test_cases/deps/install/baz.cpp b/tests/test_cases/deps/install/baz.cpp new file mode 100644 index 0000000..c2c26f0 --- /dev/null +++ b/tests/test_cases/deps/install/baz.cpp @@ -0,0 +1,7 @@ +#include "baz.hpp" +#include <iostream> + +int baz() { + std::cout << baz_str() << std::endl; + return 0; +} diff --git a/tests/test_cases/deps/install/baz.hpp b/tests/test_cases/deps/install/baz.hpp new file mode 100644 index 0000000..f0f8377 --- /dev/null +++ b/tests/test_cases/deps/install/baz.hpp @@ -0,0 +1,10 @@ +#ifndef BAZ_HPP +#define BAZ_HPP + +int baz(); + +#include <string> + +static inline std::string baz_str() { return "baz"; } + +#endif diff --git a/tests/test_cases/deps/install/foo.cpp b/tests/test_cases/deps/install/foo.cpp new file mode 100644 index 0000000..4a3b17a --- /dev/null +++ b/tests/test_cases/deps/install/foo.cpp @@ -0,0 +1,10 @@ +#include "foo.hpp" +#include "baz/baz.hpp" +#include "qux.hpp" +#include <iostream> + +int Foo::foo() { + std::cout << "foo & inline " << baz_str() << std::endl; + qux(); + return baz(); +} diff --git a/tests/test_cases/deps/install/foo.hpp b/tests/test_cases/deps/install/foo.hpp new file mode 100644 index 0000000..025f3ef --- /dev/null +++ b/tests/test_cases/deps/install/foo.hpp @@ -0,0 +1,8 @@ +#ifndef FOO_HPP +#define FOO_HPP + +struct Foo { + int foo(); +}; + +#endif diff --git a/tests/test_cases/deps/install/main.cpp b/tests/test_cases/deps/install/main.cpp new file mode 100644 index 0000000..2e46d75 --- /dev/null +++ b/tests/test_cases/deps/install/main.cpp @@ -0,0 +1,10 @@ +// test binary consuming libraries + +#include "bar/bar.hpp" +#include <iostream> + +int main() { + std::cout << "main" << std::endl; + Foo foo{}; + return bar(&foo); +} diff --git a/tests/test_cases/deps/install/qux.hpp b/tests/test_cases/deps/install/qux.hpp new file mode 100644 index 0000000..b2f1611 --- /dev/null +++ b/tests/test_cases/deps/install/qux.hpp @@ -0,0 +1,8 @@ +#ifndef QUX_HPP +#define QUX_HPP + +#include <iostream> + +void qux() { std::cout << "qux" << std::endl; } + +#endif
\ No newline at end of file |