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:
@@ -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
43
test/core_typecheck.py
Normal 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()
|
||||
@@ -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",
|
||||
|
||||
@@ -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
43
v2/test/core_typecheck.py
Normal 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()
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user