From 69c6a41ffb878ef98c9378ed4b1634a404cfaa7f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 May 2024 02:53:35 +0200 Subject: Adding upstream version 2.7.6. Signed-off-by: Daniel Baumann --- tests/libzscanner/test_zscanner.in | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 tests/libzscanner/test_zscanner.in (limited to 'tests/libzscanner/test_zscanner.in') diff --git a/tests/libzscanner/test_zscanner.in b/tests/libzscanner/test_zscanner.in new file mode 100644 index 0000000..2c0c275 --- /dev/null +++ b/tests/libzscanner/test_zscanner.in @@ -0,0 +1,41 @@ +#!/bin/sh + +SOURCE=@top_srcdir@/tests/libzscanner +BUILD=@top_builddir@/tests/libzscanner + +. @top_srcdir@/tests/tap/libtap.sh + +cd "$BUILD" + +TMPDIR=$(test_tmpdir) +TESTS_DIR="$SOURCE"/data +ZSCANNER_TOOL="$BUILD"/zscanner-tool + +plan 80 + +mkdir -p "$TMPDIR"/includes/ +for a in 1 2 3 4 5 6; do + cat "$TESTS_DIR"/includes/include"$a" > "$TMPDIR"/includes/include"$a"; +done + +for case in $(cat "$SOURCE"/TESTS); do + casein=$(test_file_path data/"$case".in) + caseout=$(test_file_path data/"$case".out) + filein="$TMPDIR"/"$case".in + fileout="$TMPDIR"/"$case".out + + sed -e "s|@TMPDIR@|$TMPDIR|;" < "$casein" > "$filein" + + "$ZSCANNER_TOOL" -m 2 . "$filein" > "$fileout" + + if cmp -s "$fileout" "$caseout"; then + ok "$case: output matches" true + rm "$filein" + rm "$fileout" + else + ok "$case: output differs" false + diff -urNap "$caseout" "$fileout" | while read line; do diag "$line"; done + fi +done + +rm -rf "$TMPDIR"/includes/ -- cgit v1.2.3