diff options
author | Will Drewry <wad@chromium.org> | 2014-09-18 16:16:56 -0500 |
---|---|---|
committer | Will Drewry <wad@chromium.org> | 2014-09-18 16:22:11 -0500 |
commit | 47313d1f1ae3749f69ad0344e8125f1d61f6faed (patch) | |
tree | 47e3b47b360c9a378729ed336cdeb5a2090cba54 /run-tests | |
parent | 9c331bf201909fb5a85725202eee872d4323e12d (diff) | |
download | tlsdate-47313d1f1ae3749f69ad0344e8125f1d61f6faed.tar.gz |
continued merge overhaul
- Integration tests now all run properly
- Added 'emit' helper for integration tests
- Cleaned up accidental closure of stdin if hwclock isn't being sync'd
- Cleaned up verb_debug to just use logat cleanly
- Updated man page for -U (dbus disable) and -b (verbose_debug)
- Pushed in placeholders for some unittests that need to be added.
Diffstat (limited to 'run-tests')
-rwxr-xr-x | run-tests | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -1,27 +1,35 @@ #!/bin/sh run_test() { + # Clear the last results + rm -f "$1"/result [ -x "$1"/setup ] && "$1"/setup if [ -r "$1"/tlsdated-flags ]; then flags=$(cat "$1"/tlsdated-flags | sed "s/@TESTDIR@/$1/g") elif [ -r "$1"/test.conf ]; then - flags="-U -w -p -r -l -s -f $1/test.conf -v" + flags="-U -w -p -r -l -s -b -f $1/test.conf -v" else - flags="-U -w -p -r -l -s -f test.conf -v" + flags="-U -w -p -r -l -s -b -f test.conf -v" fi # flags are deliberately unquoted here so that they'll be interpolated - timeout 5 src/tlsdated $flags -- "$1"/subproc.sh <"$1"/input >"$1"/run-output \ - 2>"$1"/run-err + (test -x "$1"/input.sh && "$1"/input.sh) | + timeout 8 src/tlsdated $flags -- "$1"/subproc.sh \ + >"$1"/run-output 2>"$1"/run-err [ -x "$1"/teardown ] && "$1"/teardown } test_passed() { - diff "$t"/output "$t"/run-output >/dev/null + f="$t"/result + test -f "$f" && grep -q ok "$f" } total=0 passed=0 +if ! test -x src/test/emit; then + echo "Make sure src/test/emit has been built (make check)!" + exit 1 +fi for t in tests/*; do [ ! -d "$t" ] && continue name="$(basename "$t")" |