Test fix: use portable path code in test_plugin
[babeltrace.git] / tests / cli / test_convert_args.in
index 3f38f0a4b87318a724453d956a0892e764b5bdf7..123d1a49c58bdb5bb81d7aef971acae3ef29b799 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/bash
 #
 # Copyright (C) - 2017 Philippe Proulx <pproulx@efficios.com>
 #
 # 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'
This page took 0.033547 seconds and 4 git commands to generate.