6d2bc2f7459290726ae3e537118fa61e947695ef
[jansson.git] / test / suites / valid / 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     $json_process <$test_path/input >$test_log/stdout 2>$test_log/stderr
14     valgrind_check $test_log/stderr || return 1
15     cmp -s $test_path/output $test_log/stdout
16 }
17
18 show_error() {
19     valgrind_show_error && return
20
21     echo "EXPECTED OUTPUT:"
22     nl -bn $test_path/output
23     echo "ACTUAL OUTPUT:"
24     nl -bn $test_log/stdout
25 }
26
27 . $top_srcdir/test/scripts/run-tests.sh