]>
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 | # Test correct "-p" option handling. | |
9 | ||
10 | import BoostBuild | |
11 | ||
11fdf7f2 | 12 | t = BoostBuild.Tester(["-d1"], pass_toolset=False) |
7c673cae FG |
13 | |
14 | t.write("file.jam", """\ | |
15 | prefix = "echo \\"" ; | |
16 | suffix = "\\"" ; | |
17 | if $(NT) | |
18 | { | |
19 | prefix = "(echo " ; | |
20 | suffix = ")" ; | |
21 | } | |
22 | actions go | |
23 | { | |
24 | $(prefix)stdout$(suffix) | |
1e59de90 | 25 | >&2 $(prefix)stderr$(suffix) |
7c673cae | 26 | } |
11fdf7f2 | 27 | ECHO "{{{" $(XXX) "}}}" ; |
7c673cae FG |
28 | ALWAYS all ; |
29 | go all ; | |
30 | """) | |
31 | ||
32 | t.run_build_system(["-ffile.jam", "-sXXX=1"], stderr="") | |
33 | t.expect_output_lines("{{{ 1 }}}") | |
34 | t.expect_output_lines("stdout") | |
35 | t.expect_output_lines("stderr") | |
36 | t.expect_nothing_more() | |
37 | ||
38 | t.run_build_system(["-ffile.jam", "-sXXX=2", "-p0"], stderr="") | |
39 | t.expect_output_lines("{{{ 2 }}}") | |
40 | t.expect_output_lines("stdout") | |
41 | t.expect_output_lines("stderr") | |
42 | t.expect_nothing_more() | |
43 | ||
44 | t.run_build_system(["-ffile.jam", "-sXXX=3", "-p1"], stderr="") | |
45 | t.expect_output_lines("{{{ 3 }}}") | |
46 | t.expect_output_lines("stdout") | |
47 | t.expect_output_lines("stderr*", False) | |
48 | t.expect_nothing_more() | |
49 | ||
50 | t.run_build_system(["-ffile.jam", "-sXXX=4", "-p2"], stderr="stderr\n") | |
51 | t.expect_output_lines("{{{ 4 }}}") | |
52 | t.expect_output_lines("stdout*", False) | |
53 | t.expect_output_lines("stderr*", False) | |
54 | t.expect_nothing_more() | |
55 | ||
56 | t.run_build_system(["-ffile.jam", "-sXXX=5", "-p3"], stderr="stderr\n") | |
57 | t.expect_output_lines("{{{ 5 }}}") | |
58 | t.expect_output_lines("stdout") | |
59 | t.expect_output_lines("stderr*", False) | |
60 | t.expect_nothing_more() | |
61 | ||
62 | t.cleanup() |