From f9692f1466df722e5fc4a35743b817614caa7fdb Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Wed, 12 Jul 2017 15:29:49 -0400 Subject: [PATCH] cli: do not allow --stream-intersection with --run-args/--run-args-0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Also test this in test_convert_args. Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- cli/babeltrace-cfg-cli-args.c | 5 +++++ tests/cli/test_convert_args.in | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cli/babeltrace-cfg-cli-args.c b/cli/babeltrace-cfg-cli-args.c index 95a807be..4fba2b16 100644 --- a/cli/babeltrace-cfg-cli-args.c +++ b/cli/babeltrace-cfg-cli-args.c @@ -4654,6 +4654,11 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[], * here. */ if (print_run_args || print_run_args_0) { + if (stream_intersection_mode) { + printf_err("Cannot specify --stream-intersection with --run-args or --run-args-0\n"); + goto error; + } + for (i = 0; i < bt_value_array_size(run_args); i++) { struct bt_value *arg_value = bt_value_array_get(run_args, i); diff --git a/tests/cli/test_convert_args.in b/tests/cli/test_convert_args.in index 3f38f0a4..875f10e6 100644 --- a/tests/cli/test_convert_args.in +++ b/tests/cli/test_convert_args.in @@ -70,7 +70,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 +147,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' -- 2.34.1