From: Jérémie Galarneau Date: Mon, 25 Mar 2013 21:48:15 +0000 (-0400) Subject: Tests: Use Perl prove as the testsuite runner X-Git-Tag: v2.2.0-rc1~13 X-Git-Url: https://git.lttng.org/?p=lttng-ust.git;a=commitdiff_plain;h=7fedf800365965f64b6d81e08f9863067702306f Tests: Use Perl prove as the testsuite runner Inspired by the test strategy deployed in lttng-tools. Signed-off-by: Jérémie Galarneau --- diff --git a/README b/README index 390a719b..84cc6913 100644 --- a/README +++ b/README @@ -34,6 +34,8 @@ compile the git repository tree : (make sure your system wide "automake" points to a recent version!) - GNU Libtool >=2.2 (for more information, go to http://www.gnu.org/software/autoconf/) +- Perl (optional) + Needed for make check and tests. If you get the tree from the repository, you will need to use the "bootstrap" script in the root of the tree. It calls all the GNU tools needed to prepare the diff --git a/tests/Makefile.am b/tests/Makefile.am index 21ba285b..6f9b969c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -8,6 +8,7 @@ dist_noinst_SCRIPTS = test_loop runtests trace_matches noinst_LIBRARIES = libtap.a -libtap_a_SOURCES = \ - tap.c \ - tap.h +libtap_a_SOURCES = tap.c tap.h + +check-am: + ./run.sh unit_tests diff --git a/tests/run.sh b/tests/run.sh new file mode 100755 index 00000000..c6c50fd9 --- /dev/null +++ b/tests/run.sh @@ -0,0 +1,22 @@ +#!/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/snprintf/Makefile.am b/tests/snprintf/Makefile.am index 9ca4f09a..d9f9da08 100644 --- a/tests/snprintf/Makefile.am +++ b/tests/snprintf/Makefile.am @@ -5,5 +5,5 @@ prog_SOURCES = prog.c prog_LDADD = $(top_builddir)/snprintf/libustsnprintf.la \ $(top_builddir)/tests/libtap.a -noinst_SCRIPT = run -EXTRA_DIST = run +noinst_SCRIPT = test_snprintf +EXTRA_DIST = test_snprintf diff --git a/tests/snprintf/run b/tests/snprintf/run deleted file mode 100755 index cc77d408..00000000 --- a/tests/snprintf/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -TEST_DIR=$(dirname $0) -./${TEST_DIR}/prog diff --git a/tests/snprintf/test_snprintf b/tests/snprintf/test_snprintf new file mode 100755 index 00000000..cc77d408 --- /dev/null +++ b/tests/snprintf/test_snprintf @@ -0,0 +1,4 @@ +#!/bin/bash + +TEST_DIR=$(dirname $0) +./${TEST_DIR}/prog diff --git a/tests/unit_tests b/tests/unit_tests new file mode 100644 index 00000000..91101383 --- /dev/null +++ b/tests/unit_tests @@ -0,0 +1 @@ +snprintf/test_snprintf