2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 01:12:13 +00:00

Add more tests.

[SVN r15851]
This commit is contained in:
Vladimir Prus
2002-10-10 12:12:06 +00:00
parent e44de6f1b0
commit 2e0e73f25f
6 changed files with 90 additions and 2 deletions

28
test/conditionals.py Normal file
View File

@@ -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 : <shared>true:<define>SHARED ;")
t.run_build_system("shared=true")
t.expect_addition("bin/gcc/debug/shared-true/main-target-a/a")
t.write("Jamfile", """
project : requirements <shared>true:<define>SHARED ;
exe a : a.cpp ;
""")
t.run_build_system("shared=true")
t.expect_addition("bin/gcc/debug/shared-true/a")
t.cleanup()

16
test/default_build.py Normal file
View File

@@ -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()

View File

@@ -29,4 +29,4 @@ import chain
import default_build
import main_properties
import use_requirements
import conditionals

28
v2/test/conditionals.py Normal file
View File

@@ -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 : <shared>true:<define>SHARED ;")
t.run_build_system("shared=true")
t.expect_addition("bin/gcc/debug/shared-true/main-target-a/a")
t.write("Jamfile", """
project : requirements <shared>true:<define>SHARED ;
exe a : a.cpp ;
""")
t.run_build_system("shared=true")
t.expect_addition("bin/gcc/debug/shared-true/a")
t.cleanup()

16
v2/test/default_build.py Normal file
View File

@@ -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()

View File

@@ -29,4 +29,4 @@ import chain
import default_build
import main_properties
import use_requirements
import conditionals