# Tests that 'make' accepts target from other directories and that # build request for those targets can be overriden. from BoostBuild import Tester, List t = Tester() t.set_tree("test1") t.run_build_system("-sTOOLSET=yfc") t.expect_addition("bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj") t.expect_addition("auxillary/bin/b.obj/yfc/debug/runtime-link-dynamic/optimization-space/b.obj") t.expect_addition("bin/a/yfc/debug/runtime-link-dynamic/a") t.expect_nothing_more() t.fail(t.read("bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj") !=\ """ <optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug a.cpp """) t.fail(t.read("auxillary/bin/b.obj/yfc/debug/runtime-link-dynamic/b.obj") !=\ """ <optimization>space <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug b.cpp """) t.fail(t.read("bin/a/yfc/debug/runtime-link-dynamic/a") !=\ """ <optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
# Test also that we can refer to those target using project-id. from BoostBuild import Tester, List t = Tester() t.set_tree("test1") t.run_build_system("-sTOOLSET=yfc", subdir="p1") t.expect_addition("p1/bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj") t.expect_addition("p1/auxillary/bin/b.obj/yfc/debug/runtime-link-dynamic/optimization-space/b.obj") t.expect_addition("p2/bin/c.obj/yfc/debug/runtime-link-dynamic/c.obj") t.expect_addition("bin/a/yfc/debug/runtime-link-dynamic/a") t.expect_nothing_more() t.fail(t.read("p1/bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj") !=\ """ <optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug a.cpp """) t.fail(t.read("p1/auxillary/bin/b.obj/yfc/debug/runtime-link-dynamic/b.obj") !=\ """ <optimization>space <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug b.cpp """) t.fail(t.read("p2/bin/c.obj/yfc/debug/runtime-link-dynamic/c.obj") !=\ """ <include>everything <optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug a.cpp
from BoostBuild import Tester, List t = Tester() t.set_tree("test1") # Check that we can build something t.run_build_system("-sTOOLSET=yfc") t.expect_addition("bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj") t.expect_addition("bin/a/yfc/debug/runtime-link-dynamic/a") t.expect_nothing_more() t.fail(t.read("bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj") !=\ """ <optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug a.cpp """) t.fail(t.read("bin/a/yfc/debug/runtime-link-dynamic/a") !=\ """ <optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug <optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug a.cpp """) # Check that we have vanilla target names available t.touch("a.cpp")
{ STRING on $(targets) = $(string) ; creator2 $(targets) : $(sources) ; } actions creator2 { echo $(STRING) > $(<) } make foo.bar : : creator foobar ; """) t.run_build_system() t.expect_addition("bin/$toolset/debug/foo.bar") t.fail_test(find(t.read("bin/$toolset/debug/foo.bar"), "foobar") == -1) # Regression test. Make sure that if main target requested two times, # and build request differ only in incidental properties, the main target # if created only once. The bug was discovered by Kirill Lapshin. t.write("Jamfile", """ # Make sure that incidental property does not # cause second creation of 'hello1.cpp'. exe a : dir//hello1.cpp ; exe b : dir//hello1.cpp/<hardcode-dll-paths>true ; """) t.write("project-root.jam", "") t.write("dir/Jamfile", """
# Test the 'make' rule from BoostBuild import Tester from string import find t = Tester(pass_toolset=0) t.write("project-root.jam", "") t.write("Jamfile", """ rule creator ( string targets * : sources * : * ) { STRING on $(targets) = $(string) ; creator2 $(targets) : $(sources) ; } actions creator2 { echo $(STRING) > $(<) } make foo.bar : : creator foobar ; """) t.run_build_system() t.expect_addition("bin/$toolset/debug/foo.bar") t.fail_test(find(t.read("bin/$toolset/debug/foo.bar"), "foobar") == -1) t.cleanup()
lib a : a.cpp ; """) t.write("b/b.cpp", """ void #if defined(_WIN32) __declspec(dllexport) #endif bar() {} """) t.write("b/Jamfile", """ lib b : b.cpp ../a//a ; """) t.run_build_system("hardcode-dll-paths=true") t.expect_addition("bin/$toolset/debug/mp.pathlist") es1 = t.adjust_names(["a/bin/$toolset/debug"])[0] es2 = t.adjust_names(["b/bin/$toolset/debug"])[0] content = t.read("bin/$toolset/debug/mp.pathlist") t.fail_test(find(content, es1) == -1) t.fail_test(find(content, es2) == -1) t.cleanup()
from BoostBuild import Tester, List t = Tester() t.set_tree("test1") t.run_build_system("-sTOOLSET=yfc", subdir="p1") t.expect_addition("p1/bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj") t.expect_addition( "p1/auxillary/bin/b.obj/yfc/debug/runtime-link-dynamic/optimization-space/b.obj" ) t.expect_addition("p2/bin/c.obj/yfc/debug/runtime-link-dynamic/c.obj") t.expect_addition("bin/a/yfc/debug/runtime-link-dynamic/a") t.expect_nothing_more() t.fail(t.read("p1/bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj") !=\ """ <optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug a.cpp """) t.fail(t.read("p1/auxillary/bin/b.obj/yfc/debug/runtime-link-dynamic/b.obj") !=\ """ <optimization>space <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug b.cpp """) t.fail(t.read("p2/bin/c.obj/yfc/debug/runtime-link-dynamic/c.obj") !=\ """ <include>everything <optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug a.cpp