jansson/test/suites/encoding-flags/run
Joakim Söderberg b1b4f307d5 Add back the old ENV variabe approach to json_process.
Enable using the old envrionment variable passing of settings for json_process
so that the current autoconf test suite scripts can run nicely.

json_process now takes an optional command line parameter --env which
causes it to use the old method of reading the settings from
environment variables instead of directly from the "env" file.

Also added a --strip command line option, this will be used to
run the stripped tests with CMake as well.
2013-03-13 00:09:08 +01:00

33 lines
732 B
Bash
Executable File

#!/bin/sh
#
# Copyright (c) 2009-2012 Petri Lehtinen <petri@digip.org>
#
# 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 -d $test_path
}
run_test() {
(
if [ -f $test_path/env ]; then
. $test_path/env
fi
$json_process --env <$test_path/input >$test_log/stdout 2>$test_log/stderr
)
valgrind_check $test_log/stderr || return 1
cmp -s $test_path/output $test_log/stdout
}
show_error() {
valgrind_show_error && return
echo "EXPECTED OUTPUT:"
nl -bn $test_path/output
echo "ACTUAL OUTPUT:"
nl -bn $test_log/stdout
}
. $top_srcdir/test/scripts/run-tests.sh