fbee1da3c30d5ecb126ddbcaade66ca804ca4091
[jansson.git] / test / suites / api / run
1 #!/bin/sh
2 #
3 # Copyright (c) 2009 Petri Lehtinen <petri@digip.org>
4 #
5 # Jansson is free software; you can redistribute it and/or modify
6 # it under the terms of the MIT license. See LICENSE for details.
7
8 is_test() {
9     [ "${test_name%.c}" != "$test_name" ] && return 0
10     [ -x $test_path -a ! -f $test_path.c ] && return 0
11     return 1
12 }
13
14 run_test() {
15     if [ -x $test_path ]; then
16         test_log=$test_log $test_path >$test_log/stdout 2>$test_log/stderr
17     else
18         $suite_builddir/${test_name%.c} >$test_log/stdout 2>$test_log/stderr
19     fi
20 }
21
22 show_error() {
23     valgrind_show_error && return
24     cat $test_log/stderr
25 }
26
27 . $top_srcdir/test/scripts/run-tests.sh