diff options
Diffstat (limited to 'tools/build/v2/test/direct_request_test.py')
-rw-r--r-- | tools/build/v2/test/direct_request_test.py | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/tools/build/v2/test/direct_request_test.py b/tools/build/v2/test/direct_request_test.py index 000d15b64d..32121f1d75 100644 --- a/tools/build/v2/test/direct_request_test.py +++ b/tools/build/v2/test/direct_request_test.py @@ -4,9 +4,42 @@ import BoostBuild t = BoostBuild.Tester() - # First check some startup. -t.set_tree("direct-request-test") + +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(extra_args="define=MACROS") t.expect_addition("bin/$toolset/debug/" * (BoostBuild.List("a.obj b.obj b.dll a.exe"))) @@ -19,11 +52,11 @@ t.expect_addition("bin/$toolset/debug/" * (BoostBuild.List("a.obj b.obj b.dll a.exe"))) -# When building release version, the 'define' should not apply: we will have -# direct build request 'release <define>MACROS' and a real build property -# 'debug'. -t.copy("jamfile2.jam", "jamfile.jam") -t.copy("b_inverse.cpp", "b.cpp") +# When building 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(extra_args="release define=MACROS") |