From 31c7c4630f8dab7dde14e5af1f0dfc0a96ced814 Mon Sep 17 00:00:00 2001 From: Christian Thaeter Date: Fri, 16 Jul 2010 07:59:30 +0200 Subject: [PATCH] Add two test tools to admin testfilter.sh: makes a test skeleton from nobug output testrunner: build and run a single test (autotools only) --- admin/testfilter.sh | 52 +++++++++++++++++++++++++++++++++++++++++++++ admin/testrunner | 5 +++++ 2 files changed, 57 insertions(+) create mode 100755 admin/testfilter.sh create mode 100755 admin/testrunner diff --git a/admin/testfilter.sh b/admin/testfilter.sh new file mode 100755 index 000000000..b3f4f469e --- /dev/null +++ b/admin/testfilter.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# +# Little hack to filter nobug logging output producing something suiteable for testsuites +# + +gawk --posix -f /dev/fd/3 3<<"EOF" +BEGIN { + FS = ": " + toescape = "[]().*{}" + prev = "" + LOGSUPPRESS="TRACE|INFO|NOTICE|WARNING|ERR|TODO|PLANNED|FIXME|DEPRECATED|UNIMPLEMENTED|RESOURCE_ANNOUNCE|RESOURCE_ENTER|RESOURCE_STATE|RESOURCE_LEAVE" +} + +function escape(string) { + for (i = 1; i <= length(toescape); ++i) + gsub("\\"substr(toescape, i, 1), "\\"substr(toescape, i, 1), string) + + return string +} + +function linerest(start, end) { + result = $start + + for (i = start+1; i <= end; i++) + { + result = result": "$i + } + return result +} + + +function remove_duplicate_spaces(rest) { + return "foo"rest"bar" +} + + +/[0-9]{10}: [A-Z]*: / { + rest = linerest(6, NF); + + rest = escape(rest) + gsub(/0x[0-9a-f]+/,"0x[0-9a-f]+", rest) + + new = $2 ": .*: " $4 ": " $5 ": " rest + + if (new != prev && !(new ~ LOGSUPPRESS)) + { + print "err: " new + prev = new + } +} + +EOF diff --git a/admin/testrunner b/admin/testrunner new file mode 100755 index 000000000..b99534b9d --- /dev/null +++ b/admin/testrunner @@ -0,0 +1,5 @@ +#!/bin/sh + +#test rig for running programs manually under libtool and valgrind +export NOBUG_LOG LUMIERA_PLUGIN_PATH +make ${CONCURRENCY_LEVEL:+-j$CONCURRENCY_LEVEL} "$1" && libtool --mode=execute valgrind --leak-check=full -q "./$@"