#!/usr/bin/python # Test staging from BoostBuild import Tester t = Tester() t.write("project-root.jam", "import gcc ;") t.write("Jamfile", """ lib a : a.cpp ; stage dist : a a.h auxilliary/1 ; """) t.write("a.cpp", "") t.write("a.h", "") t.write("auxilliary/1", "") t.run_build_system() t.expect_addition(["dist/a.dll", "dist/a.h", "dist/1"]) # Test the <location> property t.write( "Jamfile", """ lib a : a.cpp ; stage dist : a : <variant>debug:<location>ds <variant>release:<location>rs ; """) t.run_build_system() t.expect_addition("ds/a.dll")
#!/usr/bin/python from BoostBuild import Tester import os t = Tester("--build-system=project-test1", boost_build_path='', pass_toolset=0) # This test does no modifications, so run in in the invocation dir os.chdir(t.original_workdir) expected_output1 = """Project Roots: """ expected_output2 = """'%(root-dir-prefix)sdir2': Module for project-root is 'project-root<%(root-dir-prefix)sdir2>' Projects: '/cool-library': * Project root: %(root-dir-prefix)sdir2 * Parent project: (none) * Requirements: <include>/home/ghost/build/boost-cvs * Default build: * Source location: %(root-dir-prefix)sdir2 * Projects to build: """
#!/usr/bin/python # Copyright 2002, 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) from BoostBuild import Tester t = Tester(pass_toolset=0) t.run_build_system(extra_args="--debug --build-system=test") t.cleanup()
#!/usr/bin/python from BoostBuild import Tester, List import os from string import strip import re def match_re(actual, expected): return re.match(expected, actual, re.DOTALL) != None t = Tester(match=match_re) t.set_tree('testing-primitives') # We expect t5 and t7's output to be dumped to stdout t.run_build_system(stdout=r'''.*failing t5.*failing t7''') t.expect_addition('t2.txt') t.expect_addition('t3.txt') t.expect_addition('t5.out') t.expect_addition('t6.out') t.expect_addition('t6.txt') t.expect_addition('t7.out') t.expect_addition('t7.txt') t.expect_addition('t8.out')
#!/usr/bin/python from BoostBuild import Tester, List import os from string import strip t = Tester(translate_suffixes=0) # First check some startup t.set_tree("project-test3") os.remove("project-root.jam") t.run_build_system(status=1, stdout="""error: Could not find parent for project at '.' error: Did not find Jamfile or project-root.jam in any parent directory. """) t.set_tree("project-test3") t.run_build_system() t.expect_addition("bin/$toolset/debug/a.obj") t.expect_content("bin/$toolset/debug/a.obj", """$toolset/debug a.cpp """) t.expect_addition("bin/$toolset/debug/a.exe") t.expect_content( "bin/$toolset/debug/a.exe", "$toolset/debug\n" + "bin/$toolset/debug/a.obj lib/bin/$toolset/debug/b.obj " + "lib2/bin/$toolset/debug/c.obj lib2/bin/$toolset/debug/d.obj " + "lib2/helper/bin/$toolset/debug/e.obj " +
#!/usr/bin/python from BoostBuild import Tester import os import re def match_re(actual, expected): return re.match(expected, actual, re.DOTALL) != None # Test the v1 startup behavior t = 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) os.chdir('no-bootstrap1') 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"''')
# Niklaus Giger, 2005-03-15 # Testing whether we may run a test in a absolute directories # There are no tests for temporary directories as this is implictly tested in a lot of other cases from BoostBuild import Tester import os, string t = Tester(executable="jam", workdir=os.getcwd(), pass_toolset=0) jamfile = """ actions print_pwd { pwd ; } print_pwd pwd ; Always pwd ; """ t.write("Jamfile", jamfile) t.write("project-root.jam", " ") t.run_build_system(status=0, extra_args="pwd") if 'TMP' in os.environ: tmp_dir = os.environ.get('TMP') else: tmp_dir = "/tmp" if string.rfind(t.stdout(), tmp_dir) != -1: t.fail_test(1) if string.rfind(t.stdout(), 'build/v2/test') == -1: t.fail_test(1)
from BoostBuild import Tester import os import re def expect_substring(actual, expected): return actual.find(expected) != -1 def match_re(actual, expected): return re.match(expected, actual, re.DOTALL) != None # Test the v1 startup behavior t = Tester(executable='bjam', match=match_re, boost_build_path='', pass_toolset=0) t.set_tree('startup') #if os.name == 'nt': # t.run_build_system( # status=1, stdout="You didn't set BOOST_ROOT", match = expect_substring) t.run_build_system( extra_args='-sBOOST_ROOT=.', status=1, stdout= r'''Unable to load Boost\.Build: could not find "boost-build\.jam".''') os.chdir('no-bootstrap1')
#!/usr/bin/python from BoostBuild import Tester, List import os from string import strip import re import time def match_re(actual, expected): return re.match(expected, actual, re.DOTALL) != None t = Tester(match=match_re, boost_build_path=os.path.join(os.getcwd(), "..")) t.set_tree('v1_testing') os.environ['TOOLS'] = 'gcc' os.environ['NOARSCAN'] = '1' # 1) No existing bin directories. Both build and test ran fine. As # expected, the residue files were a bit different: There was no # path_test.success, and path_test.test contained the word "passed" # instead of the path to the .cpp file. I've haven't looked yet to # see if the lack of the path is a problem for reporting, but # hopefully the information is trivially available somewhere else. t.run_build_system(arguments='test', status=0) t.expect_addition([ 'bin/compile.test/gcc/debug/runtime-link-dynamic/compile.test', 'bin/nocompile.test/gcc/debug/runtime-link-dynamic/nocompile.test', 'bin/link.test/gcc/debug/runtime-link-dynamic/link.test', 'bin/nolink.test/gcc/debug/runtime-link-dynamic/nolink.test',
#!/usr/bin/python # (c) Copyright Juergen Hunold 2008 # Use, modification, and distribution are subject to the # Boost Software License, Version 1.0. (See accompanying file # LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) import os from BoostBuild import Tester # Run test in real directory in order to find Boost.Test via Boost Top-Level Jamroot qt4_dir = os.getcwd() + "/qt4" t = Tester(workdir=qt4_dir) t.run_build_system() t.cleanup()