Skip to content

Commit

Permalink
More verbose tests on cdash (#1300)
Browse files Browse the repository at this point in the history
* Always attach test log files.

* Try cat on log file for tests.
  • Loading branch information
jrood-nrel authored Sep 23, 2024
1 parent b4404e6 commit e0738ba
Showing 1 changed file with 27 additions and 35 deletions.
62 changes: 27 additions & 35 deletions reg_tests/CTestList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ macro(setup_test testname np)
set(OUTPUT_FILE_R0 "${testname}_R0.log")
set(OUTPUT_FILE_R1 "${testname}_R0.log")
set(OUTPUT_FILE_NP "${testname}Np${np}.log")
set(RUN_COMMAND "${MPI_COMMAND} -i ${INPUT_FILE} -o ${OUTPUT_FILE}")
set(RUN_COMMAND "${MPI_COMMAND} -i ${INPUT_FILE} -o ${OUTPUT_FILE} 2>&1; cat ${OUTPUT_FILE}")
set(RUN_COMMAND_RST "${MPI_COMMAND} -i ${INPUT_FILE_RST} -o ${OUTPUT_FILE_RST}")
set(RUN_COMMAND_R0 "${MPI_COMMAND} -i ${INPUT_FILE_R0} -o ${OUTPUT_FILE_R0}")
set(RUN_COMMAND_R1 " && ${MPI_COMMAND} -i ${INPUT_FILE_R1} -o ${OUTPUT_FILE_R1}")
Expand Down Expand Up @@ -52,55 +52,47 @@ function(add_test_r testname np)
setup_test(${testname} ${np})
add_test(${testname} sh -c "${RUN_COMMAND}${COMPARE_GOLDS_COMMAND}")
set_properties(${testname})
set_tests_properties(${testname} PROPERTIES LABELS "regression")
set_tests_properties(${testname} PROPERTIES LABELS "regression" ATTACHED_FILES "${OUTPUT_FILE}")
endfunction(add_test_r)

# Standard performance test
function(add_test_p testname np)
setup_test(${testname} ${np})
add_test(${testname} sh -c "${RUN_COMMAND}${COMPARE_GOLDS_COMMAND}")
set_properties(${testname})
set_tests_properties(${testname} PROPERTIES LABELS "performance")
endfunction(add_test_p)

# Regression test with single restart
function(add_test_r_rst testname np)
setup_test(${testname} ${np})
add_test(${testname} sh -c "${RUN_COMMAND}${COMPARE_GOLDS_COMMAND}; ${RUN_COMMAND_RST}${COMPARE_GOLDS_COMMAND_RST}")
set_properties(${testname})
set_tests_properties(${testname} PROPERTIES LABELS "regression")
set_tests_properties(${testname} PROPERTIES LABELS "regression" ATTACHED_FILES "${OUTPUT_FILE_RST}")
endfunction(add_test_r_rst)

# Regression test with postprocessing
function(add_test_r_post testname np)
setup_test(${testname} ${np})
add_test(${testname} sh -c "${RUN_COMMAND}${COMPARE_GOLDS_COMMAND_NC}")
set_properties(${testname})
set_tests_properties(${testname} PROPERTIES LABELS "regression")
set_tests_properties(${testname} PROPERTIES LABELS "regression" ATTACHED_FILES "${OUTPUT_FILE}")
endfunction(add_test_r_post)

# Verification test comparing solution norms
function(add_test_v_sol_norm testname np)
setup_test(${testname} ${np})
add_test(${testname} sh -c "${RUN_COMMAND}${CHECK_SOL_NORMS_COMMAND}")
set_properties(${testname})
set_tests_properties(${testname} PROPERTIES LABELS "verification")
set_tests_properties(${testname} PROPERTIES LABELS "verification" ATTACHED_FILES "${OUTPUT_FILE}")
endfunction(add_test_v_sol_norm)

# Verification test with two resolutions
function(add_test_v2 testname np)
setup_test(${testname} ${np})
add_test(${testname} sh -c "${RUN_COMMAND_R0}${RUN_COMMAND_R1}${COMPARE_GOLDS_COMMAND_ERRORS}")
set_properties(${testname})
set_tests_properties(${testname} PROPERTIES LABELS "verification")
set_tests_properties(${testname} PROPERTIES LABELS "verification" ATTACHED_FILES "${OUTPUT_FILE_R0};${OUTPUT_FILE_R1}")
endfunction(add_test_v2)

# Regression test that runs with different numbers of processes
function(add_test_r_np testname np)
setup_test(${testname} ${np})
add_test(${testname}Np${np} sh -c "${RUN_COMMAND_NP}${COMPARE_GOLDS_COMMAND_NP}")
set_properties(${testname}Np${np})
set_tests_properties(${testname}Np${np} PROPERTIES LABELS "regression")
set_tests_properties(${testname}Np${np} PROPERTIES LABELS "regression" ATTACHED_FILES "${OUTPUT_FILE_NP}")
endfunction(add_test_r_np)

# Standard unit test
Expand All @@ -111,7 +103,7 @@ function(add_test_u testname np)
else()
unset(GTEST_SHUFFLE)
endif()
add_test(${testname} sh -c "${MPI_PREAMBLE} ${CMAKE_BINARY_DIR}/${utest_ex_name} ${MPIEXEC_POSTFLAGS} ${GTEST_SHUFFLE}")
add_test(${testname} sh -c "${MPI_PREAMBLE} ${CMAKE_BINARY_DIR}/${utest_ex_name} ${MPIEXEC_POSTFLAGS} ${GTEST_SHUFFLE} 2>&1")
set_properties(${testname})
set_tests_properties(${testname} PROPERTIES LABELS "unit")
if(ENABLE_OPENFAST)
Expand All @@ -126,7 +118,7 @@ endfunction(add_test_u)
# GPU unit test
function(add_test_u_gpu testname np)
setup_test(${testname} ${np})
add_test(${testname} sh -c "${MPI_PREAMBLE} ${CMAKE_BINARY_DIR}/${utest_ex_name} ${MPIEXEC_POSTFLAGS}")
add_test(${testname} sh -c "${MPI_PREAMBLE} ${CMAKE_BINARY_DIR}/${utest_ex_name} ${MPIEXEC_POSTFLAGS} 2>&1")
set_properties(${testname})
set_tests_properties(${testname} PROPERTIES LABELS "unit")
if(ENABLE_OPENFAST)
Expand All @@ -139,23 +131,23 @@ function(add_test_u_gpu testname np)
endfunction(add_test_u_gpu)

# Regression test with catalyst capability
function(add_test_r_cat testname np ncat)
if(ENABLE_PARAVIEW_CATALYST)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/test_files/${testname}/${testname}.template.yaml)
setup_test(${testname} ${np})
add_test(${testname} sh -c "${MPI_PREAMBLE} ${CMAKE_BINARY_DIR}/${nalu_ex_catalyst_name} ${MPIEXEC_POSTFLAGS} -i ${CMAKE_CURRENT_BINARY_DIR}/test_files/${testname}/${testname}_catalyst.yaml -o ${testname}.log && ${CMAKE_CURRENT_SOURCE_DIR}/pass_fail_catalyst.sh ${testname} ${ncat}")
set_properties(${testname})
set_tests_properties(${testname} PROPERTIES LABELS "regression")
set(CATALYST_FILE_INPUT_DECK_COMMAND "catalyst_file_name: catalyst.txt")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_files/${testname}/${testname}.template.yaml
${CMAKE_CURRENT_BINARY_DIR}/test_files/${testname}/${testname}_catalyst.yaml @ONLY)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test_files/${testname}/catalyst.txt
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/test_files/${testname})
endif()
else()
add_test_r(${testname} ${np})
endif()
endfunction(add_test_r_cat)
#function(add_test_r_cat testname np ncat)
# if(ENABLE_PARAVIEW_CATALYST)
# if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/test_files/${testname}/${testname}.template.yaml)
# setup_test(${testname} ${np})
# add_test(${testname} sh -c "${MPI_PREAMBLE} ${CMAKE_BINARY_DIR}/${nalu_ex_catalyst_name} ${MPIEXEC_POSTFLAGS} -i ${CMAKE_CURRENT_BINARY_DIR}/test_files/${testname}/${testname}_catalyst.yaml -o ${testname}.log && ${CMAKE_CURRENT_SOURCE_DIR}/pass_fail_catalyst.sh ${testname} ${ncat}")
# set_properties(${testname})
# set_tests_properties(${testname} PROPERTIES LABELS "regression")
# set(CATALYST_FILE_INPUT_DECK_COMMAND "catalyst_file_name: catalyst.txt")
# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_files/${testname}/${testname}.template.yaml
# ${CMAKE_CURRENT_BINARY_DIR}/test_files/${testname}/${testname}_catalyst.yaml @ONLY)
# file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test_files/${testname}/catalyst.txt
# DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/test_files/${testname})
# endif()
# else()
# add_test_r(${testname} ${np})
# endif()
#endfunction(add_test_r_cat)

if(NOT ENABLE_CUDA AND NOT ENABLE_ROCM)

Expand All @@ -171,7 +163,7 @@ if(NOT ENABLE_CUDA AND NOT ENABLE_ROCM)
add_test_r(ablUnstableEdge_ra 4)
add_test_r(ablStableEdge 4)
add_test_r_post(ablNeutralStat 8)
add_test_r_cat(ablNeutralEdge 8 2)
#add_test_r_cat(ablNeutralEdge 8 2)
add_test_r(ablNeutralEdgeSegregated 8)
add_test_r(ablNeutralEdgeNoSlip 4)
add_test_r(ablHill3dSymPenalty 4)
Expand Down

0 comments on commit e0738ba

Please sign in to comment.