From 15553d19bf293941eb6476b92ad49617dd588aff Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 22 Aug 2013 13:48:36 -0400 Subject: [PATCH] make check VPATH build Copy scripts to builddir if VPATH build is detected. Signed-off-by: Mathieu Desnoyers --- tests/Makefile.am | 18 +++++++++++++++++- tests/bin/Makefile.am | 18 +++++++++++++++++- tests/lib/Makefile.am | 18 +++++++++++++++++- 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index a485e27c..8d84b16b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -2,7 +2,23 @@ SUBDIRS = utils bin lib EXTRA_DIST = ctf-traces/** tests -dist_noinst_SCRIPTS = run.sh +SCRIPT_LIST = run.sh + +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 check-am: ./run.sh tests diff --git a/tests/bin/Makefile.am b/tests/bin/Makefile.am index b50d5a8a..e46285fb 100644 --- a/tests/bin/Makefile.am +++ b/tests/bin/Makefile.am @@ -1 +1,17 @@ -dist_noinst_SCRIPTS = test_trace_read +SCRIPT_LIST = test_trace_read + +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/Makefile.am b/tests/lib/Makefile.am index 1d6a1925..763b7bc0 100644 --- a/tests/lib/Makefile.am +++ b/tests/lib/Makefile.am @@ -17,4 +17,20 @@ noinst_PROGRAMS = test_seek test_bitfield test_seek_SOURCES = test_seek.c test_bitfield_SOURCES = test_bitfield.c -dist_noinst_SCRIPTS = test_seek_big_trace test_seek_empty_packet +SCRIPT_LIST = test_seek_big_trace test_seek_empty_packet + +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 -- 2.34.1