Tests: Replace prove by autotools tap runner
authorMichael Jeanson <mjeanson@efficios.com>
Fri, 29 Apr 2016 18:35:06 +0000 (14:35 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 3 May 2016 19:42:42 +0000 (15:42 -0400)
This patch removes the dependency on the prove perl script
to run the TAP test suite. It replaces it with the autotools
shell TAP driver that only requires a shell and awk.

Custom arguments can be passed to the test runner with
env variables as follow:

  env LOG_DRIVER_FLAGS='--comments --ignore-exit' \
      TESTS='foo.test baz.test' make -e check

This tap driver also creates a log file for each test that
can then be used by another system to build a test report.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
.gitignore
configure.ac
tests/Makefile.am
tests/run.sh [deleted file]
tests/tests [deleted file]
tests/tests_debuginfo [deleted file]

index 177307d18822b8da7fe1293e79232b1087cb05c9..3bb772bef28276887c8f974175ca0cb83b2bec75 100644 (file)
@@ -17,6 +17,7 @@
 .libs
 .deps
 *.bkp
+*.trs
 ctf-lexer.c
 ctf-parser.c
 ctf-parser.h
index 193504ac6510fdc14c90a271b4c98f4ffb317d00..d2245d1af3adffdde1362b6fac665f2075db7c9b 100644 (file)
@@ -15,6 +15,8 @@ AM_MAINTAINER_MODE([enable])
 # Enable silent rules if available (Introduced in AM 1.11)
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
+AC_REQUIRE_AUX_FILE([tap-driver.sh])
+
 # Checks for C compiler
 AC_USE_SYSTEM_EXTENSIONS
 AC_SYS_LARGEFILE
index 5927f59eff6a2edee32871a901277661ea9c2f10..5ad2cc59ef8fc84b92076bae48295317084300bb 100644 (file)
@@ -1,34 +1,21 @@
 SUBDIRS = utils bin lib
 
-EXTRA_DIST = $(srcdir)/ctf-traces/** tests
-if ENABLE_DEBUGINFO
-EXTRA_DIST += $(srcdir)/debuginfo-data/** tests_debuginfo
-endif
-
-SCRIPT_LIST = run.sh
-
-dist_noinst_SCRIPTS = $(SCRIPT_LIST)
+LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
+       $(top_srcdir)/config/tap-driver.sh
 
-all-local:
-       @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
-               for script in $(SCRIPT_LIST); do \
-                       cp -f $(srcdir)/$$script $(builddir); \
-               done; \
-       fi
+TESTS = bin/test_trace_read \
+       bin/test_trace_read \
+       bin/test_packet_seq_num \
+       bin/test_intersection \
+       lib/test_bitfield \
+       lib/test_seek_empty_packet \
+       lib/test_seek_big_trace \
+       lib/test_ctf_writer_complete
 
-clean-local:
-       @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
-               for script in $(SCRIPT_LIST); do \
-                       rm -f $(builddir)/$$script; \
-               done; \
-       fi
+EXTRA_DIST = $(srcdir)/ctf-traces/** \
+            $(srcdir)/debuginfo-data/**
 
-TEMPLIST := $(shell mktemp -u)
-check-am:
-       @cat $(srcdir)/tests > $(TEMPLIST)
 if ENABLE_DEBUGINFO
-       @echo '' >> $(TEMPLIST)
-       @cat $(srcdir)/tests_debuginfo >> $(TEMPLIST)
+TESTS += lib/test_dwarf_complete \
+       lib/test_bin_info_complete
 endif
-       ./run.sh $(TEMPLIST)
-       rm $(TEMPLIST)
diff --git a/tests/run.sh b/tests/run.sh
deleted file mode 100755 (executable)
index c6c50fd..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2013 - Christian Babeux <christian.babeux@efficios.com>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; only version 2
-# of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-#
-
-[ -z "$1" ] && echo "Error: No testlist. Please specify a testlist to run." && exit 1
-
-prove --merge --exec '' - < $1
diff --git a/tests/tests b/tests/tests
deleted file mode 100644 (file)
index 6e028df..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-bin/test_trace_read
-bin/test_packet_seq_num
-bin/test_intersection
-lib/test_bitfield
-lib/test_seek_empty_packet
-lib/test_seek_big_trace
-lib/test_ctf_writer_complete
\ No newline at end of file
diff --git a/tests/tests_debuginfo b/tests/tests_debuginfo
deleted file mode 100644 (file)
index df87fc1..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-lib/test_dwarf_complete
-lib/test_bin_info_complete
This page took 0.038538 seconds and 4 git commands to generate.