]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/default_build.py
3 # Copyright 2003 Dave Abrahams
4 # Copyright 2002, 2003 Vladimir Prus
5 # Distributed under the Boost Software License, Version 1.0.
6 # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
8 # Test that default build clause actually has any effect.
12 t
= BoostBuild
.Tester(use_test_config
=False)
14 t
.write("jamroot.jam", "")
15 t
.write("jamfile.jam", "exe a : a.cpp : : debug release ;")
16 t
.write("a.cpp", "int main() {}\n")
19 t
.expect_addition("bin/$toolset/debug/a.exe")
20 t
.expect_addition("bin/$toolset/release/a.exe")
22 # Check that explictly-specified build variant suppresses default-build.
24 t
.run_build_system(["release"])
25 t
.expect_addition(BoostBuild
.List("bin/$toolset/release/") * "a.exe a.obj")
26 t
.expect_nothing_more()
28 # Now check that we can specify explicit build request and default-build will be
30 t
.run_build_system(["optimization=space"])
31 t
.expect_addition("bin/$toolset/debug/optimization-space/a.exe")
32 t
.expect_addition("bin/$toolset/release/optimization-space/a.exe")
34 # Test that default-build must be identical in all alternatives. Error case.
35 t
.write("jamfile.jam", """\
36 exe a : a.cpp : : debug ;
39 t
.run_build_system(["-n", "--no-error-backtrace"], status
=1)
40 t
.fail_test(t
.stdout().find("default build must be identical in all alternatives") == -1)
42 # Test that default-build must be identical in all alternatives. No Error case,
43 # empty default build.
44 t
.write("jamfile.jam", """\
45 exe a : a.cpp : <variant>debug ;
46 exe a : b.cpp : <variant>release ;
48 t
.run_build_system(["-n", "--no-error-backtrace"], status
=0)
50 # Now try a harder example: default build which contains <define> should cause
51 # <define> to be present when "b" is compiled. This happens only if
52 # "build-project b" is placed first.
53 t
.write("jamfile.jam", """\
54 project : default-build <define>FOO ;
59 t
.write("a/jamfile.jam", "exe a : a.cpp ../b//b ;")
60 t
.write("a/a.cpp", """\
68 t
.write("b/jamfile.jam", "lib b : b.cpp ;")
69 t
.write("b/b.cpp", """\