-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathrun.sh
executable file
·39 lines (34 loc) · 1.2 KB
/
run.sh
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
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
# $Id$
##################################################################
# This script defines a set of sample simulation cases that
# is used to verify the integrity of an IFEM-based simulator.
# Copy this file to a sub-folder Test in your App-directory and
# insert the simulations that you want to use as regression tests.
##################################################################
# Define the name of the executable here
mysim=
run () {
# This function runs a simulation with the specified options,
# pipes the terminal output to a log-file, and compares it
# with a previous simulation stored in the Reference folder.
inp=$1
log=`basename $1 .inp`.log
echo Running $inp ...
shift
time -f "real time %E, user time %U, system time %S" \
../Release/bin/$mysim $inp $* > $log
if [ ! -e Reference/$log ]; then
mv $log Reference
elif cmp -s $log Reference/$log; then
echo Ok
else
echo "Warning: Discrepancies between current run and reference."
diff $log Reference
fi
}
if [ ! -d Reference ]; then mkdir Reference; fi
#####################################
# Enter the various cases below:
# Format: run <inputfile> [<options>]
#####################################