|
|
@ -1,6 +1,7 @@
|
|
|
|
#!/bin/bash
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
|
|
RESULTS=${RESULTS:-.}
|
|
|
|
RESULTS=${RESULTS:-.}
|
|
|
|
|
|
|
|
ID=0
|
|
|
|
|
|
|
|
|
|
|
|
if [ -z "${FORMAT}" ] ; then
|
|
|
|
if [ -z "${FORMAT}" ] ; then
|
|
|
|
FORMAT=TAP
|
|
|
|
FORMAT=TAP
|
|
|
@ -16,10 +17,20 @@ esac
|
|
|
|
mkdir -p "${RESULTS}"/reports
|
|
|
|
mkdir -p "${RESULTS}"/reports
|
|
|
|
rm -rf "${RESULTS}"/reports/*
|
|
|
|
rm -rf "${RESULTS}"/reports/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# unique id across files
|
|
|
|
|
|
|
|
# See TT#4590
|
|
|
|
|
|
|
|
function fix_id() {
|
|
|
|
|
|
|
|
(( ID += 1))
|
|
|
|
|
|
|
|
local tmp_id
|
|
|
|
|
|
|
|
tmp_id=$(printf "%05d\n" "$ID")
|
|
|
|
|
|
|
|
sed -i "s/id=\"00001\"/id=\"$tmp_id\"/" "$1"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function do_test() {
|
|
|
|
function do_test() {
|
|
|
|
echo "testing $1 -> ${RESULTS}/reports/${1}.${EXT}"
|
|
|
|
local RES="${RESULTS}/reports/${1}.${EXT}"
|
|
|
|
|
|
|
|
echo "testing $1 -> ${RES}"
|
|
|
|
if ${OUT_FORCE} ; then
|
|
|
|
if ${OUT_FORCE} ; then
|
|
|
|
cat<<EOF|lua5.1 - > ${RESULTS}/reports/${1}.${EXT}
|
|
|
|
cat<<EOF |lua5.1 - > "${RES}"
|
|
|
|
EXPORT_ASSERT_TO_GLOBALS = true
|
|
|
|
EXPORT_ASSERT_TO_GLOBALS = true
|
|
|
|
require "tests/${1}"
|
|
|
|
require "tests/${1}"
|
|
|
|
---- Control test output:
|
|
|
|
---- Control test output:
|
|
|
@ -35,17 +46,21 @@ require "tests/${1}"
|
|
|
|
---- Control test output:
|
|
|
|
---- Control test output:
|
|
|
|
local lu = LuaUnit
|
|
|
|
local lu = LuaUnit
|
|
|
|
lu:setOutputType('${FORMAT}')
|
|
|
|
lu:setOutputType('${FORMAT}')
|
|
|
|
lu:setFname('${RESULTS}/reports/${1}.${EXT}')
|
|
|
|
lu:setFname('${RES}')
|
|
|
|
lu:setVerbosity(1)
|
|
|
|
lu:setVerbosity(1)
|
|
|
|
lu:run()
|
|
|
|
lu:run()
|
|
|
|
EOF
|
|
|
|
EOF
|
|
|
|
|
|
|
|
if [[ "${FORMAT}" = "JUNIT" ]] ; then
|
|
|
|
|
|
|
|
fix_id "${RES}"
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [[ -n "$@" ]]; then
|
|
|
|
if [[ -n "$@" ]]; then
|
|
|
|
for i in $@; do
|
|
|
|
for i in "$@"; do
|
|
|
|
if [ ! -f "$i" ]; then
|
|
|
|
if [ ! -f "$i" ]; then
|
|
|
|
echo "No $f found"
|
|
|
|
echo "No $i found"
|
|
|
|
else
|
|
|
|
else
|
|
|
|
do_test "$(basename "$i" .lua)"
|
|
|
|
do_test "$(basename "$i" .lua)"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
@ -53,6 +68,6 @@ if [[ -n "$@" ]]; then
|
|
|
|
exit 0
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
for i in $(find tests -name '*.lua' ! -name test_\*) ; do
|
|
|
|
find tests -name '*.lua' ! -name test_\*| while read -r i ; do
|
|
|
|
do_test "$(basename "$i" .lua)"
|
|
|
|
do_test "$(basename "$i" .lua)"
|
|
|
|
done
|
|
|
|
done
|
|
|
|