diff mbox

babeltrace: add test for babeltrace --list

Message ID 1471540228-24555-1-git-send-email-nathan_lynch@mentor.com
State Accepted, archived
Headers show

Commit Message

Nathan Lynch Aug. 18, 2016, 5:10 p.m. UTC
This test simply checks the converter's list of supported formats.

Signed-off-by: Nathan Lynch <nathan_lynch at mentor.com>
---

Currently I expect this to fail for babeltrace configured with
--disable-shared; see https://bugs.lttng.org/issues/1055

 .gitignore                |  1 +
 configure.ac              |  1 +
 tests/Makefile.am         |  1 +
 tests/bin/Makefile.am     |  2 +-
 tests/bin/test_formats.in | 21 +++++++++++++++++++++
 5 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 tests/bin/test_formats.in

Comments

Nathan Lynch Sept. 13, 2016, 2:54 p.m. UTC | #1
On 08/18/2016 12:10 PM, Nathan Lynch wrote:
> This test simply checks the converter's list of supported formats.
> 
> Signed-off-by: Nathan Lynch <nathan_lynch at mentor.com>
> ---
> 
> Currently I expect this to fail for babeltrace configured with
> --disable-shared; see https://bugs.lttng.org/issues/1055


Thoughts on this patch?
Jérémie Galarneau Sept. 13, 2016, 5:47 p.m. UTC | #2
The patch looks good to me, but would you mind changing the header of
test_formats to the full GPL header + copyright mention, as is done
here:

https://raw.githubusercontent.com/efficios/babeltrace/master/tests/bin/intersection/test_intersection.in

I can perform the change myself, but I want to make sure it's okay.

Thanks!
Jérémie

On Tue, Sep 13, 2016 at 10:54 AM, Nathan Lynch <Nathan_Lynch at mentor.com> wrote:
> On 08/18/2016 12:10 PM, Nathan Lynch wrote:
>> This test simply checks the converter's list of supported formats.
>>
>> Signed-off-by: Nathan Lynch <nathan_lynch at mentor.com>
>> ---
>>
>> Currently I expect this to fail for babeltrace configured with
>> --disable-shared; see https://bugs.lttng.org/issues/1055
>
>
> Thoughts on this patch?
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Nathan Lynch Sept. 13, 2016, 5:55 p.m. UTC | #3
On 09/13/2016 12:47 PM, Jérémie Galarneau wrote:
> The patch looks good to me, but would you mind changing the header of
> test_formats to the full GPL header + copyright mention, as is done
> here:
> 
> https://raw.githubusercontent.com/efficios/babeltrace/master/tests/bin/intersection/test_intersection.in
> 
> I can perform the change myself, but I want to make sure it's okay.

It's fine with me, thanks.
Jérémie Galarneau Sept. 14, 2016, 6:04 p.m. UTC | #4
Merged, thanks!

Jérémie

On Tue, Sep 13, 2016 at 1:55 PM, Nathan Lynch <Nathan_Lynch at mentor.com> wrote:
> On 09/13/2016 12:47 PM, Jérémie Galarneau wrote:
>> The patch looks good to me, but would you mind changing the header of
>> test_formats to the full GPL header + copyright mention, as is done
>> here:
>>
>> https://raw.githubusercontent.com/efficios/babeltrace/master/tests/bin/intersection/test_intersection.in
>>
>> I can perform the change myself, but I want to make sure it's okay.
>
> It's fine with me, thanks.
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
diff mbox

Patch

diff --git a/.gitignore b/.gitignore
index c290479b1d88..d20c38e30238 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@ 
 /tests/bin/intersection/test_intersection
 /tests/bin/intersection/bt_python_helper.py
 /tests/bin/test_packet_seq_num
+/tests/bin/test_formats
 /tests/lib/test_bitfield
 /tests/lib/test_seek
 /tests/lib/test_ctf_writer
diff --git a/configure.ac b/configure.ac
index 39973296ba1d..a3c20d67a244 100644
--- a/configure.ac
+++ b/configure.ac
@@ -381,6 +381,7 @@  AC_CONFIG_FILES([tests/bin/test_trace_read], [chmod +x tests/bin/test_trace_read
 AC_CONFIG_FILES([tests/bin/intersection/test_intersection], [chmod +x tests/bin/intersection/test_intersection])
 AC_CONFIG_FILES([tests/bin/intersection/bt_python_helper.py])
 AC_CONFIG_FILES([tests/bin/test_packet_seq_num], [chmod +x tests/bin/test_packet_seq_num])
+AC_CONFIG_FILES([tests/bin/test_formats], [chmod +x tests/bin/test_formats])
 
 AC_OUTPUT
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a51531821dc0..eda9f2351310 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -7,6 +7,7 @@  LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
 TESTS = bin/test_trace_read \
 	bin/test_trace_read \
 	bin/test_packet_seq_num \
+	bin/test_formats \
 	bin/intersection/test_intersection \
 	lib/test_bitfield \
 	lib/test_seek_empty_packet \
diff --git a/tests/bin/Makefile.am b/tests/bin/Makefile.am
index 2d008ed460ec..57b90ea72d80 100644
--- a/tests/bin/Makefile.am
+++ b/tests/bin/Makefile.am
@@ -1,2 +1,2 @@ 
 SUBDIRS = intersection
-check_SCRIPTS = test_trace_read test_packet_seq_num
+check_SCRIPTS = test_trace_read test_packet_seq_num test_formats
diff --git a/tests/bin/test_formats.in b/tests/bin/test_formats.in
new file mode 100644
index 000000000000..5be96ba039f4
--- /dev/null
+++ b/tests/bin/test_formats.in
@@ -0,0 +1,21 @@ 
+#!/bin/bash
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License, version 2 only, as
+# published by the Free Software Foundation.
+
+CURDIR=$(dirname $0)
+TESTDIR=$CURDIR/..
+
+BABELTRACE_BIN=$CURDIR/../../converter/babeltrace
+
+source $TESTDIR/utils/tap/tap.sh
+
+expected_formats=(text lttng-live dummy ctf-metadata ctf)
+
+plan_tests ${#expected_formats[*]}
+
+for format in "${expected_formats[@]}"; do
+    "$BABELTRACE_BIN" --list | grep -qw "$format"
+    ok $? "Detect support for format \"$format\""
+done