X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tests%2Fcli%2Ftest_convert_args.in;h=123d1a49c58bdb5bb81d7aef971acae3ef29b799;hb=84095ea421eb6328926159d1f45bdb5ec56044e0;hp=3f38f0a4b87318a724453d956a0892e764b5bdf7;hpb=991bfa85be15dc19c17c71b4a02931d544a58c96;p=babeltrace.git diff --git a/tests/cli/test_convert_args.in b/tests/cli/test_convert_args.in index 3f38f0a4..123d1a49 100644 --- a/tests/cli/test_convert_args.in +++ b/tests/cli/test_convert_args.in @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash # # Copyright (C) - 2017 Philippe Proulx # @@ -15,11 +15,7 @@ # 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/../../cli/babeltrace" - -source $testdir/utils/tap/tap.sh +. "@abs_top_builddir@/tests/utils/common.sh" test_bt_convert_run_args() { local what="$1" @@ -27,14 +23,14 @@ test_bt_convert_run_args() { local expected_run_args="$3" # execute convert command - local run_args="$("$babeltrace_bin" convert --run-args $convert_args)" + local run_args="$("$BT_BIN" convert --run-args $convert_args)" # check result if [ "$test_head_comment" = 1 ]; then comment "convert args: $convert_args" fi - if [ "$run_args" == "$expected_run_args" ]; then + if [ "$run_args" = "$expected_run_args" ]; then pass "ARGS: $what" else fail "ARGS: $what" @@ -49,7 +45,7 @@ test_bt_convert_fails() { local convert_args="$2" # execute convert command - "$babeltrace_bin" convert --run-args $convert_args &> /dev/null + "$BT_BIN" convert --run-args $convert_args >/dev/null 2>&1 local status=$? @@ -58,7 +54,7 @@ test_bt_convert_fails() { comment "convert args: $convert_args" fi - if [ $status == 0 ]; then + if [ "$status" = 0 ]; then fail "SUCCEEDS (should fail): $what" diag "ARGS: $convert_args" else @@ -70,7 +66,7 @@ comment() { echo "### $1 ###" } -plan_tests 74 +plan_tests 75 test_bt_convert_run_args 'path leftover' '/path/to/trace' '--component source.ctf.fs --name source-ctf-fs --key path --value /path/to/trace --component sink.text.pretty --name pretty --component filter.utils.muxer --name muxer --component filter.lttng-utils.debug-info --name debug-info --connect source-ctf-fs:muxer --connect muxer:debug-info --connect debug-info:pretty' test_bt_convert_run_args 'path leftover + named user source with --params' '/path/to/trace --component ZZ:source.another.source --params salut=yes' '--component ZZ:source.another.source --params salut=yes --component source.ctf.fs --name source-ctf-fs --key path --value /path/to/trace --component sink.text.pretty --name pretty --component filter.utils.muxer --name muxer --component filter.lttng-utils.debug-info --name debug-info --connect ZZ:muxer --connect source-ctf-fs:muxer --connect muxer:debug-info --connect debug-info:pretty' @@ -147,3 +143,4 @@ test_bt_convert_fails 'implicit source.ctf.lttng-live without URL' '-i lttng-liv test_bt_convert_fails 'no source' '-o text' test_bt_convert_fails '-o ctf without --output' 'my-trace -o ctf' test_bt_convert_fails '-o ctf + --output with implicit sink.text.pretty' 'my-trace -o ctf --output /output/path --no-delta' +test_bt_convert_fails '--stream-intersection' '/path/to/trace --stream-intersection'