File: test_failed.sh

package info (click to toggle)
packmol 1%3A21.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,504 kB
  • sloc: tcl: 7,504; f90: 5,290; fortran: 1,879; sh: 299; makefile: 167; python: 121; lisp: 101
file content (26 lines) | stat: -rwxr-xr-x 575 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/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"
#
echo "Running failed packing test ... "
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
echo "Failed run test $1 OK."
exit 0