]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/chain.py
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / tools / build / test / chain.py
1 #!/usr/bin/python
2
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)
7
8 # This tests that :
9 # 1) the 'make' correctly assigns types to produced targets
10 # 2) if 'make' creates targets of type CPP, they are correctly used.
11
12 import BoostBuild
13
14 t = BoostBuild.Tester(use_test_config=False)
15
16 # In order to correctly link this app, 'b.cpp', created by a 'make' rule, should
17 # be compiled.
18
19 t.write("jamroot.jam", "import gcc ;")
20
21 t.write("jamfile.jam", r'''
22 import os ;
23 if [ os.name ] = NT
24 {
25 actions create
26 {
27 echo int main() {} > $(<)
28 }
29 }
30 else
31 {
32 actions create
33 {
34 echo "int main() {}" > $(<)
35 }
36 }
37
38 IMPORT $(__name__) : create : : create ;
39
40 exe a : l dummy.cpp ;
41
42 # Needs to be a static lib for Windows - main() cannot appear in DLL.
43 static-lib l : a.cpp b.cpp ;
44
45 make b.cpp : : create ;
46 ''')
47
48 t.write("a.cpp", "")
49
50 t.write("dummy.cpp", "// msvc needs at least one object file\n")
51
52 t.run_build_system()
53
54 t.expect_addition("bin/$toolset/debug/a.exe")
55
56 t.cleanup()