Tests: Use AC_CONFIG_FILES to generate test scripts
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 14 Apr 2016 11:55:06 +0000 (07:55 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 3 May 2016 19:42:41 +0000 (15:42 -0400)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
configure.ac
tests/bin/Makefile.am
tests/bin/test_intersection.in
tests/bin/test_packet_seq_num.in
tests/bin/test_trace_read.in

index f760d4ece50e6d8f7398022919086d7bb769d4dc..fd74535e1490aa6416282d5946a91b7acc33fdb6 100644 (file)
@@ -295,6 +295,11 @@ AC_CONFIG_FILES([
        babeltrace.pc
        babeltrace-ctf.pc
 ])
+
 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/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])
+
 AC_OUTPUT
index 2bf94246a893e5c03e8283e422514a347eb94e44..ae9eba8002b008459bba3500d26ba7d081ab6783 100644 (file)
@@ -1,7 +1,2 @@
 noinst_SCRIPTS = test_trace_read test_intersection test_packet_seq_num
 CLEANFILES = $(noinst_SCRIPTS)
-EXTRA_DIST = test_trace_read.in test_intersection.in test_packet_seq_num.in
-
-$(noinst_SCRIPTS): %: %.in
-       sed "s#@ABSTOPSRCDIR@#$(abs_top_srcdir)#g" < $< > $@
-       chmod +x $@
index 28cb58a4614560b7790062c653448965996d6675..82eac235c630aa73951dabfa23c200bf7fee1420 100644 (file)
@@ -19,7 +19,7 @@ CURDIR=$(dirname $0)
 TESTDIR=$CURDIR/..
 
 BABELTRACE_BIN=$CURDIR/../../converter/babeltrace
-CTF_TRACES=@ABSTOPSRCDIR@/tests/ctf-traces
+CTF_TRACES=@abs_top_srcdir@/tests/ctf-traces
 
 source $TESTDIR/utils/tap/tap.sh
 
index 3348a4c7aa8ee5a68d660d1833fba39714e38bbd..e8e291cb4af84ada68fa4c2a3419129da0857fbe 100644 (file)
@@ -19,7 +19,7 @@ CURDIR=$(dirname $0)
 TESTDIR=$CURDIR/..
 
 BABELTRACE_BIN=$CURDIR/../../converter/babeltrace
-CTF_TRACES=@ABSTOPSRCDIR@/tests/ctf-traces
+CTF_TRACES=@abs_top_srcdir@/tests/ctf-traces
 
 source $TESTDIR/utils/tap/tap.sh
 
@@ -32,7 +32,7 @@ test_no_lost() {
 
        $BABELTRACE_BIN $trace >/dev/null 2>&1
        ok $? "Trace parses"
-       $BABELTRACE_BIN $trace 2>&1 >/dev/null | grep "\[warning\] Tracer lost"
+       $BABELTRACE_BIN $trace 2>&1 >/dev/null | @GREP@ "\[warning\] Tracer lost"
        if test $? = 0; then
                fail 1 "Should not find any lost events"
        else
@@ -51,9 +51,9 @@ test_lost() {
        # [warning] Tracer lost 2 trace packets between ....
        # [warning] Tracer lost 3 trace packets between ....
        # into "2,3" and make sure it matches the expected result
-       $BABELTRACE_BIN $trace 2>&1 >/dev/null | grep "\[warning\] Tracer lost" \
-               | cut -d" " -f4 | tr "\n" "," | sed "s/.$//" | \
-               grep "$expectedcountstr" >/dev/null
+       $BABELTRACE_BIN $trace 2>&1 >/dev/null | @GREP@ "\[warning\] Tracer lost" \
+               | cut -d" " -f4 | tr "\n" "," | @SED@ "s/.$//" | \
+               @GREP@ "$expectedcountstr" >/dev/null
        ok $? "Lost events string matches $expectedcountstr"
 
 }
index 761fd0560c3864c545ec62cf4611b9eeb8acd5bf..758e8ce9eaf1c1ebee6e2bf1a2730b2e8decdfef 100644 (file)
@@ -20,7 +20,7 @@ TESTDIR=$CURDIR/..
 
 BABELTRACE_BIN=$CURDIR/../../converter/babeltrace
 
-CTF_TRACES=@ABSTOPSRCDIR@/tests/ctf-traces
+CTF_TRACES=@abs_top_srcdir@/tests/ctf-traces
 
 source $TESTDIR/utils/tap/tap.sh
 
This page took 0.036995 seconds and 4 git commands to generate.