]>
Commit | Line | Data |
---|---|---|
20effc67 TL |
1 | #!/usr/bin/env python |
2 | ||
3 | # Copyright 2020 Nikita Kniazev | |
4 | # Distributed under the Boost Software License, Version 1.0. | |
1e59de90 TL |
5 | # (See accompanying file LICENSE.txt or copy at |
6 | # https://www.bfgroup.xyz/b2/LICENSE.txt) | |
20effc67 TL |
7 | |
8 | # Tests the force-include feature | |
9 | ||
10 | import BoostBuild | |
11 | ||
12 | t = BoostBuild.Tester(use_test_config=False) | |
13 | ||
14 | t.write("Jamroot.jam", """ | |
15 | obj test-cpp : test.cpp : <force-include>one.h <force-include>two.h ; | |
16 | obj test-c : test.c : <force-include>one.h <force-include>two.h ; | |
17 | """) | |
18 | ||
19 | for name in ("test.cpp", "test.c"): | |
20 | t.write(name, """ | |
21 | #ifndef ONE | |
22 | #error Cannot compile without ONE | |
23 | #endif | |
24 | #ifndef TWO | |
25 | #error Cannot compile without TWO | |
26 | #endif | |
27 | """) | |
28 | ||
29 | t.write("one.h", """ | |
30 | #define ONE | |
31 | """) | |
32 | ||
33 | t.write("two.h", """ | |
34 | #define TWO | |
35 | """) | |
36 | ||
37 | t.run_build_system() | |
38 | t.expect_addition("bin/$toolset/debug*/test-cpp.obj") | |
39 | t.expect_addition("bin/$toolset/debug*/test-c.obj") | |
40 | ||
41 | t.cleanup() |