diff --git a/test/CTestList.cmake b/test/CTestList.cmake index 6b05dab687..ae5164fa0a 100644 --- a/test/CTestList.cmake +++ b/test/CTestList.cmake @@ -34,13 +34,6 @@ function(add_test_r TEST_NAME) file(COPY ${TEST_FILES} DESTINATION "${CURRENT_TEST_BINARY_DIR}/") # Set some default runtime options for all tests in this category set(RUNTIME_OPTIONS "time.max_step=10 amr.plot_file=plt time.plot_interval=10 amrex.throw_exception=1 amrex.signal_handling=0") - if(AMR_WIND_ENABLE_CUDA) - set(FCOMPARE_TOLERANCE "-r 1e-10 --abs_tol 1.0e-12") - endif() - # Use fcompare to test diffs in plots against gold files - if(AMR_WIND_TEST_WITH_FCOMPARE) - set(FCOMPARE_COMMAND "&& ${FCOMPARE_EXE} ${FCOMPARE_TOLERANCE} ${PLOT_GOLD} ${PLOT_TEST}") - endif() if(AMR_WIND_ENABLE_MPI) set(NP 4) set(MPI_COMMANDS "${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${NP} ${MPIEXEC_PREFLAGS}") @@ -48,6 +41,13 @@ function(add_test_r TEST_NAME) set(NP 1) unset(MPI_COMMANDS) endif() + # Use fcompare to test diffs in plots against gold files + if(AMR_WIND_ENABLE_CUDA) + set(FCOMPARE_TOLERANCE "-r 1e-10 --abs_tol 1.0e-12") + endif() + if(AMR_WIND_TEST_WITH_FCOMPARE) + set(FCOMPARE_COMMAND "&& ${MPI_COMMANDS} ${FCOMPARE_EXE} ${FCOMPARE_TOLERANCE} ${PLOT_GOLD} ${PLOT_TEST}") + endif() # Add test and actual test commands to CTest database add_test(${TEST_NAME} sh -c "${MPI_COMMANDS} ${CMAKE_BINARY_DIR}/${amr_wind_exe_name} ${MPIEXEC_POSTFLAGS} ${CURRENT_TEST_BINARY_DIR}/${TEST_NAME}.i ${RUNTIME_OPTIONS} > ${TEST_NAME}.log ${FCOMPARE_COMMAND}") # Set properties for test