]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/core_import_module.py
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / tools / build / test / core_import_module.py
1 #!/usr/bin/python
2
3 # Copyright 2003 Vladimir Prus
4 # Distributed under the Boost Software License, Version 1.0.
5 # (See accompanying file LICENSE_1_0.txt or copy at
6 # http://www.boost.org/LICENSE_1_0.txt)
7
8 import BoostBuild
9
10 t = BoostBuild.Tester(pass_toolset=0)
11
12 t.write("code", """\
13 module a
14 {
15 rule r1 ( )
16 {
17 ECHO R1 ;
18 }
19
20 local rule l1 ( )
21 {
22 ECHO A.L1 ;
23 }
24 }
25 module a2
26 {
27 rule r2 ( )
28 {
29 ECHO R2 ;
30 }
31 }
32 IMPORT a2 : r2 : : a2.r2 ;
33
34 rule a.l1 ( )
35 {
36 ECHO L1 ;
37 }
38
39 module b
40 {
41 IMPORT_MODULE a : b ;
42 rule test
43 {
44 # Call rule visible via IMPORT_MODULE
45 a.r1 ;
46 # Call rule in global scope
47 a2.r2 ;
48 # Call rule in global scope. Doesn't find local rule
49 a.l1 ;
50 # Make l1 visible
51 EXPORT a : l1 ;
52 a.l1 ;
53 }
54 }
55
56 IMPORT b : test : : test ;
57 test ;
58
59 module c
60 {
61 rule test
62 {
63 ECHO CTEST ;
64 }
65 }
66
67 IMPORT_MODULE c : ;
68 c.test ;
69
70 actions do-nothing { }
71 do-nothing all ;
72 """)
73
74 t.run_build_system(["-fcode"], stdout="""\
75 R1
76 R2
77 L1
78 A.L1
79 CTEST
80 """)
81
82 t.cleanup()