Fix: make check in out of tree build
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 3 Sep 2015 20:11:38 +0000 (16:11 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 4 Sep 2015 04:37:34 +0000 (00:37 -0400)
Use the elf data files from the source dir when running make check in an
out of tree builddir and add the data files to dist.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
.gitignore
tests/ust-elf/Makefile.am
tests/ust-elf/test_ust_elf [deleted file]
tests/ust-elf/test_ust_elf.in [new file with mode: 0755]

index b1f985b8503fa4057fecec74f8d72626363100b2..41966c5d964fdc09d30cbdbf835c2b1091f728f2 100644 (file)
@@ -50,6 +50,7 @@ tests/tracepoint/benchmark/tracepoint_benchmark
 tests/tracepoint/tracepoint_test
 tests/snprintf/prog
 tests/ust-elf/prog
+tests/ust-elf/test_ust_elf
 tests/benchmark/bench1
 tests/benchmark/bench2
 
index 3cb544235c0551b1eb982a6dc89df2191ec30652..368e427ea39e4f034b1ae109a0faf8f93023370b 100644 (file)
@@ -5,20 +5,10 @@ prog_SOURCES = prog.c
 prog_LDADD = $(top_builddir)/liblttng-ust/liblttng-ust.la \
        $(top_builddir)/tests/utils/libtap.a
 
-SCRIPT_LIST = test_ust_elf
+noinst_SCRIPTS = test_ust_elf
+CLEANFILES = $(noinst_SCRIPTS)
+EXTRA_DIST = test_ust_elf.in $(srcdir)/data/**
 
-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
+$(noinst_SCRIPTS): %: %.in
+       sed "s#@TOPSRCDIR@#$(top_srcdir)#g" < $< > $@
+       chmod +x $@
diff --git a/tests/ust-elf/test_ust_elf b/tests/ust-elf/test_ust_elf
deleted file mode 100755 (executable)
index cb7c7a9..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-TEST_DIR=$(dirname $0)
-./${TEST_DIR}/prog $TEST_DIR
diff --git a/tests/ust-elf/test_ust_elf.in b/tests/ust-elf/test_ust_elf.in
new file mode 100755 (executable)
index 0000000..5cfbff6
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+TEST_DIR=$(dirname $0)
+./${TEST_DIR}/prog $TEST_DIR/@TOPSRCDIR@/tests/ust-elf
This page took 0.027266 seconds and 5 git commands to generate.