alias src : s.cpp ; exe hello : hello.cpp src ; """) t.write("a.cpp", "int main() { return 0; }\n") t.copy("a.cpp", "b.cpp") t.copy("a.cpp", "c.cpp") t.copy("a.cpp", "hello.cpp") t.write("s.cpp", "") # Check that targets to which "bin1" refers are updated, # and only those. t.run_build_system("bin1") t.ignore("*.tds") t.expect_addition(List("bin/$toolset/debug/") * "a.exe a.obj") t.expect_nothing_more() # Try again with "bin2" t.run_build_system("bin2") t.ignore("*.tds") t.expect_addition(List("bin/$toolset/debug/") * "b.exe b.obj") t.expect_nothing_more() # Try building everything, making sure 'hello' target is # created t.run_build_system() t.ignore("*.tds") t.expect_addition("bin/$toolset/debug/hello.exe") t.cleanup()
""") t.run_build_system('hardcode-dll-paths=false') t.expect_content("bin/r.test/$toolset/debug/r.output", "test input\nEXIT STATUS: 0\n") t.expect_addition('bin/$toolset/debug/execution.time') t.expect_addition('bin/$toolset/debug/compilation.time') # Make sure test failures are detected. Reverse expectation and see # if .test files are created or not. t.write( "Jamfile", """ import testing ; compile-fail c.cpp ; compile c-f.cpp ; run-fail r.cpp : : dir/input.txt ; run r-f.cpp ; """) t.touch(List("c.cpp c-f.cpp r.cpp r-f.cpp")) t.run_build_system("hardcode-dll-paths=false", stderr=None, status=1) t.expect_removal("bin/c.test/$toolset/debug/c.test") t.expect_removal("bin/c-f.test/$toolset/debug/c-f.test") t.expect_removal("bin/r.test/$toolset/debug/r.test") t.expect_removal("bin/r-f.test/$toolset/debug/r-f.test") t.cleanup()
#!/usr/bin/python from BoostBuild import Tester, List import os t = Tester() t.set_tree("generators-test") t.run_build_system() t.expect_addition("bin/$toolset/debug/" * (List( "a.obj b.obj c.h c.cpp c.obj d_parser.whl d_lexer.dlp d_parser.cpp d_lexer.cpp " + "d_parser.lr0 d_parser.h d_parser_symbols.h x.c x.obj y.x1 y.x2 " + "y.cpp y.obj e.marked_cpp e.positions e.target_cpp e.obj "))) ok = 0 t.expect_addition("bin/$toolset/debug/a.exe") t.expect_addition([ "lib/bin/$toolset/debug/c.obj", "lib/bin/$toolset/debug/auxilliary.lib", ]) t.run_build_system(subdir='lib') t.expect_addition(["lib/bin/$toolset/debug/auxilliary2.dll"]) t.run_build_system(subdir='lib', extra_args="link=static") t.expect_addition(["lib/bin/$toolset/debug/link-static/auxilliary2.lib"])
# Test the 'symlink' rule from BoostBuild import Tester, List import os t = Tester() if os.name != 'posix': print "The symlink tests can be run on posix only" sys.exit(1) t.write("project-root.jam", "import gcc ;") t.write( "Jamfile", """ exe hello : hello.cpp ; symlink hello_release : hello/<variant>release ; symlink hello_debug : hello/<variant>debug ; symlink links/hello_release : hello/<variant>release ; """) t.write("hello.cpp", """ int main() { return 0; } """) t.run_build_system() t.expect_addition( List('hello_debug.exe hello_release.exe links/hello_release.exe')) t.cleanup()
t.set_tree("project-test3") t.run_build_system("lib//b.obj") t.expect_addition("lib/bin/$toolset/debug/b.obj") t.expect_nothing_more() t.run_build_system("clean lib//b.obj") t.expect_removal("lib/bin/$toolset/debug/b.obj") t.expect_nothing_more() t.run_build_system("lib//b.obj") t.expect_addition("lib/bin/$toolset/debug/b.obj") t.expect_nothing_more() t.run_build_system("release lib2/helper//e.obj /lib3//f.obj") t.expect_addition("lib2/helper/bin/$toolset/release/e.obj") t.expect_addition("lib3/bin/$toolset/release/f.obj") t.expect_nothing_more() # Test project ids in command line work as well t.set_tree("project-test3") t.run_build_system("/lib2") t.expect_addition("lib2/bin/$toolset/debug/" * List("c.obj d.obj l.exe")) t.expect_addition("bin/$toolset/debug/a.obj") t.expect_nothing_more() t.run_build_system("lib") t.expect_addition("lib/bin/$toolset/debug/" * List("b.obj m.exe")) t.expect_nothing_more() t.cleanup()
#!/usr/bin/python # Copyright 2002, 2003 Dave Abrahams # 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, List from time import sleep t = Tester() t.set_tree("test2") t.run_build_system("-sBOOST_BUILD_PATH=" + t.original_workdir + "/..") file_list = 'bin/foo/$toolset/debug/runtime-link-dynamic/' * List("foo foo.o") t.expect_addition(file_list) t.write("foo.cpp", "int main(int, char**) { return 0; }\n") t.run_build_system("-d2 -sBOOST_BUILD_PATH=" + t.original_workdir + "/..") t.expect_touch(file_list) t.pass_test()
# Test the 'symlink' rule from BoostBuild import Tester, List import os t = Tester() if os.name != 'posix': print "The symlink tests can be run on posix only" sys.exit(1) t.write("project-root.jam", "import gcc ;") t.write("Jamfile", """ exe hello : hello.cpp ; symlink hello_release : hello/<variant>release ; symlink hello_debug : hello/<variant>debug ; symlink links/hello_release : hello/<variant>release ; """) t.write("hello.cpp", """ int main() { return 0; } """) t.run_build_system() t.expect_addition(List('hello_debug.exe hello_release.exe links/hello_release.exe')) t.cleanup()
#!/usr/bin/python from BoostBuild import Tester, List import os from string import strip t = Tester() # First check some startup t.set_tree("direct-request-test") t.run_build_system(extra_args="define=MACROS") t.expect_addition("bin/$toolset/debug/" * (List("a.obj b.obj b.dll a.exe"))) # When building debug version, the 'define' still applies t.rm("bin") t.run_build_system(extra_args="debug define=MACROS") t.expect_addition("bin/$toolset/debug/" * (List("a.obj b.obj b.dll a.exe"))) # When building release version, the 'define' should not # apply: we'll have direct build request 'release <define>MACROS' # and real build properties 'debug'. t.copy("Jamfile2", "Jamfile") t.copy("b_inverse.cpp", "b.cpp") t.rm("bin") t.run_build_system(extra_args="release define=MACROS") # Regression test: direct build request was not working # when there's more than one level of 'build-project' t.rm(".")
# Create a temporary working directory t = Tester() # Create the needed files t.write("project-root.jam", "") t.write("Jamfile", """ exe hello : hello.cpp ; """) t.write("hello.cpp", """ int main() { return 0; } """) t.run_build_system() # First, create a list of three pathnames file_list = List("bin/$toolset/debug/") * List("hello.exe hello.obj") # Second, assert that those files were added as result of the last build system invocation. t.expect_addition(file_list) # Invoke the build system once again t.run_build_system("clean") # Check if the files added previously were removed. t.expect_removal(file_list) # Remove temporary directories t.cleanup()
#!/usr/bin/python from BoostBuild import Tester, List import os t = Tester() t.set_tree("generators-test") t.run_build_system() t.expect_addition( "bin/$toolset/debug/" * ( List( "a.obj b.obj c.h c.cpp c.obj d_parser.whl d_lexer.dlp d_parser.cpp d_lexer.cpp " + "d_parser.lr0 x.c x.obj y.x1 y.x2 " + "y.cpp y.obj e.marked.cpp e.positions e.target.cpp e.obj " + "a.exe e.exe")) ) t.expect_addition(["lib/bin/$toolset/debug/c.obj", "lib/bin/$toolset/debug/auxilliary.lib", ]) t.run_build_system(subdir='lib') t.expect_addition(["lib/bin/$toolset/debug/auxilliary2.dll"]) t.run_build_system(subdir='lib', extra_args="link=static")
from BoostBuild import Tester, List t = Tester() t.write("project-root.jam", "") t.write("Jamfile", """ exe hello : hello.cpp ; exe hello2 : hello.cpp ; explicit hello2 ; """) t.write("hello.cpp", """ int main() { return 0; } """) t.run_build_system() t.ignore("*.tds") t.expect_addition(List("bin/$toolset/debug/hello") * [".exe", ".obj"]) t.expect_nothing_more() t.run_build_system("hello2") t.expect_addition("bin/$toolset/debug/hello2.exe") t.cleanup()
# 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, List import os t = Tester() t.set_tree("generators-test") t.run_build_system() t.expect_addition( "bin/$toolset/debug/" * ( List( "a.obj b.obj c.h c.cpp c.obj d_parser.whl d_lexer.dlp d_parser.cpp d_lexer.cpp " + "d_parser.lr0 d_parser.h d_parser_symbols.h x.c x.obj y.x1 y.x2 " + "y.cpp y.obj e.marked_cpp e.positions e.target_cpp e.obj ")) ) ok = 0 t.expect_addition("bin/$toolset/debug/a.exe") t.expect_addition(["lib/bin/$toolset/debug/c.obj", "lib/bin/$toolset/debug/auxilliary.lib", ]) t.run_build_system(subdir='lib') t.expect_addition(["lib/bin/$toolset/debug/auxilliary2.dll"])
from BoostBuild import Tester, List t = Tester() t.write("project-root.jam", "import gcc ;") t.write("Jamfile", "exe a : a.cpp : : debug release ;") t.write("a.cpp", "int main() { return 0; }\n") t.run_build_system() t.expect_addition("bin/$toolset/debug/a.exe") t.expect_addition("bin/$toolset/release/a.exe") # Check that explictly-specified build variant supresses # default-build t.rm("bin") t.run_build_system("release") t.expect_addition(List("bin/$toolset/release/") * "a.exe a.obj") t.expect_nothing_more() # Now check that we can specify explicit build request and # default-build will be combined with it t.run_build_system("optimization=space") t.expect_addition("bin/$toolset/debug/optimization-space/a.exe") t.expect_addition("bin/$toolset/release/optimization-space/a.exe") # Test that default-build must be identical in all alternatives. Error case. t.write("Jamfile", """ exe a : a.cpp : : debug ; exe a : b.cpp : : ; """) expected = """error: default build must be identical in all alternatives main target is ./a
from BoostBuild import Tester, List t = Tester() t.write("project-root.jam", "import gcc ;") t.write("Jamfile", "build-project src ;") t.write("lib/Jamfile", "lib lib1 : lib1.cpp ;") t.write("lib/lib1.cpp", "void foo() {}\n") t.write("src/Jamfile", """ project : requirements <library>../lib/lib1 ; exe a : a.cpp ; exe b : b.cpp ; """) t.write("src/a.cpp", """ void foo(); int main() { foo(); return 0; } """) t.copy("src/a.cpp", "src/b.cpp") t.run_build_system() # Test that there's no "main-target-a" part. t.expect_addition("src/bin/$toolset/debug/" * List("a.exe b.exe")) t.cleanup()
""") t.write( "a.cpp", """ int main() { return 0; } #ifdef _MSC_VER __declspec (dllexport) void x () {} #endif """) file_list = \ List("bin/$toolset/debug/a_ds.exe") + \ List("bin/$toolset/debug/b_ds.dll") + \ List("c/a_ds.exe") + \ List("bin/$toolset/release/a_rs.exe") + \ List("bin/$toolset/release/b_rs.dll") + \ List("c/a_rs.exe") + \ List("bin/$toolset/debug/link-static/a_dt.exe") + \ List("bin/$toolset/debug/link-static/b_dt.lib") + \ List("c/a_dt.exe") + \ List("bin/$toolset/release/link-static/a_rt.exe") + \ List("bin/$toolset/release/link-static/b_rt.lib") + \ List("c/a_rt.exe") variants = "debug release link=static,shared" t.run_build_system(variants)