]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #!/usr/bin/python |
2 | ||
3 | # Copyright 2012. Jurko Gospodnetic | |
4 | # Distributed under the Boost Software License, Version 1.0. | |
1e59de90 TL |
5 | # (See accompanying file LICENSE.txt or copy at |
6 | # https://www.bfgroup.xyz/b2/LICENSE.txt) | |
7c673cae FG |
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 ; | |
11fdf7f2 | 25 | ECHO From "rule:" $(a)" seconds" ; |
7c673cae FG |
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() |