X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=test%2Fsuites%2Fapi%2Frun;h=ff53f35c6f02ea8b3439f3ee72f37e07ccd6ffda;hb=8d75235ff22dc4aced697e198c3c024f1f4b88fe;hp=29d628ae53433c135f359f2266249bd5aacabca7;hpb=e7a5dc58e630aa079f402b46a65d218e656dd489;p=jansson.git diff --git a/test/suites/api/run b/test/suites/api/run index 29d628a..ff53f35 100755 --- a/test/suites/api/run +++ b/test/suites/api/run @@ -1,16 +1,39 @@ #!/bin/sh # -# Copyright (c) 2009 Petri Lehtinen +# Copyright (c) 2009, 2010 Petri Lehtinen # # 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() { - test "${test_name%.c}" != "$test_name" + case "$test_name" in + *.c|*.cpp|check-exports) + return 0 + ;; + *) + return 1 + ;; + esac } run_test() { - $suite_builddir/${test_name%.c} >$test_log/stdout 2>$test_log/stderr + if [ "$test_name" = "check-exports" ]; then + test_log=$test_log $test_path >$test_log/stdout 2>$test_log/stderr + else + case "$test_name" in + *.c) + test_bin=${test_name%.c} + ;; + *.cpp) + test_bin=${test_name%.cpp} + ;; + esac + $test_runner $suite_builddir/$test_bin \ + >$test_log/stdout \ + 2>$test_log/stderr \ + || return 1 + valgrind_check $test_log/stderr || return 1 + fi } show_error() {