Browse Source

BootstrapTest: Use --parallel=... argument.

Determine the number of processors and provide it to the bootstrap
script.  Also make sure this test does not run parallel with other
tests.
Daniel Pfeifer 9 years ago
parent
commit
e3770c56a8
2 changed files with 9 additions and 4 deletions
  1. 7 2
      Tests/BootstrapTest.cmake
  2. 2 2
      Tests/CMakeLists.txt

+ 7 - 2
Tests/BootstrapTest.cmake

@@ -1,7 +1,12 @@
 file(MAKE_DIRECTORY "${bin_dir}")
-message(STATUS "running bootstrap: ${bootstrap}")
+include(ProcessorCount)
+ProcessorCount(nproc)
+if(NOT nproc EQUAL 0)
+  set(parallel_arg --parallel=${nproc})
+endif()
+message(STATUS "running bootstrap: ${bootstrap} ${parallel_arg}")
 execute_process(
-  COMMAND ${bootstrap}
+  COMMAND ${bootstrap} ${parallel_arg}
   WORKING_DIRECTORY "${bin_dir}"
   RESULT_VARIABLE result
   )

+ 2 - 2
Tests/CMakeLists.txt

@@ -3081,8 +3081,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
         -P ${CMAKE_CURRENT_SOURCE_DIR}/BootstrapTest.cmake
       )
     list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BootstrapTest")
-    # Make this test run early during parallel execution
-    set_tests_properties(BootstrapTest PROPERTIES COST 5000)
+    # This test will use all processors.
+    set_tests_properties(BootstrapTest PROPERTIES RUN_SERIAL 1)
 
     # provide more time for the bootstrap test
     get_test_property(BootstrapTest TIMEOUT PREVIOUS_TIMEOUT)