]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/param.py
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / tools / build / test / param.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_1_0.txt or copy at
6 # http://www.boost.org/LICENSE_1_0.txt)
7
8 import BoostBuild
9
10 t = BoostBuild.Tester(pass_toolset=0)
11
12 t.write("Jamroot.jam", """\
13 import param ;
14 import assert ;
15 import errors : try catch ;
16 rule test1 ( )
17 {
18 param.handle-named-params ;
19 }
20 test1 ;
21 rule test2 ( sources * )
22 {
23 param.handle-named-params sources ;
24 return $(sources) ;
25 }
26 assert.result : test2 ;
27 assert.result test1.cpp test2.cpp : test2 test1.cpp test2.cpp ;
28 assert.result test1.cpp test2.cpp : test2 sources test1.cpp test2.cpp ;
29 rule test3 ( sources * : requirements * )
30 {
31 param.handle-named-params sources requirements ;
32 return $(sources) -- $(requirements) ;
33 }
34 assert.result -- : test3 ;
35 assert.result -- <link>shared : test3 : <link>shared ;
36 assert.result test1.cpp -- <link>shared : test3 test1.cpp : <link>shared ;
37 assert.result test1.cpp -- <link>shared
38 : test3 test1.cpp : requirements <link>shared ;
39 assert.result test1.cpp -- <link>shared
40 : test3 sources test1.cpp : requirements <link>shared ;
41 assert.result test1.cpp -- <link>shared
42 : test3 requirements <link>shared : sources test1.cpp ;
43 assert.result -- : test3 sources ;
44 assert.result -- : test3 requirements ;
45 assert.result -- <link>shared : test3 requirements <link>shared ;
46 try ;
47 {
48 test3 sources test1.cpp : sources test2.cpp ;
49 }
50 catch Parameter 'sources' passed more than once. ;
51 try ;
52 {
53 test3 sources test1.cpp : <link>shared ;
54 }
55 catch "Positional arguments must appear first." ;
56 EXIT : 0 ;
57 """)
58
59 t.run_build_system()
60
61 t.cleanup()