diff --git a/test/conditionals.py b/test/conditionals.py new file mode 100644 index 000000000..78a84d84b --- /dev/null +++ b/test/conditionals.py @@ -0,0 +1,28 @@ +#!/usr/bin/python + +# Test conditional properties + +from BoostBuild import Tester, List +import os +from string import strip + +t = Tester() + +t.write("project-root.jam", "import gcc ;") +t.write("a.cpp", """ +#ifdef SHARED +int main() {} +#endif +""") +t.write("Jamfile", "exe a : a.cpp : true:SHARED ;") +t.run_build_system("shared=true") +t.expect_addition("bin/gcc/debug/shared-true/main-target-a/a") + +t.write("Jamfile", """ +project : requirements true:SHARED ; +exe a : a.cpp ; +""") +t.run_build_system("shared=true") +t.expect_addition("bin/gcc/debug/shared-true/a") + +t.cleanup() diff --git a/test/default_build.py b/test/default_build.py new file mode 100644 index 000000000..f68c169ce --- /dev/null +++ b/test/default_build.py @@ -0,0 +1,16 @@ +#!/usr/bin/python + +# Test that default build clause actually has any effect. + +from BoostBuild import Tester +t = Tester() + +t.write("project-root.jam", "import gcc ;") +t.write("Jamfile", "exe a : a.cpp : : debug release ;") +t.write("a.cpp", "int main() {}") + +t.run_build_system() +t.expect_addition("bin/gcc/debug/a") +t.expect_addition("bin/gcc/release/a") + +t.cleanup() diff --git a/test/test_all.py b/test/test_all.py index 7d661e1b4..67d5b1404 100644 --- a/test/test_all.py +++ b/test/test_all.py @@ -29,4 +29,4 @@ import chain import default_build import main_properties import use_requirements - +import conditionals diff --git a/v2/test/conditionals.py b/v2/test/conditionals.py new file mode 100644 index 000000000..78a84d84b --- /dev/null +++ b/v2/test/conditionals.py @@ -0,0 +1,28 @@ +#!/usr/bin/python + +# Test conditional properties + +from BoostBuild import Tester, List +import os +from string import strip + +t = Tester() + +t.write("project-root.jam", "import gcc ;") +t.write("a.cpp", """ +#ifdef SHARED +int main() {} +#endif +""") +t.write("Jamfile", "exe a : a.cpp : true:SHARED ;") +t.run_build_system("shared=true") +t.expect_addition("bin/gcc/debug/shared-true/main-target-a/a") + +t.write("Jamfile", """ +project : requirements true:SHARED ; +exe a : a.cpp ; +""") +t.run_build_system("shared=true") +t.expect_addition("bin/gcc/debug/shared-true/a") + +t.cleanup() diff --git a/v2/test/default_build.py b/v2/test/default_build.py new file mode 100644 index 000000000..f68c169ce --- /dev/null +++ b/v2/test/default_build.py @@ -0,0 +1,16 @@ +#!/usr/bin/python + +# Test that default build clause actually has any effect. + +from BoostBuild import Tester +t = Tester() + +t.write("project-root.jam", "import gcc ;") +t.write("Jamfile", "exe a : a.cpp : : debug release ;") +t.write("a.cpp", "int main() {}") + +t.run_build_system() +t.expect_addition("bin/gcc/debug/a") +t.expect_addition("bin/gcc/release/a") + +t.cleanup() diff --git a/v2/test/test_all.py b/v2/test/test_all.py index 7d661e1b4..67d5b1404 100644 --- a/v2/test/test_all.py +++ b/v2/test/test_all.py @@ -29,4 +29,4 @@ import chain import default_build import main_properties import use_requirements - +import conditionals