-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add error handling to test1.sh and c++ runtime dependency to windows
- Loading branch information
Showing
3 changed files
with
48 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,53 @@ | ||
#!/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" | ||
|
||
if [ ! -f $EXE ]; then | ||
echo "NFsim executable $EXE not found. Exiting..." | ||
exit 1 | ||
fi | ||
if [ ! -f $INPUT ]; then | ||
echo "Input file $INPUT not found. Exiting..." | ||
exit 1 | ||
fi | ||
if [ ! -f $EXPECTED_OUTPUT ]; then | ||
echo "Expected output file $EXPECTED_OUTPUT not found. Exiting..." | ||
exit 1 | ||
fi | ||
if [ ! -f $EXPECTED_SPECIES ]; then | ||
echo "Expected species file $EXPECTED_SPECIES not found. Exiting..." | ||
exit 1 | ||
fi | ||
|
||
|
||
command="$EXE -seed 505790288 -vcell -xml $INPUT -o $OUTPUT -sim 1.0 -ss $SPECIES -oStep 20 -notf -utl 1000 -cb -pcmatch -tid 0" | ||
$EXE $command | ||
if ! $command; then | ||
echo "NFsim failed to run. Exiting..." | ||
exit 1 | ||
fi | ||
|
||
# verify that the output files exist | ||
if [ ! -f $OUTPUT ]; then | ||
echo "Output file $OUTPUT not found. Exiting..." | ||
exit 1 | ||
fi | ||
if [ ! -f $SPECIES ]; then | ||
echo "Species file $SPECIES not found. Exiting..." | ||
exit 1 | ||
fi | ||
|
||
diff $OUTPUT $EXPECTED_OUTPUT | ||
diff $SPECIES $EXPECTED_SPECIES | ||
# verify that the output files match the expected output files | ||
if ! diff $OUTPUT $EXPECTED_OUTPUT; then | ||
echo "Output file $OUTPUT does not match expected output $EXPECTED_OUTPUT. Exiting..." | ||
exit 1 | ||
fi | ||
if ! diff $SPECIES $EXPECTED_SPECIES; then | ||
echo "Species file $SPECIES does not match expected species $EXPECTED_SPECIES. Exiting..." | ||
exit 1 | ||
fi |