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