diff options
| author | Christoph Berg <myon@debian.org> | 2018-12-19 22:58:32 +0100 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2018-12-19 22:58:32 +0100 |
| commit | e0737c56c1e384e05064a0c6e1ac46979371041b (patch) | |
| tree | a0123d694a2d36c43dabdf0a3907392fce11d457 /boost/tools/build/test/direct_request_test.py | |
| parent | b4aebf2d137b892f53503b13785ecae900062ff7 (diff) | |
New upstream version 2.0.0+repackupstream/2.0.0+repack
Diffstat (limited to 'boost/tools/build/test/direct_request_test.py')
| -rw-r--r-- | boost/tools/build/test/direct_request_test.py | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/boost/tools/build/test/direct_request_test.py b/boost/tools/build/test/direct_request_test.py new file mode 100644 index 00000000..49a08320 --- /dev/null +++ b/boost/tools/build/test/direct_request_test.py @@ -0,0 +1,68 @@ +#!/usr/bin/python + +import BoostBuild + +t = BoostBuild.Tester(use_test_config=False) + +# First check some startup. + +t.write("jamroot.jam", "") +t.write("jamfile.jam", """\ +exe a : a.cpp b ; +lib b : b.cpp ; +""") + +t.write("a.cpp", """\ +void +# ifdef _WIN32 +__declspec(dllimport) +# endif +foo(); +int main() { foo(); } +""") + +t.write("b.cpp", """\ +#ifdef MACROS +void +# ifdef _WIN32 +__declspec(dllexport) +# endif +foo() {} +#endif + +# ifdef _WIN32 +int __declspec(dllexport) force_implib_creation; +# endif +""") + +t.run_build_system(["define=MACROS"]) +t.expect_addition("bin/$toolset/debug/" + * (BoostBuild.List("a.obj b.obj b.dll a.exe"))) + + +# When building a debug version, the 'define' still applies. +t.rm("bin") +t.run_build_system(["debug", "define=MACROS"]) +t.expect_addition("bin/$toolset/debug/" + * (BoostBuild.List("a.obj b.obj b.dll a.exe"))) + + +# When building a release version, the 'define' still applies. +t.write("jamfile.jam", """\ +exe a : a.cpp b : <variant>debug ; +lib b : b.cpp ; +""") +t.rm("bin") +t.run_build_system(["release", "define=MACROS"]) + + +# Regression test: direct build request was not working when there was more +# than one level of 'build-project'. +t.rm(".") +t.write("jamroot.jam", "") +t.write("jamfile.jam", "build-project a ;") +t.write("a/jamfile.jam", "build-project b ;") +t.write("a/b/jamfile.jam", "") +t.run_build_system(["release"]) + +t.cleanup() |
