diff options
| author | manuel <manuel@nc8430.lan> | 2009-04-27 00:25:16 +0200 |
|---|---|---|
| committer | manuel <manuel@nc8430.lan> | 2009-04-27 00:25:16 +0200 |
| commit | aa139a7d2b3f26af7590edbf413df67195c5d900 (patch) | |
| tree | ba99ea3b2af9aa191386550f025520117f18f4f8 /ue2/imgsynth2/test/test.sh | |
| parent | 384539f7cc9feaa7ef7cee385cce472c6966c843 (diff) | |
| download | ooprog-aa139a7d2b3f26af7590edbf413df67195c5d900.tar.gz ooprog-aa139a7d2b3f26af7590edbf413df67195c5d900.tar.bz2 ooprog-aa139a7d2b3f26af7590edbf413df67195c5d900.zip | |
Adding ue2
Diffstat (limited to 'ue2/imgsynth2/test/test.sh')
| -rwxr-xr-x | ue2/imgsynth2/test/test.sh | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/ue2/imgsynth2/test/test.sh b/ue2/imgsynth2/test/test.sh new file mode 100755 index 0000000..5d760b9 --- /dev/null +++ b/ue2/imgsynth2/test/test.sh | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | inputs=( $(ls test/input_* | sort -n) ) | ||
| 4 | |||
| 5 | for input in ${inputs[@]} | ||
| 6 | do | ||
| 7 | echo "Testing $input ..." | ||
| 8 | |||
| 9 | files=() | ||
| 10 | for tag in "#in: " "#out: " "#ref: " | ||
| 11 | do | ||
| 12 | tmp=$(grep "$tag" "$input") | ||
| 13 | if [ -z "$tmp" ] | ||
| 14 | then | ||
| 15 | echo " ERROR: Tag '$tag' missing" | ||
| 16 | exit 1 | ||
| 17 | fi | ||
| 18 | |||
| 19 | tmp=${tmp:${#tag}} | ||
| 20 | #if [ ! -e "$tmp" ] | ||
| 21 | #then | ||
| 22 | # echo " ERROR: File '$tmp' doesn't exist" | ||
| 23 | # exit 1 | ||
| 24 | #fi | ||
| 25 | |||
| 26 | files+=("$tmp") | ||
| 27 | done | ||
| 28 | |||
| 29 | rm -f "${files[1]}" | ||
| 30 | ./imgsynth2 -i "$input" | ||
| 31 | ret=$? | ||
| 32 | if [ $ret -ne 0 ] | ||
| 33 | then | ||
| 34 | echo " ERROR: Script didn't exit properly" | ||
| 35 | exit 1 | ||
| 36 | fi | ||
| 37 | |||
| 38 | md5_1=$(md5sum < "${files[1]}") | ||
| 39 | md5_2=$(md5sum < "${files[2]}") | ||
| 40 | if [ "$md5_1" != "$md5_2" ] | ||
| 41 | then | ||
| 42 | echo " ERROR: ${files[1]} and ${files[2]} differ" | ||
| 43 | exit 1 | ||
| 44 | else | ||
| 45 | echo " Test successful" | ||
| 46 | fi | ||
| 47 | done | ||
| 48 | |||
