]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/core_variables_in_actions.py
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / tools / build / test / core_variables_in_actions.py
1 #!/usr/bin/python
2
3 # Copyright 2012. Jurko Gospodnetic
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 # Tests that variables in actions get expanded but double quote characters
9 # get treated as regular characters and not string literal delimiters when
10 # determining string tokens concatenated to the variable being expanded.
11 #
12 # We also take care to make this test work correctly when run using both
13 # Windows and Unix echo command variant. That is why we add the extra single
14 # quotes around the text being echoed - they will make the double quotes be
15 # displayed as regular characters in both cases but will be displayed
16 # themselves only when using the Windows cmd shell's echo command.
17
18 import BoostBuild
19
20 t = BoostBuild.Tester(pass_toolset=0)
21 t.write("file.jam", """\
22 rule dummy ( i )
23 {
24 local a = 1 2 3 ;
25 ECHO From rule: $(a)" seconds" ;
26 a on $(i) = $(a) ;
27 }
28
29 actions dummy
30 {
31 echo 'From action: $(a)" seconds"'
32 }
33
34 dummy all ;
35 """)
36 t.run_build_system(["-ffile.jam", "-d1"])
37 t.expect_output_lines("From rule: 1 seconds 2 seconds 3 seconds")
38 t.expect_output_lines('*From action: 1" 2" 3" seconds"*')
39 t.cleanup()