2009-12-15 05:01:36 +08:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2009 Petri Lehtinen <petri@digip.org>
|
|
|
|
#
|
|
|
|
# Jansson is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the MIT license. See LICENSE for details.
|
|
|
|
|
|
|
|
is_test() {
|
2009-12-21 20:00:57 +08:00
|
|
|
[ "${test_name%.c}" != "$test_name" ] && return 0
|
|
|
|
[ -x $test_path -a ! -f $test_path.c ] && return 0
|
|
|
|
return 1
|
2009-12-15 05:01:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
run_test() {
|
2009-12-21 20:00:57 +08:00
|
|
|
if [ -x $test_path ]; then
|
|
|
|
test_log=$test_log $test_path >$test_log/stdout 2>$test_log/stderr
|
|
|
|
else
|
2010-01-10 22:18:45 +08:00
|
|
|
$test_runner $suite_builddir/${test_name%.c} \
|
|
|
|
>$test_log/stdout \
|
|
|
|
2>$test_log/stderr
|
|
|
|
valgrind_check $test_log/stderr || return 1
|
2009-12-21 20:00:57 +08:00
|
|
|
fi
|
2009-12-15 05:01:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
show_error() {
|
|
|
|
valgrind_show_error && return
|
|
|
|
cat $test_log/stderr
|
|
|
|
}
|
|
|
|
|
|
|
|
. $top_srcdir/test/scripts/run-tests.sh
|