-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathrun-tests
More file actions
executable file
·27 lines (24 loc) · 812 Bytes
/
run-tests
File metadata and controls
executable file
·27 lines (24 loc) · 812 Bytes
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
#!/usr/bin/env bash
# Enter the directory where this script is located.
cd "$(dirname "${BASH_SOURCE[0]}")"
run_test() {
local test_description=$1
local test_parameters=$2
local test_output_file=$3
diff <(PYGAME_HIDE_SUPPORT_PROMPT=hide ./double-pendulum --test-mode $test_parameters) \
"$test_output_file"
if [ $? -ne 0 ]
then
echo "[FAILED] $test_description"
exit 1
fi
echo "[PASSED] $test_description"
}
for test_param_file in $(ls tests/*.param)
do
test_id=${test_param_file/.param/}
test_parameters=$(cat ${test_param_file})
test_output_file=${test_param_file/.param/.out}
run_test "$test_id (Lagrangian)" "$test_parameters" "$test_output_file"
run_test "$test_id (Hamiltonian)" "$test_parameters -H" "$test_output_file"
done