2009-12-15 05:01:36 +08:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2013-07-23 18:20:06 +08:00
|
|
|
# Copyright (c) 2009-2013 Petri Lehtinen <petri@digip.org>
|
2009-12-15 05:01:36 +08:00
|
|
|
#
|
|
|
|
# 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() {
|
2010-02-03 02:37:00 +08:00
|
|
|
case "$test_name" in
|
2010-06-13 01:45:19 +08:00
|
|
|
*.c|check-exports)
|
2010-02-03 02:37:00 +08:00
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
return 1
|
|
|
|
;;
|
|
|
|
esac
|
2009-12-15 05:01:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
run_test() {
|
2010-02-03 02:37:00 +08:00
|
|
|
if [ "$test_name" = "check-exports" ]; then
|
2009-12-21 20:00:57 +08:00
|
|
|
test_log=$test_log $test_path >$test_log/stdout 2>$test_log/stderr
|
|
|
|
else
|
2010-06-13 01:45:19 +08:00
|
|
|
$test_runner $suite_builddir/${test_name%.c} \
|
2010-01-10 22:18:45 +08:00
|
|
|
>$test_log/stdout \
|
2010-01-29 02:58:25 +08:00
|
|
|
2>$test_log/stderr \
|
|
|
|
|| return 1
|
2010-01-10 22:18:45 +08:00
|
|
|
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
|