]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/tools/build/test/core_typecheck.py
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / tools / build / test / core_typecheck.py
CommitLineData
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
9import BoostBuild
10
11t = BoostBuild.Tester(["-ffile.jam"], pass_toolset=0)
12
13t.write("file.jam", """
14module .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
26rule do ( [path] a )
27{
28}
29
30do $(ARGUMENT) ;
31
32actions dummy { }
33dummy all ;
34""")
35
36t.run_build_system(["-sARGUMENT=::a/b/c"])
37t.run_build_system(["-sARGUMENT=a/b/c"], status=1, stdout="""\
38Error: a/b/c is not a path
39file.jam:18: in module scope
40*** argument error
41* rule do ( [path] a )
42* called with: ( a/b/c )
43* true a
44file.jam:16:see definition of rule 'do' being called
45""")
46
47t.cleanup()