xref: /phasta/phSolver/incompressible/test/testing.cmake (revision fa773e3ffef2f6750f0d17842585fcd2becb595d)
1*fa773e3fSCameron Smithmacro(ic_parallel_test name procs dir exe)
2*fa773e3fSCameron Smith  set(tname incompressible_${name})
3*fa773e3fSCameron Smith  add_test(
4*fa773e3fSCameron Smith    NAME ${tname}
5*fa773e3fSCameron Smith    COMMAND ${MPIRUN} ${MPIRUN_PROCFLAG} ${procs} ${exe} ${ARGN}
6*fa773e3fSCameron Smith    WORKING_DIRECTORY ${dir} )
7*fa773e3fSCameron Smith  set_tests_properties(${tname} PROPERTIES LABELS "phsolver_incompressible")
8*fa773e3fSCameron Smithendmacro(ic_parallel_test)
9*fa773e3fSCameron Smith
10*fa773e3fSCameron Smithmacro(ic_serial_test name exe)
11*fa773e3fSCameron Smith  set(tname incompressible_${name})
12*fa773e3fSCameron Smith  add_test( NAME ${tname} COMMAND ${exe} ${ARGN} )
13*fa773e3fSCameron Smith  set_tests_properties(${tname} PROPERTIES LABELS "phsolver_incompressible")
14*fa773e3fSCameron Smithendmacro(ic_serial_test)
15*fa773e3fSCameron Smith
16b3c8e343SCameron Smithset(CDIR ${CASES}/incompressible)
17*fa773e3fSCameron Smithic_serial_test(copyInpCfg
189c38c5ebSCameron Smith  cp ${PHASTA_SOURCE_DIR}/phSolver/common/input.config ${CDIR})
19*fa773e3fSCameron Smithic_serial_test(linkProcsDir-sync
20ec2df29eSCameron Smith  ln -snf ${CDIR}/4-procs_case-SyncIO-2 ${CDIR}/4-procs_case)
218312278fSCameron Smithif(HAS_VALGRIND)
22*fa773e3fSCameron Smith  ic_serial_test(resetNumStartValgrind-sync
238312278fSCameron Smith    cp ${CDIR}/numstart.dat ${CDIR}/4-procs_case/numstart.dat)
24*fa773e3fSCameron Smith  ic_parallel_test(valgrind-sync 4 ${CDIR}
25*fa773e3fSCameron Smith    valgrind --leak-check=yes --log-file=icSyncValgrind.%p
26*fa773e3fSCameron Smith    ${PHASTA_BINARY_DIR}/bin/phastaIC.exe)
278312278fSCameron Smithendif(HAS_VALGRIND)
28*fa773e3fSCameron Smithic_serial_test(resetNumStart-sync
2941f58292SCameron Smith  cp ${CDIR}/numstart.dat ${CDIR}/4-procs_case/numstart.dat)
30*fa773e3fSCameron Smithic_parallel_test(sync 4 ${CDIR} ${PHASTA_BINARY_DIR}/bin/phastaIC.exe)
31*fa773e3fSCameron Smithset(compareArgs
32006092acSCameron Smith  ${CDIR}/4-procs_case-SyncIO-2/
33006092acSCameron Smith  ${CDIR}/4-procs_case-SyncIO-2_ref/
34006092acSCameron Smith  2 1e-6)
35*fa773e3fSCameron Smithic_parallel_test(compare-sync 4 ${CDIR}
36*fa773e3fSCameron Smith  ${PHASTA_BINARY_DIR}/bin/checkphasta ${compareArgs})
37*fa773e3fSCameron Smithic_parallel_test(restart-sync 4 ${CDIR} ${PHASTA_BINARY_DIR}/bin/phastaIC.exe)
38*fa773e3fSCameron Smithic_parallel_test(compareRestart-sync 4 ${CDIR}
39*fa773e3fSCameron Smith  ${PHASTA_BINARY_DIR}/bin/checkphasta ${compareArgs})
40fe88b52dSCameron Smith
41*fa773e3fSCameron Smithic_serial_test(linkProcsDir-posix
42fe88b52dSCameron Smith  ln -snf ${CDIR}/4-procs_case-Posix ${CDIR}/4-procs_case)
438312278fSCameron Smithif(HAS_VALGRIND)
44*fa773e3fSCameron Smith  ic_serial_test(resetNumStartValgrind-posix
458312278fSCameron Smith    cp ${CDIR}/numstart.dat ${CDIR}/4-procs_case/numstart.dat)
46*fa773e3fSCameron Smith  ic_parallel_test(valgrind-posix 4 ${CDIR}
47*fa773e3fSCameron Smith    valgrind --leak-check=yes --log-file=icPosixValgrind.%p
48*fa773e3fSCameron Smith    ${PHASTA_BINARY_DIR}/bin/phastaIC.exe)
498312278fSCameron Smithendif(HAS_VALGRIND)
50*fa773e3fSCameron Smithic_serial_test(resetNumStart-posix
51fe88b52dSCameron Smith  cp ${CDIR}/numstart.dat ${CDIR}/4-procs_case/numstart.dat)
52*fa773e3fSCameron Smithic_parallel_test(posix 4 ${CDIR} ${PHASTA_BINARY_DIR}/bin/phastaIC.exe)
53*fa773e3fSCameron Smithset(compareArgs
54006092acSCameron Smith  ${CDIR}/4-procs_case-Posix/
55006092acSCameron Smith  ${CDIR}/4-procs_case-Posix_ref/
56006092acSCameron Smith  0 1e-6)
57*fa773e3fSCameron Smithic_parallel_test(compare-posix 4 ${CDIR}
58*fa773e3fSCameron Smith  ${PHASTA_BINARY_DIR}/bin/checkphasta ${compareArgs})
59*fa773e3fSCameron Smithic_parallel_test(restart-posix 4 ${CDIR} ${PHASTA_BINARY_DIR}/bin/phastaIC.exe)
60*fa773e3fSCameron Smithic_parallel_test(compareRestart-posix 4 ${CDIR}
61*fa773e3fSCameron Smith  ${PHASTA_BINARY_DIR}/bin/checkphasta ${compareArgs})
62*fa773e3fSCameron Smithic_serial_test(unlinkProcsDir rm ${CDIR}/4-procs_case)
63