]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #!/usr/bin/python |
2 | ||
3 | # Copyright 2011 Steven Watanabe | |
1e59de90 | 4 | # Copyright 2020 Rene Ferdinand Rivera Morell |
7c673cae | 5 | # Distributed under the Boost Software License, Version 1.0. |
1e59de90 TL |
6 | # (See accompanying file LICENSE.txt or copy at |
7 | # https://www.bfgroup.xyz/b2/LICENSE.txt) | |
7c673cae FG |
8 | |
9 | ||
10 | import BoostBuild | |
11 | ||
12 | t = BoostBuild.Tester(["-ffile.jam"], pass_toolset=0) | |
13 | ||
14 | t.write("file.jam", """\ | |
15 | name = n1 n2 ; | |
16 | contents = M1 M2 ; | |
1e59de90 | 17 | EXIT "file:" "@(o$(name:J=) .txt:E= test -D$(contents))" : 0 ; |
7c673cae FG |
18 | """) |
19 | ||
20 | t.run_build_system() | |
1e59de90 TL |
21 | t.expect_output_lines("file: on1n2 .txt") |
22 | t.expect_addition("on1n2 .txt") | |
23 | t.expect_content("on1n2 .txt", " test -DM1 -DM2", True) | |
7c673cae FG |
24 | |
25 | t.rm(".") | |
26 | ||
27 | t.write("file.jam", """\ | |
28 | name = n1 n2 ; | |
29 | contents = M1 M2 ; | |
1e59de90 | 30 | actions run { echo file: "@(o$(name:J=) .txt:E= test -D$(contents))" } |
7c673cae FG |
31 | run all ; |
32 | """) | |
33 | ||
34 | t.run_build_system(["-d2"]) | |
1e59de90 TL |
35 | t.expect_output_lines(' echo file: "on1n2 .txt" ') |
36 | t.expect_addition("on1n2 .txt") | |
37 | t.expect_content("on1n2 .txt", " test -DM1 -DM2", True) | |
7c673cae FG |
38 | |
39 | t.rm(".") | |
40 | ||
41 | t.write("file.jam", """\ | |
42 | name = n1 n2 ; | |
43 | contents = M1 M2 ; | |
44 | file = "@($(STDOUT):E= test -D$(contents)\n)" ; | |
45 | actions run { $(file) } | |
46 | run all ; | |
47 | """) | |
48 | ||
49 | t.run_build_system(["-d1"]) | |
50 | t.expect_output_lines(" test -DM1 -DM2") | |
51 | ||
52 | t.rm(".") | |
53 | ||
54 | t.write("file.jam", """\ | |
55 | name = n1 n2 ; | |
56 | contents = M1 M2 ; | |
57 | actions run { @($(STDOUT):E= test -D$(contents)\n) } | |
58 | run all ; | |
59 | """) | |
60 | ||
61 | t.run_build_system(["-d1"]) | |
62 | t.expect_output_lines(" test -DM1 -DM2") | |
63 | ||
64 | t.cleanup() |