diff --git a/test/project-test2.py b/test/project-test2.py new file mode 100644 index 000000000..16cf7e171 --- /dev/null +++ b/test/project-test2.py @@ -0,0 +1,55 @@ +#!/usr/bin/python + +from BoostBuild import Tester +import os +from string import strip + +t = Tester("--build-system=project-test2") +t.set_tree("project-test2") + + +t.run_build_system() +print t.stdout() + +# Note that without this line the test would be brittle: it would silently +# pass if those files were accicendally present in the original 'project-test2' +# dir. +t.expect_addition("bin/foo1") +t.expect_addition("bin/foo2") +t.expect_addition("dir/bin/foo1") + +if os.name == 'nt': + props = '" debug off on "' +else: + props = ' debug off on \n' + + +t.fail_test(strip(t.read("bin/foo1")) != strip(props)) +t.fail_test(strip(t.read("bin/foo2")) != strip(props)) + +# Now check that incompatible requirements for subproject are checked. + +t.copy("dir/Jamfile2", "dir/Jamfile") + +expected="""Requirements for project at 'dir' conflict with parent's. +Explanation: link-incompatible properties multi and +single + +""" +t.run_build_system(stdout=expected, status=None) + + +# Check incompatible requirements on main target +t.copy("dir/Jamfile3", "dir/Jamfile") + +expected="""Cannot satisfy request to build dir/foo1 with properties debug +off on +Explanation: link-incompatible properties on and off + +""" + +t.run_build_system(stdout=expected, status=None) + + +t.pass_test() + diff --git a/v2/test/project-test2.py b/v2/test/project-test2.py new file mode 100644 index 000000000..16cf7e171 --- /dev/null +++ b/v2/test/project-test2.py @@ -0,0 +1,55 @@ +#!/usr/bin/python + +from BoostBuild import Tester +import os +from string import strip + +t = Tester("--build-system=project-test2") +t.set_tree("project-test2") + + +t.run_build_system() +print t.stdout() + +# Note that without this line the test would be brittle: it would silently +# pass if those files were accicendally present in the original 'project-test2' +# dir. +t.expect_addition("bin/foo1") +t.expect_addition("bin/foo2") +t.expect_addition("dir/bin/foo1") + +if os.name == 'nt': + props = '" debug off on "' +else: + props = ' debug off on \n' + + +t.fail_test(strip(t.read("bin/foo1")) != strip(props)) +t.fail_test(strip(t.read("bin/foo2")) != strip(props)) + +# Now check that incompatible requirements for subproject are checked. + +t.copy("dir/Jamfile2", "dir/Jamfile") + +expected="""Requirements for project at 'dir' conflict with parent's. +Explanation: link-incompatible properties multi and +single + +""" +t.run_build_system(stdout=expected, status=None) + + +# Check incompatible requirements on main target +t.copy("dir/Jamfile3", "dir/Jamfile") + +expected="""Cannot satisfy request to build dir/foo1 with properties debug +off on +Explanation: link-incompatible properties on and off + +""" + +t.run_build_system(stdout=expected, status=None) + + +t.pass_test() +