From: simon.marchi@polymtl.ca (Simon Marchi)
Subject: [lttng-dev] [PATCH 3/3] tests/lib: Make test_dwarf and test_bin_info tests work out-of-tree
Date: Wed, 27 Apr 2016 22:52:20 -0400 [thread overview]
Message-ID: <1461811940-8336-3-git-send-email-simon.marchi@polymtl.ca> (raw)
In-Reply-To: <1461811940-8336-1-git-send-email-simon.marchi@polymtl.ca>
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.
Signed-off-by: Simon Marchi <simon.marchi at polymtl.ca>
---
configure.ac | 2 ++
tests/lib/Makefile.am | 11 ++++++++---
tests/lib/test_bin_info_complete | 22 ----------------------
tests/lib/test_bin_info_complete.in | 22 ++++++++++++++++++++++
tests/lib/test_dwarf_complete | 22 ----------------------
tests/lib/test_dwarf_complete.in | 21 +++++++++++++++++++++
6 files changed, 53 insertions(+), 47 deletions(-)
delete mode 100755 tests/lib/test_bin_info_complete
create mode 100755 tests/lib/test_bin_info_complete.in
delete mode 100755 tests/lib/test_dwarf_complete
create mode 100755 tests/lib/test_dwarf_complete.in
diff --git a/configure.ac b/configure.ac
index 4578fc0..baeb4a6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -353,6 +353,8 @@ AC_CONFIG_FILES([
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])
AC_CONFIG_FILES([tests/bin/test_packet_seq_num], [chmod +x tests/bin/test_packet_seq_num])
diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am
index b39bd34..c0088a0 100644
--- a/tests/lib/Makefile.am
+++ b/tests/lib/Makefile.am
@@ -42,8 +42,14 @@ test_ctf_ir_ref_SOURCES = test_ctf_ir_ref.c
test_bt_ctf_field_type_validation_SOURCES = test_bt_ctf_field_type_validation.c
SCRIPT_LIST = test_ctf_writer_complete
-EXTRA_DIST = test_seek_big_trace.in test_seek_empty_packet.in
-DISTCLEANFILES = test_seek_big_trace test_seek_empty_packet
+EXTRA_DIST = test_seek_big_trace.in \
+ test_seek_empty_packet.in \
+ test_dwarf_complete.in \
+ test_bin_info_complete.in
+DISTCLEANFILES = test_seek_big_trace \
+ test_seek_empty_packet \
+ test_dwarf_complete \
+ test_bin_info_complete
if ENABLE_DEBUGINFO
test_dwarf_LDFLAGS = -static
@@ -59,7 +65,6 @@ 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
endif
dist_noinst_SCRIPTS = $(SCRIPT_LIST)
diff --git a/tests/lib/test_bin_info_complete b/tests/lib/test_bin_info_complete
deleted file mode 100755
index 0f93010..0000000
--- a/tests/lib/test_bin_info_complete
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2015 - Antoine Busque <abusque at 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
index 0000000..80c1e90
--- /dev/null
+++ b/tests/lib/test_bin_info_complete.in
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# Copyright (C) 2015 - Antoine Busque <abusque at 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
+
+ at 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
index c633016..0000000
--- a/tests/lib/test_dwarf_complete
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2015 - Antoine Busque <abusque at 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
index 0000000..07d1677
--- /dev/null
+++ b/tests/lib/test_dwarf_complete.in
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+# Copyright (C) 2015 - Antoine Busque <abusque at 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
+
+ at abs_top_builddir@/tests/lib/test_dwarf $DEBUGINFO_DATA
--
2.8.0
next prev parent reply other threads:[~2016-04-28 2:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-28 2:52 [lttng-dev] [PATCH 1/3] tests/lib/Makefile.am: Remove test_seek_empty_packet and test_seek_big_trace from SCRIPT_LIST Simon Marchi
2016-04-28 2:52 ` [lttng-dev] [PATCH 2/3] tests/lib/Makefile.am: use DISTCLEANFILES instead of CLEANFILES Simon Marchi
2016-04-28 2:52 ` Simon Marchi [this message]
2016-04-28 3:04 ` [lttng-dev] [PATCH 1/3] tests/lib/Makefile.am: Remove test_seek_empty_packet and test_seek_big_trace from SCRIPT_LIST Simon Marchi
2016-04-28 16:16 ` Michael Jeanson
2016-04-28 16:44 ` Simon Marchi
2016-04-28 17:53 ` Jérémie Galarneau
2016-04-28 18:28 ` Michael Jeanson
2016-04-28 18:36 ` Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1461811940-8336-3-git-send-email-simon.marchi@polymtl.ca \
--to=simon.marchi@polymtl.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox