]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #!/usr/bin/python |
2 | ||
3 | # Copyright 2003 Vladimir Prus | |
4 | # Distributed under the Boost Software License, Version 1.0. | |
1e59de90 | 5 | # (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) |
7c673cae FG |
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 | { | |
11fdf7f2 | 16 | rule "[path]" ( x ) |
7c673cae FG |
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() |