From: Michael Jeanson Date: Fri, 29 Apr 2016 18:35:06 +0000 (-0400) Subject: Tests: Replace prove by autotools tap runner X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=3d5e959697b9a843734d0ec6a6177e3522fd7964;p=deliverable%2Fbabeltrace.git Tests: Replace prove by autotools tap runner 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 Signed-off-by: Jérémie Galarneau --- diff --git a/.gitignore b/.gitignore index acc44dd8a..7aa189698 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ .libs .deps *.bkp +*.trs ctf-lexer.c ctf-parser.c ctf-parser.h diff --git a/configure.ac b/configure.ac index dadb1c21f..acab953cc 100644 --- a/configure.ac +++ b/configure.ac @@ -18,6 +18,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 diff --git a/tests/Makefile.am b/tests/Makefile.am index 5927f59ef..77a167f3d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,34 +1,24 @@ 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 \ + lib/test_bt_values \ + lib/test_ctf_ir_ref \ + lib/test_bt_ctf_field_type_validation -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 index c6c50fd9c..000000000 --- a/tests/run.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 2013 - Christian Babeux -# -# 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 index 5b623cd67..000000000 --- a/tests/tests +++ /dev/null @@ -1,10 +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 -lib/test_bt_values -lib/test_ctf_ir_ref -lib/test_bt_ctf_field_type_validation \ No newline at end of file diff --git a/tests/tests_debuginfo b/tests/tests_debuginfo deleted file mode 100644 index 6158d8c6e..000000000 --- a/tests/tests_debuginfo +++ /dev/null @@ -1,2 +0,0 @@ -lib/test_dwarf_complete -lib/test_bin_info_complete \ No newline at end of file