]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/tools/build/test/core_import_module.py
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / tools / build / test / core_import_module.py
CommitLineData
7c673cae
FG
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
8import BoostBuild
9
10t = BoostBuild.Tester(pass_toolset=0)
11
12t.write("code", """\
13module a
14{
15 rule r1 ( )
16 {
17 ECHO R1 ;
18 }
19
20 local rule l1 ( )
21 {
22 ECHO A.L1 ;
23 }
24}
25module a2
26{
27 rule r2 ( )
28 {
29 ECHO R2 ;
30 }
31}
32IMPORT a2 : r2 : : a2.r2 ;
33
34rule a.l1 ( )
35{
36 ECHO L1 ;
37}
38
39module 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
56IMPORT b : test : : test ;
57test ;
58
59module c
60{
61 rule test
62 {
63 ECHO CTEST ;
64 }
65}
66
67IMPORT_MODULE c : ;
68c.test ;
69
11fdf7f2 70EXIT : 0 ;
7c673cae
FG
71""")
72
73t.run_build_system(["-fcode"], stdout="""\
74R1
75R2
76L1
77A.L1
78CTEST
11fdf7f2 79
7c673cae
FG
80""")
81
82t.cleanup()