]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #!/usr/bin/python |
2 | ||
3 | # Copyright (C) Vladimir Prus 2007. | |
4 | # Distributed under the Boost Software License, Version 1.0. (See | |
5 | # accompanying file LICENSE_1_0.txt or copy at | |
6 | # http://www.boost.org/LICENSE_1_0.txt) | |
7 | ||
8 | # Tests that a free feature specified on the command line applies to all | |
9 | # targets ever built. | |
10 | ||
11 | import BoostBuild | |
12 | ||
13 | t = BoostBuild.Tester(use_test_config=False) | |
14 | ||
15 | t.write("jamroot.jam", """\ | |
16 | exe hello : hello.cpp foo ; | |
17 | lib foo : foo.cpp ; | |
18 | """) | |
19 | ||
20 | t.write("hello.cpp", """\ | |
21 | extern void foo(); | |
22 | #ifdef FOO | |
23 | int main() { foo(); } | |
24 | #endif | |
25 | """) | |
26 | ||
27 | t.write("foo.cpp", """\ | |
28 | #ifdef FOO | |
29 | #ifdef _WIN32 | |
30 | __declspec(dllexport) | |
31 | #endif | |
32 | void foo() {} | |
33 | #endif | |
34 | """) | |
35 | ||
36 | # If FOO is not defined when compiling the 'foo' target, we will get a link | |
37 | # error at this point. | |
38 | t.run_build_system(["hello", "define=FOO"]) | |
39 | ||
b32b8144 | 40 | t.expect_addition("bin/$toolset/debug*/hello.exe") |
7c673cae FG |
41 | |
42 | t.cleanup() |