From 2e0e73f25fbc787f89abcc1029ab9b56b1628bcd Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 10 Oct 2002 12:12:06 +0000 Subject: [PATCH] Add more tests. [SVN r15851] --- test/conditionals.py | 28 ++++++++++++++++++++++++++++ test/default_build.py | 16 ++++++++++++++++ test/test_all.py | 2 +- v2/test/conditionals.py | 28 ++++++++++++++++++++++++++++ v2/test/default_build.py | 16 ++++++++++++++++ v2/test/test_all.py | 2 +- 6 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 test/conditionals.py create mode 100644 test/default_build.py create mode 100644 v2/test/conditionals.py create mode 100644 v2/test/default_build.py 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