launch_functional_tests 885 Bytes
Newer Older
1
# sh launch_functional_tests functional/test_*rb
2

3
FUNCTIONAL_TESTS=$*
4 5 6 7

rename_reports_in() {
    dir="$1"
    b="$2"
8
    if [ "$b" = "." ]; then
9 10 11 12 13 14 15 16 17 18
        b="default"
    else
        b=$(echo "$b" | tr '/' '-')
    fi
    for file in $1/*.xml; do
        filename=$(basename -s .xml $file)
        mv $file $dir/$filename-$b.xml
    done
}

19
rm -f test/*.xml
20
EXIT=0
21 22 23 24
if [ -z "$FUNCTIONAL_CLIENT_BROWSER_PATH" ]; then
    FUNCTIONAL_CLIENT_BROWSER_PATH="."
fi
for browser in $FUNCTIONAL_CLIENT_BROWSER_PATH; do
25
    for file in $FUNCTIONAL_TESTS; do
26 27 28 29 30 31 32 33
        if [ ${#browser} -gt 1 ]; then
            export WATIR_BROWSER_PATH="$browser"
        fi
        ruby -I functional $file;
        TMP_EXIT=$?
        if [ $TMP_EXIT -ne 0 ]; then
            EXIT=$TMP_EXIT
        fi
34
        rename_reports_in test/reports/ "$browser"
35 36
        mv test/reports/*.xml test/
    done
37
done
38
exit $EXIT