1 | #!/usr/bin/python |
---|
2 | |
---|
3 | # Copyright 2002, 2003, 2004 Vladimir Prus |
---|
4 | # Distributed under the Boost Software License, Version 1.0. |
---|
5 | # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) |
---|
6 | |
---|
7 | # Test that we can use already built sources |
---|
8 | |
---|
9 | from BoostBuild import Tester |
---|
10 | t = Tester() |
---|
11 | |
---|
12 | t.set_tree('prebuilt') |
---|
13 | |
---|
14 | t.expand_toolset("ext/project-root.jam") |
---|
15 | t.expand_toolset("project-root.jam") |
---|
16 | # First, build the external project |
---|
17 | t.run_build_system("debug release", subdir="ext") |
---|
18 | |
---|
19 | # Then pretend that we don't have the sources for the external project, |
---|
20 | # and can only use compiled binaries |
---|
21 | t.copy("ext/Jamfile2", "ext/Jamfile") |
---|
22 | t.expand_toolset("ext/Jamfile") |
---|
23 | |
---|
24 | # Now check that we can build the main project, and that |
---|
25 | # correct prebuilt file is picked, depending of variant. |
---|
26 | # This also checks that correct includes for prebuilt |
---|
27 | # libraries are used. |
---|
28 | |
---|
29 | t.run_build_system("debug release") |
---|
30 | t.expect_addition("bin/$toolset/debug/hello.exe") |
---|
31 | t.expect_addition("bin/$toolset/release/hello.exe") |
---|
32 | |
---|
33 | t.rm("bin") |
---|
34 | # Now test that prebuilt file specified by absolute name |
---|
35 | # works too. |
---|
36 | t.copy("ext/Jamfile3", "ext/Jamfile") |
---|
37 | t.expand_toolset("ext/Jamfile") |
---|
38 | t.run_build_system("debug release") |
---|
39 | t.expect_addition("bin/$toolset/debug/hello.exe") |
---|
40 | t.expect_addition("bin/$toolset/release/hello.exe") |
---|
41 | |
---|
42 | |
---|
43 | t.cleanup() |
---|