]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/core_typecheck.py
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / tools / build / test / core_typecheck.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 http://www.boost.org/LICENSE_1_0.txt)
6
7 # This tests the typechecking facilities.
8
9 import BoostBuild
10
11 t = BoostBuild.Tester(["-ffile.jam"], pass_toolset=0)
12
13 t.write("file.jam", """
14 module .typecheck
15 {
16 rule [path] ( x )
17 {
18 if ! [ MATCH "^(::)" : $(x) ]
19 {
20 ECHO "Error: $(x) is not a path" ;
21 return true ;
22 }
23 }
24 }
25
26 rule do ( [path] a )
27 {
28 }
29
30 do $(ARGUMENT) ;
31
32 actions dummy { }
33 dummy all ;
34 """)
35
36 t.run_build_system(["-sARGUMENT=::a/b/c"])
37 t.run_build_system(["-sARGUMENT=a/b/c"], status=1, stdout="""\
38 Error: a/b/c is not a path
39 file.jam:18: in module scope
40 *** argument error
41 * rule do ( [path] a )
42 * called with: ( a/b/c )
43 * true a
44 file.jam:16:see definition of rule 'do' being called
45 """)
46
47 t.cleanup()