]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/toolset_defaults.py
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / tools / build / test / toolset_defaults.py
1 #!/usr/bin/python
2
3 # Copyright 2018 Steven Watanabe
4 # Distributed under the Boost Software License, Version 1.0.
5 # (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt)
6
7 # Test the handling of toolset.add-defaults
8
9 import BoostBuild
10
11 t = BoostBuild.Tester(pass_toolset=0, ignore_toolset_requirements=False)
12
13 t.write('jamroot.jam', '''
14 import toolset ;
15 import errors ;
16 import feature : feature ;
17 import set ;
18
19 feature f1 : a b ;
20 feature f2 : c d ;
21 feature f3 : e f ;
22 feature f4 : g h ;
23 feature f5 : i j ;
24 feature f6 : k l m ;
25
26 rule test-rule ( properties * )
27 {
28 if <f1>a in $(properties)
29 {
30 return <f2>d ;
31 }
32 }
33
34 toolset.add-defaults
35 <conditional>@test-rule
36 <f3>e:<f4>h
37 <f5>i:<f6>l
38 ;
39
40 rule check-requirements ( target : sources * : properties * )
41 {
42 local expected = <f2>d <f4>h <f6>m ;
43 local unexpected = <f2>c <f4>g <f6>k <f6>l ;
44 local missing = [ set.difference $(expected) : $(properties) ] ;
45 if $(missing)
46 {
47 errors.error $(missing) not present ;
48 }
49 local extra = [ set.intersection $(unexpected) : $(properties) ] ;
50 if $(extra)
51 {
52 errors.error $(extra) present ;
53 }
54 }
55 make test : : @check-requirements : <f6>m ;
56 ''')
57
58 t.run_build_system()
59
60 t.cleanup()