diff options
Diffstat (limited to 'common/scripts/kselftest-runner.sh')
-rwxr-xr-x | common/scripts/kselftest-runner.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/common/scripts/kselftest-runner.sh b/common/scripts/kselftest-runner.sh new file mode 100755 index 0000000..f1526ac --- /dev/null +++ b/common/scripts/kselftest-runner.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +TEST_NAME=$1 +COMMAND=$(basename $2) +DIR=$(dirname $2) +LOG="result.log"; + +cd ${DIR} +chmod a+x ${COMMAND} +(./${COMMAND} 2>&1 || echo "${TEST_NAME}: [FAIL]") | tee ${LOG} +if [ -n "`grep \"skip\" ${LOG}`" ]; then + echo "${TEST_NAME}: [SKIP]"; +elif [ -z "`grep \"SKIP\|FAIL\" ${LOG}`" ]; then + echo "${TEST_NAME}: [PASS]" +fi + +while read l; +do + [ -n "`echo $l|grep 'running'`" ] && test="`echo $l|sed 's/running //'`" + [ -n "`echo $l|grep \"\[PASS\|FAIL\|SKIP\"`" ] && result=$l + [ "${test}" -a "${result}" ] && echo "${test}: ${result}" && unset test && unset result +done < ${LOG} + |