diff --git a/test/core_d12.py b/test/core_d12.py index c25fbb856..72ec9de53 100644 --- a/test/core_d12.py +++ b/test/core_d12.py @@ -4,7 +4,7 @@ import BoostBuild -t = BoostBuild.Tester() +t = BoostBuild.Tester(pass_toolset=0) t.write("file.jam", """ actions a { diff --git a/test/core_typecheck.py b/test/core_typecheck.py new file mode 100644 index 000000000..08ca631cd --- /dev/null +++ b/test/core_typecheck.py @@ -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() diff --git a/test/test_all.py b/test/test_all.py index 4c8b17f09..62455a3f2 100644 --- a/test/test_all.py +++ b/test/test_all.py @@ -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", diff --git a/v2/test/core_d12.py b/v2/test/core_d12.py index c25fbb856..72ec9de53 100644 --- a/v2/test/core_d12.py +++ b/v2/test/core_d12.py @@ -4,7 +4,7 @@ import BoostBuild -t = BoostBuild.Tester() +t = BoostBuild.Tester(pass_toolset=0) t.write("file.jam", """ actions a { diff --git a/v2/test/core_typecheck.py b/v2/test/core_typecheck.py new file mode 100644 index 000000000..08ca631cd --- /dev/null +++ b/v2/test/core_typecheck.py @@ -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() diff --git a/v2/test/test_all.py b/v2/test/test_all.py index 4c8b17f09..62455a3f2 100644 --- a/v2/test/test_all.py +++ b/v2/test/test_all.py @@ -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",