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 12t = BoostBuild.Tester(["-d1"], pass_toolset=False) 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} 27ECHO "{{{" $(XXX) "}}}" ; 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() 63