From aa139a7d2b3f26af7590edbf413df67195c5d900 Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 27 Apr 2009 00:25:16 +0200 Subject: Adding ue2 --- ue2/imgsynth2/test/test.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 ue2/imgsynth2/test/test.sh (limited to 'ue2/imgsynth2/test/test.sh') 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 @@ +#!/bin/bash + +inputs=( $(ls test/input_* | sort -n) ) + +for input in ${inputs[@]} +do + echo "Testing $input ..." + + files=() + for tag in "#in: " "#out: " "#ref: " + do + tmp=$(grep "$tag" "$input") + if [ -z "$tmp" ] + then + echo " ERROR: Tag '$tag' missing" + exit 1 + fi + + tmp=${tmp:${#tag}} + #if [ ! -e "$tmp" ] + #then + # echo " ERROR: File '$tmp' doesn't exist" + # exit 1 + #fi + + files+=("$tmp") + done + + rm -f "${files[1]}" + ./imgsynth2 -i "$input" + ret=$? + if [ $ret -ne 0 ] + then + echo " ERROR: Script didn't exit properly" + exit 1 + fi + + md5_1=$(md5sum < "${files[1]}") + md5_2=$(md5sum < "${files[2]}") + if [ "$md5_1" != "$md5_2" ] + then + echo " ERROR: ${files[1]} and ${files[2]} differ" + exit 1 + else + echo " Test successful" + fi +done + -- cgit v1.2.3