diff options
Diffstat (limited to 'tests/test_cases/deps/transitive-components')
14 files changed, 180 insertions, 0 deletions
diff --git a/tests/test_cases/deps/transitive-components/TARGETS b/tests/test_cases/deps/transitive-components/TARGETS new file mode 100644 index 0000000..347b94c --- /dev/null +++ b/tests/test_cases/deps/transitive-components/TARGETS @@ -0,0 +1,64 @@ +{ "foo": + { "type": ["@", "rules", "CC", "library"] + , "name": ["foo"] + , "hdrs": ["foo.hpp"] + , "srcs": ["foo.cpp"] + , "deps": ["foodep"] + , "components": ["bar"] + } +, "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"] + , "deps": ["bardep"] + , "components": ["baz"] + } +, "bardep": + { "type": ["@", "rules", "CC", "library"] + , "name": ["bardep"] + , "hdrs": ["bardep.hpp"] + , "srcs": ["bardep.cpp"] + } +, "baz": + { "type": ["@", "rules", "CC", "library"] + , "name": ["baz"] + , "hdrs": ["baz.hpp"] + , "srcs": ["baz.cpp"] + , "deps": ["bazdep"] + } +, "bazdep": + { "type": ["@", "rules", "CC", "library"] + , "name": ["bazdep"] + , "hdrs": ["bazdep.hpp"] + , "srcs": ["bazdep.cpp"] + } +, "main": + { "type": ["@", "rules", "CC", "binary"] + , "name": ["main"] + , "srcs": ["main.cpp"] + , "private-deps": ["foo"] + } +, "shared-foo": + { "type": ["@", "rules", "CC", "library"] + , "name": ["foo"] + , "shared": [""] + , "components": ["foo"] + } +, "shared-main": + { "type": ["@", "rules", "CC", "binary"] + , "name": ["main"] + , "srcs": ["main.cpp"] + , "private-deps": ["shared-foo"] + } +, "installed-shared-main": + { "type": ["@", "rules", "CC", "install-with-deps"] + , "targets": ["shared-main"] + } +} diff --git a/tests/test_cases/deps/transitive-components/bar.cpp b/tests/test_cases/deps/transitive-components/bar.cpp new file mode 100644 index 0000000..437619c --- /dev/null +++ b/tests/test_cases/deps/transitive-components/bar.cpp @@ -0,0 +1,10 @@ +#include "bar.hpp" + +#include "bardep.hpp" +#include <iostream> +#include <ostream> + +int bar(int x) { + std::cout << "bar(" << x << ")" << std::endl; + return bardep(x) * 7; +} diff --git a/tests/test_cases/deps/transitive-components/bar.hpp b/tests/test_cases/deps/transitive-components/bar.hpp new file mode 100644 index 0000000..e29bfd7 --- /dev/null +++ b/tests/test_cases/deps/transitive-components/bar.hpp @@ -0,0 +1,8 @@ +#ifndef BAR_HPP +#define BAR_HPP + +#include "bardep.hpp" + +bar_t bar(bar_t); + +#endif diff --git a/tests/test_cases/deps/transitive-components/bardep.cpp b/tests/test_cases/deps/transitive-components/bardep.cpp new file mode 100644 index 0000000..33931da --- /dev/null +++ b/tests/test_cases/deps/transitive-components/bardep.cpp @@ -0,0 +1,9 @@ +#include "bardep.hpp" + +#include <iostream> +#include <ostream> + +bar_t bardep(bar_t x) { + std::cout << "bardep(" << x << ")" << std::endl; + return x + 5; +} diff --git a/tests/test_cases/deps/transitive-components/bardep.hpp b/tests/test_cases/deps/transitive-components/bardep.hpp new file mode 100644 index 0000000..ebfaef4 --- /dev/null +++ b/tests/test_cases/deps/transitive-components/bardep.hpp @@ -0,0 +1,8 @@ +#ifndef BARDEP_HPP +#define BARDEP_HPP + +typedef int bar_t; + +bar_t bardep(bar_t); + +#endif diff --git a/tests/test_cases/deps/transitive-components/baz.cpp b/tests/test_cases/deps/transitive-components/baz.cpp new file mode 100644 index 0000000..0354d55 --- /dev/null +++ b/tests/test_cases/deps/transitive-components/baz.cpp @@ -0,0 +1,10 @@ +#include "baz.hpp" + +#include "bazdep.hpp" +#include <iostream> +#include <ostream> + +int baz(int x) { + std::cout << "baz(" << x << ")" << std::endl; + return bazdep(x) * 13; +} diff --git a/tests/test_cases/deps/transitive-components/baz.hpp b/tests/test_cases/deps/transitive-components/baz.hpp new file mode 100644 index 0000000..926dd6d --- /dev/null +++ b/tests/test_cases/deps/transitive-components/baz.hpp @@ -0,0 +1,8 @@ +#ifndef BAZ_HPP +#define BAZ_HPP + +#include "bazdep.hpp" + +baz_t baz(baz_t); + +#endif diff --git a/tests/test_cases/deps/transitive-components/bazdep.cpp b/tests/test_cases/deps/transitive-components/bazdep.cpp new file mode 100644 index 0000000..c097661 --- /dev/null +++ b/tests/test_cases/deps/transitive-components/bazdep.cpp @@ -0,0 +1,9 @@ +#include "bazdep.hpp" + +#include <iostream> +#include <ostream> + +baz_t bazdep(baz_t x) { + std::cout << "bazdep(" << x << ")" << std::endl; + return x + 11; +} diff --git a/tests/test_cases/deps/transitive-components/bazdep.hpp b/tests/test_cases/deps/transitive-components/bazdep.hpp new file mode 100644 index 0000000..d2add97 --- /dev/null +++ b/tests/test_cases/deps/transitive-components/bazdep.hpp @@ -0,0 +1,8 @@ +#ifndef BAZDEP_HPP +#define BAZDEP_HPP + +typedef int baz_t; + +baz_t bazdep(baz_t); + +#endif diff --git a/tests/test_cases/deps/transitive-components/foo.cpp b/tests/test_cases/deps/transitive-components/foo.cpp new file mode 100644 index 0000000..197e1fb --- /dev/null +++ b/tests/test_cases/deps/transitive-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) * 3; +} diff --git a/tests/test_cases/deps/transitive-components/foo.hpp b/tests/test_cases/deps/transitive-components/foo.hpp new file mode 100644 index 0000000..45c286c --- /dev/null +++ b/tests/test_cases/deps/transitive-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/transitive-components/foodep.cpp b/tests/test_cases/deps/transitive-components/foodep.cpp new file mode 100644 index 0000000..e26c335 --- /dev/null +++ b/tests/test_cases/deps/transitive-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/transitive-components/foodep.hpp b/tests/test_cases/deps/transitive-components/foodep.hpp new file mode 100644 index 0000000..ea16bb0 --- /dev/null +++ b/tests/test_cases/deps/transitive-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/transitive-components/main.cpp b/tests/test_cases/deps/transitive-components/main.cpp new file mode 100644 index 0000000..3e2ae1c --- /dev/null +++ b/tests/test_cases/deps/transitive-components/main.cpp @@ -0,0 +1,11 @@ +#include "foo.hpp" +#include "bar.hpp" +#include "baz.hpp" + +#include <iostream> +#include <ostream> + +int main(int argc, char **argv) { + std::cout << "Hello-from-main" << std::endl; + std::cout << foo(bar(baz(13))) << std::endl; +} |