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

Add tests for typechecking facilities.

* test/core_typecheck.py: New test
* test/core_d12.py: Don't pass toolset name to bjam.
* test/test_all.py: Run core tests.


[SVN r18390]
This commit is contained in:
Vladimir Prus
2003-05-14 06:44:43 +00:00
parent fc4ec011d0
commit d76f774539
6 changed files with 94 additions and 2 deletions

View File

@@ -4,7 +4,7 @@
import BoostBuild
t = BoostBuild.Tester()
t = BoostBuild.Tester(pass_toolset=0)
t.write("file.jam", """
actions a {

43
test/core_typecheck.py Normal file
View File

@@ -0,0 +1,43 @@
#!/usr/bin/python
# This tests the typechecking facilities.
import BoostBuild
t = BoostBuild.Tester(pass_toolset=0)
t.write("file.jam", """
module .typecheck
{
rule [path] ( x )
{
if ! [ MATCH "^(::)" : $(x) ]
{
ECHO "Error: $(x) is not a path" ;
return true ;
}
}
}
rule do ( [path] a )
{
}
do $(ARGUMENT) ;
actions dummy { }
dummy all ;
""")
t.run_build_system("-ffile.jam -sARGUMENT=::a/b/c")
t.run_build_system("-ffile.jam -sARGUMENT=a/b/c", status=1,
stdout="""Error: a/b/c is not a path
file.jam:18: in module scope
*** argument error
* rule do ( [path] a )
* called with: ( a/b/c )
* true a
file.jam:16:see definition of rule 'do' being called
""")
t.cleanup()

View File

@@ -61,6 +61,9 @@ def reorder_tests(tests, first_test):
critical_tests = ["unit_tests", "module_actions", "startup_v1", "startup_v2"]
critical_tests += ["core_d12", "core_typecheck"]
tests = [ "project_test1",
"project_test3",
"project_test4",

View File

@@ -4,7 +4,7 @@
import BoostBuild
t = BoostBuild.Tester()
t = BoostBuild.Tester(pass_toolset=0)
t.write("file.jam", """
actions a {

43
v2/test/core_typecheck.py Normal file
View File

@@ -0,0 +1,43 @@
#!/usr/bin/python
# This tests the typechecking facilities.
import BoostBuild
t = BoostBuild.Tester(pass_toolset=0)
t.write("file.jam", """
module .typecheck
{
rule [path] ( x )
{
if ! [ MATCH "^(::)" : $(x) ]
{
ECHO "Error: $(x) is not a path" ;
return true ;
}
}
}
rule do ( [path] a )
{
}
do $(ARGUMENT) ;
actions dummy { }
dummy all ;
""")
t.run_build_system("-ffile.jam -sARGUMENT=::a/b/c")
t.run_build_system("-ffile.jam -sARGUMENT=a/b/c", status=1,
stdout="""Error: a/b/c is not a path
file.jam:18: in module scope
*** argument error
* rule do ( [path] a )
* called with: ( a/b/c )
* true a
file.jam:16:see definition of rule 'do' being called
""")
t.cleanup()

View File

@@ -61,6 +61,9 @@ def reorder_tests(tests, first_test):
critical_tests = ["unit_tests", "module_actions", "startup_v1", "startup_v2"]
critical_tests += ["core_d12", "core_typecheck"]
tests = [ "project_test1",
"project_test3",
"project_test4",