Implement JSON_SORT_KEYS encoding flag
[jansson.git] / test / suites / encoding-flags / run
1 #!/bin/sh
2 #
3 # Copyright (c) 2009 Petri Lehtinen <petri@digip.org>
4 #
5 # Jansson is free software; you can redistribute it and/or modify
6 # it under the terms of the MIT license. See LICENSE for details.
7
8 is_test() {
9     test -d $test_path
10 }
11
12 run_test() {
13     (
14         if [ -f $test_path/env ]; then
15             . $test_path/env
16         fi
17         $json_process <$test_path/input >$test_log/stdout 2>$test_log/stderr
18     )
19     valgrind_check $test_log/stderr || return 1
20     cmp -s $test_path/output $test_log/stdout
21 }
22
23 show_error() {
24     valgrind_show_error && return
25
26     echo "EXPECTED OUTPUT:"
27     nl -bn $test_path/output
28     echo "ACTUAL OUTPUT:"
29     nl -bn $test_log/stdout
30 }
31
32 . $top_srcdir/test/scripts/run-tests.sh