From 22173c1d8bba09e764ba847646941ef7a43451fc Mon Sep 17 00:00:00 2001 From: Petri Lehtinen Date: Mon, 21 Dec 2009 14:00:57 +0200 Subject: [PATCH] Add check-exports test --- test/suites/api/check-exports | 85 +++++++++++++++++++++++++++++++++++++++++++ test/suites/api/run | 10 ++++- 2 files changed, 93 insertions(+), 2 deletions(-) create mode 100755 test/suites/api/check-exports 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() { -- 2.1.4