Imported Upstream version 1.57.0
[platform/upstream/boost.git] / tools / build / test / prebuilt.py
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 import BoostBuild
10
11 t = BoostBuild.Tester(["debug", "release"], use_test_config=False)
12
13 t.set_tree('prebuilt')
14
15 t.expand_toolset("ext/jamroot.jam")
16 t.expand_toolset("jamroot.jam")
17
18 # First, build the external project.
19 t.run_build_system(subdir="ext")
20
21 # Then pretend that we do not have the sources for the external project, and
22 # can only use compiled binaries.
23 t.copy("ext/jamfile2.jam", "ext/jamfile.jam")
24 t.expand_toolset("ext/jamfile.jam")
25
26 # Now check that we can build the main project, and that correct prebuilt file
27 # is picked, depending of variant. This also checks that correct includes for
28 # prebuilt libraries are used.
29 t.run_build_system()
30 t.expect_addition("bin/$toolset/debug/hello.exe")
31 t.expect_addition("bin/$toolset/release/hello.exe")
32
33 t.rm("bin")
34
35
36 # Now test that prebuilt file specified by absolute name works too.
37 t.copy("ext/jamfile3.jam", "ext/jamfile.jam")
38 t.expand_toolset("ext/jamfile.jam")
39 t.run_build_system()
40 t.expect_addition("bin/$toolset/debug/hello.exe")
41 t.expect_addition("bin/$toolset/release/hello.exe")
42
43 t.cleanup()