Skip to content

Commit

Permalink
restore testing of generation of failed packing files
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiq committed Jul 12, 2024
1 parent 2a20444 commit 048a4b5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
5 changes: 4 additions & 1 deletion testing/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
curl -fsSL https://install.julialang.org | sh
# Run the tests
julia runtests.jl water_box.inp \
ieee_signaling.inp
ieee_signaling.inp

# check if output files are properly generated in a failed run
./test_failed.sh water_box_failed.inp packmol.log "FORCED"
24 changes: 24 additions & 0 deletions testing/test_failed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
#
# First argument: input file name
# Second argument: log file name
#
# Third argument: string to be searched in the log file, to declare that
# the test passed
#
# Example: ./test.sh "water_box.inp" "packmol.log" "FORCED"
#
if ! [ -f $1 ]; then
echo "Error: input file not found: $1"
exit 1
fi
../packmol < $1 > $2
if ! [ -f $2 ]; then
echo "Error: Log file not generated: $2"
exit 1
fi
if ! grep -q $3 $2; then
echo "Error: could not find $3 in $2"
exit 1
fi
exit 0

0 comments on commit 048a4b5

Please sign in to comment.