Add two test tools to admin
testfilter.sh: makes a test skeleton from nobug output testrunner: build and run a single test (autotools only)
This commit is contained in:
parent
e6d7b39ffe
commit
31c7c4630f
2 changed files with 57 additions and 0 deletions
52
admin/testfilter.sh
Executable file
52
admin/testfilter.sh
Executable file
|
|
@ -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
|
||||
5
admin/testrunner
Executable file
5
admin/testrunner
Executable file
|
|
@ -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 "./$@"
|
||||
Loading…
Reference in a new issue