testHarness: adjusting the ctest command invocation for scripts
under Windows/Mingw
This commit is contained in:
parent
7d10a1bbff
commit
0a48ccb4d2
3 changed files with 40 additions and 9 deletions
|
@ -379,10 +379,18 @@ IF(BUILD_TESTING)
|
||||||
IF(RUN_FROM_ONE_TIMESTEP)
|
IF(RUN_FROM_ONE_TIMESTEP)
|
||||||
# Modify the cases controlDict file in order to run for only one time step
|
# Modify the cases controlDict file in order to run for only one time step
|
||||||
MESSAGE("${testRunTimeDirectory}: Modifying the controlDict files for running only one time step in directory: ${TEST_CASE_DIR}")
|
MESSAGE("${testRunTimeDirectory}: Modifying the controlDict files for running only one time step in directory: ${TEST_CASE_DIR}")
|
||||||
EXECUTE_PROCESS(
|
if(CMAKE_HOST_WIN32)
|
||||||
|
# Need to supply a bash shell to run the script under Windows
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND bash -c "$ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForOneTimeStep.sh ${TEST_CASE_DIR}"
|
||||||
|
WORKING_DIRECTORY .
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
EXECUTE_PROCESS(
|
||||||
COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForOneTimeStep.sh ${TEST_CASE_DIR}
|
COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForOneTimeStep.sh ${TEST_CASE_DIR}
|
||||||
WORKING_DIRECTORY .
|
WORKING_DIRECTORY .
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
ENDIF(RUN_FROM_ONE_TIMESTEP)
|
ENDIF(RUN_FROM_ONE_TIMESTEP)
|
||||||
|
|
||||||
ENDIF(BUILD_TESTING)
|
ENDIF(BUILD_TESTING)
|
||||||
|
|
|
@ -379,10 +379,18 @@ IF(BUILD_TESTING)
|
||||||
IF(RUN_FROM_ONE_TIMESTEP)
|
IF(RUN_FROM_ONE_TIMESTEP)
|
||||||
# Modify the cases controlDict file in order to run for only one time step
|
# Modify the cases controlDict file in order to run for only one time step
|
||||||
MESSAGE("${testRunTimeDirectory}: Modifying the controlDict files for running only one time step in directory: ${TEST_CASE_DIR}")
|
MESSAGE("${testRunTimeDirectory}: Modifying the controlDict files for running only one time step in directory: ${TEST_CASE_DIR}")
|
||||||
EXECUTE_PROCESS(
|
if(CMAKE_HOST_WIN32)
|
||||||
|
# Need to supply a bash shell to run the script under Windows
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND bash -c "$ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForOneTimeStep.sh ${TEST_CASE_DIR}"
|
||||||
|
WORKING_DIRECTORY .
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
EXECUTE_PROCESS(
|
||||||
COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForOneTimeStep.sh ${TEST_CASE_DIR}
|
COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForOneTimeStep.sh ${TEST_CASE_DIR}
|
||||||
WORKING_DIRECTORY .
|
WORKING_DIRECTORY .
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
ENDIF(RUN_FROM_ONE_TIMESTEP)
|
ENDIF(RUN_FROM_ONE_TIMESTEP)
|
||||||
|
|
||||||
ENDIF(BUILD_TESTING)
|
ENDIF(BUILD_TESTING)
|
||||||
|
|
|
@ -53,11 +53,18 @@ file(COPY $ENV{FOAM_TUTORIALS}/ DESTINATION ${TEST_CASE_DIR})
|
||||||
# The test harness relies on the presence of an Allrun file for
|
# The test harness relies on the presence of an Allrun file for
|
||||||
# running the case
|
# running the case
|
||||||
MESSAGE("${testRunTimeDirectory}: Checking for missing Allrun file in tutorials")
|
MESSAGE("${testRunTimeDirectory}: Checking for missing Allrun file in tutorials")
|
||||||
EXECUTE_PROCESS(
|
if(CMAKE_HOST_WIN32)
|
||||||
|
# Need to supply a bash shell to run the script under Windows
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND bash -c "$ENV{FOAM_TEST_HARNESS_DIR}/scripts/addMissingAllrunFileToTutorial.sh ${TEST_CASE_DIR} $ENV{FOAM_TEST_HARNESS_DIR}/scripts/Allrun.default"
|
||||||
|
WORKING_DIRECTORY .
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
EXECUTE_PROCESS(
|
||||||
COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/addMissingAllrunFileToTutorial.sh ${TEST_CASE_DIR} $ENV{FOAM_TEST_HARNESS_DIR}/scripts/Allrun.default
|
COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/addMissingAllrunFileToTutorial.sh ${TEST_CASE_DIR} $ENV{FOAM_TEST_HARNESS_DIR}/scripts/Allrun.default
|
||||||
WORKING_DIRECTORY .
|
WORKING_DIRECTORY .
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
# Iterate over each tutorial case:
|
# Iterate over each tutorial case:
|
||||||
# We are looking for tutorial cases with an Allrun file.
|
# We are looking for tutorial cases with an Allrun file.
|
||||||
# If this file is present, (and it should), we add this case to the list of cases to run.
|
# If this file is present, (and it should), we add this case to the list of cases to run.
|
||||||
|
@ -125,10 +132,18 @@ ENDFOREACH(caseWithAllrun)
|
||||||
|
|
||||||
# Modify the cases Allrun files to incorporate additional shell functions
|
# Modify the cases Allrun files to incorporate additional shell functions
|
||||||
MESSAGE("${testRunTimeDirectory}: Modifying the Allrun files for additional shell functions in directory: ${TEST_CASE_DIR}")
|
MESSAGE("${testRunTimeDirectory}: Modifying the Allrun files for additional shell functions in directory: ${TEST_CASE_DIR}")
|
||||||
EXECUTE_PROCESS(
|
if(CMAKE_HOST_WIN32)
|
||||||
|
# Need to supply a bash shell to run the script under Windows
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND bash -c "$ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForTestHarness.sh ${TEST_CASE_DIR} $ENV{FOAM_TEST_HARNESS_DIR}/scripts/AdditionalRunFunctions"
|
||||||
|
WORKING_DIRECTORY .
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
EXECUTE_PROCESS(
|
||||||
COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForTestHarness.sh ${TEST_CASE_DIR} $ENV{FOAM_TEST_HARNESS_DIR}/scripts/AdditionalRunFunctions
|
COMMAND $ENV{FOAM_TEST_HARNESS_DIR}/scripts/prepareCasesForTestHarness.sh ${TEST_CASE_DIR} $ENV{FOAM_TEST_HARNESS_DIR}/scripts/AdditionalRunFunctions
|
||||||
WORKING_DIRECTORY .
|
WORKING_DIRECTORY .
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Configure the various ctest -S Dashboard drivers
|
# Configure the various ctest -S Dashboard drivers
|
||||||
|
|
||||||
|
|
Reference in a new issue