Attempt to run testcases more easily

This commit is contained in:
ville rantanen
2014-03-29 11:23:13 +02:00
parent 03349602b5
commit 29f133f44d
4 changed files with 177 additions and 0 deletions

48
anduril/testing/testcasecopy.sh Executable file
View File

@@ -0,0 +1,48 @@
#!/bin/bash
if [ -z "$2" ]
then
echo "
Copies Anduril testcase results to the original source location.
Use it when testcases fail, but you know the results to be correct.
After copying you must commit the changes in the checkout.
Usage: testcasecopy executionfolder/ComponentFolder /path/to/bundle/root
example: testcasecopy results/CSVJoin ~/anduril/trunk/microarray/
Any extra arguments are given to the copy command: cp -a [args] source target
Recommended use: -i for prompt before overwrite and -v for verbose
"
exit 0
fi
IFS=$'\n'
component=$( basename "$1" )
execfolder=$( dirname "$1" )
source=$1
bundle=$2
shift 2
if [ ! -d "$source" ]
then echo "$source folder not found"
exit 1
fi
if [ ! -d "$bundle" ]
then echo "$bundle folder not found"
exit 1
fi
#echo $execfolder $component
cases=$( find "$source" -mindepth 1 -maxdepth 1 -type d )
for case in $cases
do
casebase=$( basename "$case" )
tgt="${bundle}/components/${component}/testcases/${casebase}/expected-output"
if [ -d "$tgt" ]
then
for output in $( ls "${case}/component" | grep -v ^_ )
do
cp -a $@ "${case}/component/${output}" "${tgt}/"
done
else
echo "$component $casebase does not have expected-output folder"
fi
done