From: Petri Lehtinen Date: Mon, 21 Dec 2009 12:00:57 +0000 (+0200) Subject: Add check-exports test X-Git-Tag: v1.2~14 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=jansson.git;a=commitdiff_plain;h=22173c1d8bba09e764ba847646941ef7a43451fc Add check-exports test --- diff --git a/test/suites/api/check-exports b/test/suites/api/check-exports new file mode 100755 index 0000000..d3bbe2f --- /dev/null +++ b/test/suites/api/check-exports @@ -0,0 +1,85 @@ +#!/bin/sh + +# This tests checks that the libjansson.so exports the correct +# symbols. + +# The list of symbols that the shared object should export +sort >$test_log/exports <$test_log/macros_or_inline <$test_log/output + +if ! cmp -s $test_log/exports $test_log/output; then + diff -u $test_log/exports $test_log/output >&2 + exit 1 +fi diff --git a/test/suites/api/run b/test/suites/api/run index 29d628a..fbee1da 100755 --- a/test/suites/api/run +++ b/test/suites/api/run @@ -6,11 +6,17 @@ # it under the terms of the MIT license. See LICENSE for details. is_test() { - test "${test_name%.c}" != "$test_name" + [ "${test_name%.c}" != "$test_name" ] && return 0 + [ -x $test_path -a ! -f $test_path.c ] && return 0 + return 1 } run_test() { - $suite_builddir/${test_name%.c} >$test_log/stdout 2>$test_log/stderr + if [ -x $test_path ]; then + test_log=$test_log $test_path >$test_log/stdout 2>$test_log/stderr + else + $suite_builddir/${test_name%.c} >$test_log/stdout 2>$test_log/stderr + fi } show_error() {