babeltrace: add test for babeltrace --list
authorNathan Lynch <nathan_lynch@mentor.com>
Thu, 18 Aug 2016 17:10:28 +0000 (12:10 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 14 Sep 2016 18:04:02 +0000 (14:04 -0400)
This test simply checks the converter's list of supported formats.

Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
.gitignore
configure.ac
tests/Makefile.am
tests/bin/Makefile.am
tests/bin/test_formats.in [new file with mode: 0644]

index c290479b1d8834ffaac3be777dd520289a2bf15d..d20c38e30238f7a0e46d7f9133e191f0af0baf75 100644 (file)
@@ -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
index e600e252d9ce632f5628a1a06f12471af75f8e94..450e22491a67e64fc0b79db3749b5c560374dd12 100644 (file)
@@ -380,6 +380,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
 
index a51531821dc08a621bcbf3f1bd9ecd81acab6805..eda9f2351310e0b10886d6ee904eaea847973795 100644 (file)
@@ -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 \
index 2d008ed460ec243fc8dbb722f852c33fb5d828b5..57b90ea72d80431477131205151d2516417a533c 100644 (file)
@@ -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 (file)
index 0000000..81b924a
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/bash
+#
+# Copyright (C) - 2016 Nathan Lynch <nathan_lynch@mentor.com>
+#
+# 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.
+#
+# 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., 51
+# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+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
This page took 0.02797 seconds and 4 git commands to generate.