diff --git a/test/startup_v2.py b/test/startup_v2.py index a4faf56de..ea4e39c4c 100644 --- a/test/startup_v2.py +++ b/test/startup_v2.py @@ -7,73 +7,53 @@ import BoostBuild import os +import os.path import re -def match_re(actual,expected): - return re.match(expected,actual,re.DOTALL) != None +def match_re(actual, expected): + return re.match(expected, actual, re.DOTALL) != None + -# Test the v1 startup behavior. t = BoostBuild.Tester(match=match_re, boost_build_path='', pass_toolset=0) - t.set_tree('startup') -t.run_build_system( - status=1, stdout=r'''Unable to load Boost\.Build: could not find "boost-build.jam" -.*Attempted search from .* up to the root''', match = match_re) +t.run_build_system(status=1, stdout= +r'''Unable to load Boost\.Build: could not find "boost-build\.jam" +.*Attempted search from .* up to the root''') -os.chdir('no-bootstrap1') +t.run_build_system(status=1, subdir='no-bootstrap1', + stdout=r'''Unable to load Boost\.Build: could not find build system\.''' + r'''.*attempted to load the build system by invoking''' + r'''.*'boost-build ;'.*''' + r'''but we were unable to find "bootstrap\.jam"''') -t.run_build_system( - status=1 - , stdout=r'''Unable to load Boost\.Build: could not find build system\.''' - + r'''.*attempted to load the build system by invoking''' - + r'''.*'boost-build ;'.*''' - + r'''but we were unable to find "bootstrap\.jam"''' - ) +# Descend to a subdirectory which /does not/ contain a boost-build.jam file, +# and try again to test the crawl-up behavior. +t.run_build_system(status=1, subdir=os.path.join('no-bootstrap1', 'subdir'), + stdout=r'''Unable to load Boost\.Build: could not find build system\.''' + r'''.*attempted to load the build system by invoking''' + r'''.*'boost-build ;'.*''' + r'''but we were unable to find "bootstrap\.jam"''') -# Descend to a subdirectory which /doesn't/ contain a boost-build.jam file, and -# try again to test the crawl-up behavior. -os.chdir('subdir') +t.run_build_system(status=1, subdir='no-bootstrap2', + stdout=r'''Unable to load Boost\.Build: could not find build system\.''' + r'''.*attempted to load the build system by invoking''' + r'''.*'boost-build \. ;'.*''' + r'''but we were unable to find "bootstrap\.jam"''') -t.run_build_system( - status=1 - , stdout=r'''Unable to load Boost\.Build: could not find build system\.''' - + r'''.*attempted to load the build system by invoking''' - + r'''.*'boost-build ;'.*''' - + r'''but we were unable to find "bootstrap\.jam"''' - ) - -os.chdir('../../no-bootstrap2') - -t.run_build_system( - status=1 - , stdout=r'''Unable to load Boost\.Build: could not find build system\.''' - + r'''.*attempted to load the build system by invoking''' - + r'''.*'boost-build \. ;'.*''' - + r'''but we were unable to find "bootstrap\.jam"''' - ) - -os.chdir('../no-bootstrap3') - -t.run_build_system( - status=1 - , stdout=r'''Unable to load Boost.Build -.*boost-build.jam" was found.* -However, it failed to call the "boost-build" rule''' - ) +t.run_build_system(status=1, subdir='no-bootstrap3', stdout= +r'''Unable to load Boost.Build +.*boost-build\.jam" was found.* +However, it failed to call the "boost-build" rule''') # Test bootstrapping based on BOOST_BUILD_PATH. -os.chdir('../bootstrap-env') -t.run_build_system( - extra_args = '-sBOOST_BUILD_PATH=../boost-root/build' - , stdout = 'build system bootstrapped' - ) +t.run_build_system(subdir='bootstrap-env', + extra_args='-sBOOST_BUILD_PATH=../boost-root/build', + stdout='build system bootstrapped') # Test bootstrapping based on an explicit path in boost-build.jam. -os.chdir('../bootstrap-explicit') -t.run_build_system( - stdout = 'build system bootstrapped' - ) +t.run_build_system(subdir='bootstrap-explicit', + stdout='build system bootstrapped') t.cleanup()