Commit 61456ddf authored by Ondřej Surý's avatar Ondřej Surý

Finish the migration to C TAP Harness by making make distcheck happy

parent 2bad0b77
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src samples doc man
EXTRA_DIST = resource.sh
include $(srcdir)/tests/Makefile.inc
......@@ -3,6 +3,9 @@ check_PROGRAMS = \
tests/runtests \
tests/zscanner-tool
dist_check_SCRIPTS = \
tests/zscanner
check_LIBRARIES = tests/tap/libtap.a
AM_CPPFLAGS = \
......@@ -31,3 +34,9 @@ tests_zscanner_tool_SOURCES = \
tests/processing.c
tests_zscanner_tool_LDADD = libzscanner.la @LIBOBJS@
EXTRA_DIST += \
tests/TESTS \
tests/zscanner-TESTS \
tests/data \
tests/tap/libtap.sh
......@@ -7,11 +7,11 @@ TMPDIR=$(test_tmpdir)
TESTS_DIR="$SOURCE"/data
ZSCANNER_TOOL="$BUILD"/zscanner-tool
plan_lazy
plan 65
mkdir "$TMPDIR"/includes/
mkdir -p "$TMPDIR"/includes/
for a in 1 2 3 4 5 6; do
cp -a "$TESTS_DIR"/includes/include"$a" "$TMPDIR"/includes/;
cat "$TESTS_DIR"/includes/include"$a" > "$TMPDIR"/includes/include"$a";
done
for case in $(cat "$SOURCE"/zscanner-TESTS); do
......@@ -21,21 +21,18 @@ for case in $(cat "$SOURCE"/zscanner-TESTS); do
fileout="$TMPDIR"/"$case".out
sed -e "s|@BUILD@|$BUILD|;s|@SOURCE@|$SOURCE|;" < "$casein" > "$filein"
diag $(ls "$filein")
"$ZSCANNER_TOOL" -m 2 . "$filein" > "$fileout"
ZSCANNER_RET=$?
if [ "$?" -ne 0 ]; then
ok "$case: zscanner-tool run" false
skip
fi
ok "$case: zscanner-tool" true
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/
......@@ -34,7 +34,7 @@ tests_runtests_CPPFLAGS = \
-DSOURCE='"$(abs_top_srcdir)/tests"' \
-DBUILD='"$(abs_top_builddir)/tests"'
tests_tap_libtap_a_CPPFLAGS = -I$(abs_top_srcdir)/t
tests_tap_libtap_a_CPPFLAGS = -I$(abs_top_srcdir)/tests
tests_tap_libtap_a_SOURCES = \
tests/tap/basic.c tests/tap/basic.h \
tests/tap/float.c tests/tap/float.h \
......@@ -48,20 +48,13 @@ LDADD = \
src/libknotd.la src/libknots.la \
@LIBOBJS@
EXTRA_DIST += \
tests/data/sample_conf
tests_conf_SOURCES = tests/conf.c tests/sample_conf.h
nodist_tests_conf_SOURCES = tests/sample_conf.c
CLEANFILES = tests/sample_conf.c
BUILT_SOURCES = \
tests/sample_conf.rc
EXTRA_DIST = tests/data tests/TESTS
CLEANFILES = \
tests/sample_conf.rc
dist_check_SCRIPTS = tests/resource.sh
tests_conf_SOURCES = \
tests/conf.c
nodist_tests_conf_SOURCES = \
tests/sample_conf.rc
tests/sample_conf.rc: tests/data/sample_conf
$(top_srcdir)/resource.sh $< >$@
tests/sample_conf.c: tests/data/sample_conf
$(abs_top_srcdir)/tests/resource.sh $< >$@
......@@ -21,7 +21,7 @@
#include "knot/conf/conf.h"
/* Resources. */
#include "sample_conf.rc"
#include "tests/sample_conf.h"
/*! Run all scheduled tests for given parameters.
*/
......
......@@ -23,8 +23,8 @@ size=$(wc -c "${1}" | awk '{print $1}' 2>/dev/null)
dump=$(${hd} "${fmt}" "${1}" 2>/dev/null)
# Format file size variable
echo "static const unsigned ${header}_size = ${size};"
echo "const unsigned ${header}_size = ${size};"
# Format file content dump
echo "static const char ${header}[] = { "
echo "const char ${header}[] = { "
echo "${dump}0x00 };"
extern const unsigned sample_conf_rc_size;
extern const char sample_conf_rc[];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment