From 3bc9db5aad88d5606dbbe7eb8092f8beaa317e9b Mon Sep 17 00:00:00 2001 From: vext01 Date: Sun, 5 Feb 2012 00:14:48 +0000 Subject: [PATCH] add filtering (such as grep) support via $FILTER, untested, looks OK From Simon Ruderich --- tests.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests.sh b/tests.sh index d0c2846f..0cd147c6 100644 --- a/tests.sh +++ b/tests.sh @@ -1,7 +1,15 @@ #!/do/not/execute run_test() { - r2args="${r2} -e scr.color=0 -n -q -i ${rad} ${ARGS} ${FILE} > ${out} 2>&1" + r2args="${r2} -e scr.color=0 -n -q -i ${rad} ${ARGS} ${FILE}" + + # ${FILTER} can be used to filter out random results to create stable + # tests. + if [ -n "${FILTER}" ]; then + r2args="${r2args} 2>&1 | ${FILTER} > ${out}" + else + r2args="${r2args} > ${out} 2>&1" + fi if [ -n "${VALGRIND}" ]; then cmd="valgrind --error-exitcode=47 --log-file=${val} ${r2args}"