diff options
Diffstat (limited to 'tests/test_cases/deps/components')
-rw-r--r-- | tests/test_cases/deps/components/TARGETS | 55 | ||||
-rw-r--r-- | tests/test_cases/deps/components/bar.cpp | 9 | ||||
-rw-r--r-- | tests/test_cases/deps/components/bar.hpp | 6 | ||||
-rw-r--r-- | tests/test_cases/deps/components/foo.cpp | 10 | ||||
-rw-r--r-- | tests/test_cases/deps/components/foo.hpp | 8 | ||||
-rw-r--r-- | tests/test_cases/deps/components/foodep.cpp | 9 | ||||
-rw-r--r-- | tests/test_cases/deps/components/foodep.hpp | 8 | ||||
-rw-r--r-- | tests/test_cases/deps/components/main.cpp | 10 |
8 files changed, 115 insertions, 0 deletions
diff --git a/tests/test_cases/deps/components/TARGETS b/tests/test_cases/deps/components/TARGETS new file mode 100644 index 0000000..62a599c --- /dev/null +++ b/tests/test_cases/deps/components/TARGETS @@ -0,0 +1,55 @@ +{ "combined_static_lib": + { "type": ["@", "rules", "CC", "library"] + , "name": ["combstatic"] + , "components": ["foo", "bar"] + } +, "combined_shared_lib": + { "type": ["@", "rules", "CC", "library"] + , "name": ["combshared"] + , "shared": [""] + , "components": ["foo", "bar"] + } +, "foo": + { "type": ["@", "rules", "CC", "library"] + , "name": ["foo"] + , "hdrs": ["foo.hpp"] + , "srcs": ["foo.cpp"] + , "deps": ["foodep"] + } +, "foodep": + { "type": ["@", "rules", "CC", "library"] + , "name": ["foodep"] + , "hdrs": ["foodep.hpp"] + , "srcs": ["foodep.cpp"] + } +, "bar": + { "type": ["@", "rules", "CC", "library"] + , "name": ["bar"] + , "hdrs": ["bar.hpp"] + , "srcs": ["bar.cpp"] + } +, "main": + { "type": ["@", "rules", "CC", "binary"] + , "name": ["main"] + , "srcs": ["main.cpp"] + , "private-deps": ["combined_static_lib"] + } +, "main-shared": + { "type": ["@", "rules", "CC", "binary"] + , "name": ["main"] + , "srcs": ["main.cpp"] + , "private-deps": ["combined_shared_lib"] + } +, "main-dynamic": + { "type": ["@", "rules", "CC", "install-with-deps"] + , "targets": ["main-shared"] + } +, "installed_static": + { "type": ["@", "rules", "CC", "install-with-deps"] + , "targets": ["combined_static_lib"] + } +, "installed_shared": + { "type": ["@", "rules", "CC", "install-with-deps"] + , "targets": ["combined_shared_lib"] + } +} diff --git a/tests/test_cases/deps/components/bar.cpp b/tests/test_cases/deps/components/bar.cpp new file mode 100644 index 0000000..525a3a4 --- /dev/null +++ b/tests/test_cases/deps/components/bar.cpp @@ -0,0 +1,9 @@ +#include "bar.hpp" + +#include <iostream> +#include <ostream> + +int bar(int x) { + std::cout << "bar(" << x << ")" << std::endl; + return x * 5; +} diff --git a/tests/test_cases/deps/components/bar.hpp b/tests/test_cases/deps/components/bar.hpp new file mode 100644 index 0000000..63f851d --- /dev/null +++ b/tests/test_cases/deps/components/bar.hpp @@ -0,0 +1,6 @@ +#ifndef BAR_HPP +#define BAR_HPP + +int bar(int); + +#endif diff --git a/tests/test_cases/deps/components/foo.cpp b/tests/test_cases/deps/components/foo.cpp new file mode 100644 index 0000000..163c6e2 --- /dev/null +++ b/tests/test_cases/deps/components/foo.cpp @@ -0,0 +1,10 @@ +#include "foo.hpp" + +#include "foodep.hpp" +#include <iostream> +#include <ostream> + +int foo(int x) { + std::cout << "foo(" << x << ")" << std::endl; + return foodep(x) + 7; +} diff --git a/tests/test_cases/deps/components/foo.hpp b/tests/test_cases/deps/components/foo.hpp new file mode 100644 index 0000000..45c286c --- /dev/null +++ b/tests/test_cases/deps/components/foo.hpp @@ -0,0 +1,8 @@ +#ifndef FOO_HPP +#define FOO_HPP + +#include "foodep.hpp" + +foo_t foo(foo_t); + +#endif diff --git a/tests/test_cases/deps/components/foodep.cpp b/tests/test_cases/deps/components/foodep.cpp new file mode 100644 index 0000000..e26c335 --- /dev/null +++ b/tests/test_cases/deps/components/foodep.cpp @@ -0,0 +1,9 @@ +#include "foodep.hpp" + +#include <iostream> +#include <ostream> + +foo_t foodep(foo_t x) { + std::cout << "foodep(" << x << ")" << std::endl; + return x + 2; +} diff --git a/tests/test_cases/deps/components/foodep.hpp b/tests/test_cases/deps/components/foodep.hpp new file mode 100644 index 0000000..ea16bb0 --- /dev/null +++ b/tests/test_cases/deps/components/foodep.hpp @@ -0,0 +1,8 @@ +#ifndef FOODEP_HPP +#define FOODEP_HPP + +typedef int foo_t; + +foo_t foodep(foo_t); + +#endif diff --git a/tests/test_cases/deps/components/main.cpp b/tests/test_cases/deps/components/main.cpp new file mode 100644 index 0000000..b6734a2 --- /dev/null +++ b/tests/test_cases/deps/components/main.cpp @@ -0,0 +1,10 @@ +#include "foo.hpp" +#include "bar.hpp" + +#include <iostream> +#include <ostream> + +int main(int argc, char **argv) { + std::cout << "Hello-from-main" << std::endl; + std::cout << foo(bar(3)) << std::endl; +} |