aboutsummaryrefslogtreecommitdiff
path: root/test/suites/valid/run
blob: 6d2bc2f7459290726ae3e537118fa61e947695ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
#
# Copyright (c) 2009 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() {
    $json_process <$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