Skip to content

Commit

Permalink
consolidate tests/test1 directory for NFsim
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Jul 25, 2024
1 parent f2b1583 commit 28c9532
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 7 deletions.
2 changes: 1 addition & 1 deletion NFsim_v1.11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ enable_testing()
add_executable(${exe_target} ${SRC_FILES})
target_link_libraries(${exe_target} vcommons vcellmessaging)

add_test(NAME ${exe_target}_test1 COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tests/test1.sh ${CMAKE_BINARY_DIR}/bin/${exe_target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests)
add_test(NAME ${exe_target}_test1 COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tests/test1/test1.sh ${CMAKE_BINARY_DIR}/bin/${exe_target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/test1)

install(TARGETS ${exe_target} RUNTIME DESTINATION ${OPTION_EXE_DIRECTORY})

12 changes: 12 additions & 0 deletions NFsim_v1.11/tests/test1/SimID_273069657_0_.gdat.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# time O0_MT0_tot_Count O0_MT1_tot_Count O0_MT2_tot_Count O0_MT3_tot_Count O0_MT4_tot_Count s0_Count s1_Count s2_Count s3_Count s4_Count
0.00000000e+00 6.02000000e+02 9.03000000e+02 1.20400000e+03 0.00000000e+00 0.00000000e+00 6.02000000e+02 9.03000000e+02 1.20400000e+03 0.00000000e+00 0.00000000e+00
1.00000000e-01 5.37000000e+02 9.68000000e+02 1.13900000e+03 0.00000000e+00 0.00000000e+00 5.37000000e+02 9.68000000e+02 1.13900000e+03 0.00000000e+00 0.00000000e+00
2.00000000e-01 5.24000000e+02 9.81000000e+02 1.12600000e+03 0.00000000e+00 0.00000000e+00 5.24000000e+02 9.81000000e+02 1.12600000e+03 0.00000000e+00 0.00000000e+00
3.00000000e-01 5.23000000e+02 9.82000000e+02 1.12500000e+03 0.00000000e+00 0.00000000e+00 5.23000000e+02 9.82000000e+02 1.12500000e+03 0.00000000e+00 0.00000000e+00
4.00000000e-01 5.30000000e+02 9.75000000e+02 1.13200000e+03 0.00000000e+00 0.00000000e+00 5.30000000e+02 9.75000000e+02 1.13200000e+03 0.00000000e+00 0.00000000e+00
5.00000000e-01 5.23000000e+02 9.82000000e+02 1.12500000e+03 0.00000000e+00 0.00000000e+00 5.23000000e+02 9.82000000e+02 1.12500000e+03 0.00000000e+00 0.00000000e+00
6.00000000e-01 5.21000000e+02 9.84000000e+02 1.12300000e+03 0.00000000e+00 0.00000000e+00 5.21000000e+02 9.84000000e+02 1.12300000e+03 0.00000000e+00 0.00000000e+00
7.00000000e-01 5.20000000e+02 9.85000000e+02 1.12200000e+03 0.00000000e+00 0.00000000e+00 5.20000000e+02 9.85000000e+02 1.12200000e+03 0.00000000e+00 0.00000000e+00
8.00000000e-01 5.13000000e+02 9.92000000e+02 1.11500000e+03 0.00000000e+00 0.00000000e+00 5.13000000e+02 9.92000000e+02 1.11500000e+03 0.00000000e+00 0.00000000e+00
9.00000000e-01 5.13000000e+02 9.92000000e+02 1.11500000e+03 0.00000000e+00 0.00000000e+00 5.13000000e+02 9.92000000e+02 1.11500000e+03 0.00000000e+00 0.00000000e+00
1.00000000e+00 5.33000000e+02 9.72000000e+02 1.13500000e+03 0.00000000e+00 0.00000000e+00 5.33000000e+02 9.72000000e+02 1.13500000e+03 0.00000000e+00 0.00000000e+00
5 changes: 5 additions & 0 deletions NFsim_v1.11/tests/test1/SimID_273069657_0_.species.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# nfsim generated species list for system: 'nameless'
# warning! this feature is not yet fully tested!
MT0(AAA~c0,AAB~0) 532
MT1(AAA~c0,AAB~0) 973
MT2(AAA~c0,AAB~0) 1134
19 changes: 13 additions & 6 deletions NFsim_v1.11/tests/test1.sh → NFsim_v1.11/tests/test1/test1.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/bin/bash
set -e
set -x
EXE=$1
INPUT="data/SimID_273069657_0_.nfsimInput"
OUTPUT="data/SimID_273069657_0_.gdat"
EXPECTED_OUTPUT="data/SimID_273069657_0_.gdat.expected"
SPECIES="data/SimID_273069657_0_.species"
EXPECTED_SPECIES="data/SimID_273069657_0_.species.expected"

# get the directory of this script
TEST_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

INPUT="${TEST_DIR}/SimID_273069657_0_.nfsimInput"
OUTPUT="${TEST_DIR}/SimID_273069657_0_.gdat"
EXPECTED_OUTPUT="${TEST_DIR}/SimID_273069657_0_.gdat.expected"
SPECIES="${TEST_DIR}/SimID_273069657_0_.species"
EXPECTED_SPECIES="${TEST_DIR}/SimID_273069657_0_.species.expected"

if [ ! -f $EXE ]; then
echo "NFsim executable $EXE not found. Exiting..."
Expand All @@ -27,6 +30,7 @@ fi


command="$EXE -seed 505790288 -vcell -xml $INPUT -o $OUTPUT -sim 1.0 -ss $SPECIES -oStep 20 -notf -utl 1000 -cb -pcmatch -tid 0"
echo $command
if ! $command; then
echo "NFsim failed to run. Exiting..."
exit 1
Expand All @@ -51,3 +55,6 @@ if ! diff $SPECIES $EXPECTED_SPECIES; then
echo "Species file $SPECIES does not match expected species $EXPECTED_SPECIES. Exiting..."
exit 1
fi

echo "NFsim solver complted and solution matched expected output. Exiting..."
exit 0

0 comments on commit 28c9532

Please sign in to comment.