From 05d31afb273ebce4128dbdb16caec75a14f6b620 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 28 Apr 2016 12:43:37 -0400 Subject: [PATCH] Fix: Make test_dwarf and test_bin_info tests work out-of-tree MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When building out of tree, these tests fail to find the test data. This patch makes them (their _complete wrappers, actually) generated by Autoconf, so the proper path to the test data (which is in the source directory) can be written. We can also get rid of SCRIPT_LIST and it's custom rules. Signed-off-by: Simon Marchi Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- configure.ac | 2 ++ tests/lib/Makefile.am | 18 +----------------- ...warf_complete => test_bin_info_complete.in} | 6 +++--- ...in_info_complete => test_dwarf_complete.in} | 6 +++--- 4 files changed, 9 insertions(+), 23 deletions(-) rename tests/lib/{test_dwarf_complete => test_bin_info_complete.in} (86%) rename tests/lib/{test_bin_info_complete => test_dwarf_complete.in} (87%) diff --git a/configure.ac b/configure.ac index ce8c2ef9..193504ac 100644 --- a/configure.ac +++ b/configure.ac @@ -306,6 +306,8 @@ AC_CONFIG_FILES([ AC_CONFIG_FILES([tests/lib/test_ctf_writer_complete], [chmod +x tests/lib/test_ctf_writer_complete]) AC_CONFIG_FILES([tests/lib/test_seek_big_trace], [chmod +x tests/lib/test_seek_big_trace]) AC_CONFIG_FILES([tests/lib/test_seek_empty_packet], [chmod +x tests/lib/test_seek_empty_packet]) +AC_CONFIG_FILES([tests/lib/test_dwarf_complete], [chmod +x tests/lib/test_dwarf_complete]) +AC_CONFIG_FILES([tests/lib/test_bin_info_complete], [chmod +x tests/lib/test_bin_info_complete]) AC_CONFIG_FILES([tests/bin/test_trace_read], [chmod +x tests/bin/test_trace_read]) AC_CONFIG_FILES([tests/bin/test_intersection], [chmod +x tests/bin/test_intersection]) diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am index f2a2f5a2..10fd9e73 100644 --- a/tests/lib/Makefile.am +++ b/tests/lib/Makefile.am @@ -44,21 +44,5 @@ test_bin_info_LDADD = $(LIBTAP) \ test_bin_info_SOURCES = test_bin_info.c noinst_PROGRAMS += test_dwarf test_bin_info -SCRIPT_LIST += test_dwarf_complete test_bin_info_complete +check_SCRIPTS += test_dwarf_complete test_bin_info_complete endif - -dist_noinst_SCRIPTS = $(SCRIPT_LIST) - -all-local: - @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ - for script in $(SCRIPT_LIST); do \ - cp -f $(srcdir)/$$script $(builddir); \ - done; \ - fi - -clean-local: - @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ - for script in $(SCRIPT_LIST); do \ - rm -f $(builddir)/$$script; \ - done; \ - fi diff --git a/tests/lib/test_dwarf_complete b/tests/lib/test_bin_info_complete.in similarity index 86% rename from tests/lib/test_dwarf_complete rename to tests/lib/test_bin_info_complete.in index c6330160..80c1e90c 100755 --- a/tests/lib/test_dwarf_complete +++ b/tests/lib/test_bin_info_complete.in @@ -16,7 +16,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -CURDIR=$(dirname $0)/ -ROOTDIR=$CURDIR../.. -$CURDIR/test_dwarf $ROOTDIR/tests/debuginfo-data +DEBUGINFO_DATA=@abs_top_srcdir@/tests/debuginfo-data + +@abs_top_builddir@/tests/lib/test_bin_info $DEBUGINFO_DATA diff --git a/tests/lib/test_bin_info_complete b/tests/lib/test_dwarf_complete.in similarity index 87% rename from tests/lib/test_bin_info_complete rename to tests/lib/test_dwarf_complete.in index 0f930109..bca5a853 100755 --- a/tests/lib/test_bin_info_complete +++ b/tests/lib/test_dwarf_complete.in @@ -16,7 +16,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -CURDIR=$(dirname $0)/ -ROOTDIR=$CURDIR../.. -$CURDIR/test_bin_info $ROOTDIR/tests/debuginfo-data +DEBUGINFO_DATA=@abs_top_srcdir@/tests/debuginfo-data + +@abs_top_builddir@/tests/lib/test_dwarf $DEBUGINFO_DATA -- 2.34.1