Fix: Make test_dwarf and test_bin_info tests work out-of-tree
authorSimon Marchi <simon.marchi@polymtl.ca>
Thu, 28 Apr 2016 16:43:37 +0000 (12:43 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 29 Apr 2016 18:59:13 +0000 (14:59 -0400)
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 <simon.marchi@polymtl.ca>
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
configure.ac
tests/lib/Makefile.am
tests/lib/test_bin_info_complete [deleted file]
tests/lib/test_bin_info_complete.in [new file with mode: 0755]
tests/lib/test_dwarf_complete [deleted file]
tests/lib/test_dwarf_complete.in [new file with mode: 0755]

index f11b0b4f209a650f85adfc16b3e5bc7312795e3b..dadb1c21f712baddd42448472437fe1a201b775c 100644 (file)
@@ -352,6 +352,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])
index 6e620c20b27c05ba67052eec7ffd830df4913292..c9c27d0718906118ef5b5603a3e642c86fa41589 100644 (file)
@@ -59,21 +59,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_bin_info_complete b/tests/lib/test_bin_info_complete
deleted file mode 100755 (executable)
index 0f93010..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2015 - Antoine Busque <abusque@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.
-#
-CURDIR=$(dirname $0)/
-ROOTDIR=$CURDIR../..
-
-$CURDIR/test_bin_info $ROOTDIR/tests/debuginfo-data
diff --git a/tests/lib/test_bin_info_complete.in b/tests/lib/test_bin_info_complete.in
new file mode 100755 (executable)
index 0000000..80c1e90
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# Copyright (C) 2015 - Antoine Busque <abusque@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.
+#
+
+DEBUGINFO_DATA=@abs_top_srcdir@/tests/debuginfo-data
+
+@abs_top_builddir@/tests/lib/test_bin_info $DEBUGINFO_DATA
diff --git a/tests/lib/test_dwarf_complete b/tests/lib/test_dwarf_complete
deleted file mode 100755 (executable)
index c633016..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2015 - Antoine Busque <abusque@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.
-#
-CURDIR=$(dirname $0)/
-ROOTDIR=$CURDIR../..
-
-$CURDIR/test_dwarf $ROOTDIR/tests/debuginfo-data
diff --git a/tests/lib/test_dwarf_complete.in b/tests/lib/test_dwarf_complete.in
new file mode 100755 (executable)
index 0000000..bca5a85
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# Copyright (C) 2015 - Antoine Busque <abusque@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.
+#
+
+DEBUGINFO_DATA=@abs_top_srcdir@/tests/debuginfo-data
+
+@abs_top_builddir@/tests/lib/test_dwarf $DEBUGINFO_DATA
This page took 0.028004 seconds and 4 git commands to generate.