Просмотр исходного кода

Require that the library check targets use to host OS as the target OS.
This has the effect of only using the host OS python interpreter when
running the tests.

Rene Rivera 9 лет назад
Родитель
Сommit
f910d2b6ac
1 измененных файлов с 6 добавлено и 0 удалено
  1. 6 0
      status/Jamfile.v2

+ 6 - 0
status/Jamfile.v2

@@ -15,6 +15,7 @@ import project ;
 import regex ;
 import modules ;
 import path ;
+import feature ;
 
 local check-libs-only = [ MATCH "^--(check-libs-only)" : [ modules.peek : ARGV ] ] ;
 local check-libs-only-targets = ;
@@ -24,6 +25,9 @@ local rule run-tests ( root : tests * )
 {
     local limit-tests = [ MATCH "^--limit-tests=(.*)" : [ modules.peek : ARGV ] ] ;
     local location = [ project.attribute $(__name__) location ] ;
+    # We only run the check library test when host-os == target-os.
+    # Hence we need that information.
+    local host-os-default = [ feature.defaults <host-os> ] ;
     for local test in $(tests)
     {
         local library = [ path.parent $(test) ] ;
@@ -47,6 +51,7 @@ local rule run-tests ( root : tests * )
                 local test_module = [ project.find ../$(root)/$(test) : $(location) ] ;
                 modules.poke $(test_module) : __LIBRARY__ : $(root)/$(library) ;
                 modules.poke $(test_module) : __JAMFILE__ : [ modules.peek project : JAMFILE ] ;
+                modules.poke $(test_module) : __REQUIRE__ : <target-os>$(host-os-default:G=) ;
                 project.push-current [ project.target $(test_module) ] ;
                 module $(test_module)
                 {
@@ -59,6 +64,7 @@ local rule run-tests ( root : tests * )
                         <testing.arg>--library=$(__LIBRARY__)
                         <testing.arg>--jamfile=\"$(__JAMFILE__:J=;)\"
                         <testing.arg>organization
+                        $(__REQUIRE__)
                         :
                         __boost_check_library__ ;
                 }

粤ICP备19079148号