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.
This commit is contained in:
@@ -14,7 +14,7 @@ run_test() {
|
||||
if [ -f $test_path/env ]; then
|
||||
. $test_path/env
|
||||
fi
|
||||
$json_process <$test_path/input >$test_log/stdout 2>$test_log/stderr
|
||||
$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
|
||||
|
||||
@@ -10,7 +10,7 @@ is_test() {
|
||||
}
|
||||
|
||||
run_test() {
|
||||
$json_process <$test_path/input >$test_log/stdout 2>$test_log/stderr
|
||||
$json_process --env <$test_path/input >$test_log/stdout 2>$test_log/stderr
|
||||
valgrind_check $test_log/stderr || return 1
|
||||
cmp -s $test_path/error $test_log/stderr
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ do_run() {
|
||||
strip=1
|
||||
fi
|
||||
|
||||
STRIP=$strip $json_process \
|
||||
STRIP=$strip $json_process --env \
|
||||
<$test_path/input >$test_log/stdout$s 2>$test_log/stderr$s
|
||||
valgrind_check $test_log/stderr$s || return 1
|
||||
|
||||
|
||||
1
test/suites/valid/complex-array/env
Normal file
1
test/suites/valid/complex-array/env
Normal file
@@ -0,0 +1 @@
|
||||
JSON_SORT_KEYS=1
|
||||
@@ -19,7 +19,7 @@ do_run() {
|
||||
strip=0
|
||||
[ "$variant" = "strip" ] && strip=1
|
||||
|
||||
STRIP=$strip $json_process \
|
||||
STRIP=$strip $json_process --env \
|
||||
<$test_path/input >$test_log/stdout$s 2>$test_log/stderr$s
|
||||
valgrind_check $test_log/stderr$s || return 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user