tests: fix shellcheck warnings in cli/convert/test_convert_args
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 25 Feb 2020 20:05:21 +0000 (15:05 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 26 Feb 2020 14:10:00 +0000 (09:10 -0500)
commiteb70e47f62f88dc76cae72977f8b2b851e2ec4dd
tree176dffdae17981e293eebcf352669d3bd1658745
parentdeaa6b1f0f6f06eea2dce4ca72a1d3508a977f0b
tests: fix shellcheck warnings in cli/convert/test_convert_args

Fix:

    In test_convert_args line 98:
    test_bt_convert_run_args 'path non-option arg + user source named `auto-disc-source-ctf-fs`' "--component auto-disc-source-ctf-fs:source.salut.com $path_to_trace" "--component auto-disc-source-ctf-fs:source.salut.com --component auto-disc-source-ctf-fs-0:source.ctf.fs --params 'inputs=[\"$path_to_trace\"]' --component pretty:sink.text.pretty --component muxer:filter.utils.muxer --connect auto-disc-source-ctf-fs:muxer --connect auto-disc-source-ctf-fs-0:muxer --connect muxer:pretty"
                             ^-- SC2016: Expressions don't expand in single quotes, use double quotes for that.

    In test_convert_args line 99:
    test_bt_convert_run_args 'path non-option arg + user sink named `pretty`' "--component pretty:sink.my.sink $path_to_trace" "--component pretty:sink.my.sink --component auto-disc-source-ctf-fs:source.ctf.fs --params 'inputs=[\"$path_to_trace\"]' --component muxer:filter.utils.muxer --connect auto-disc-source-ctf-fs:muxer --connect muxer:pretty"
                             ^-- SC2016: Expressions don't expand in single quotes, use double quotes for that.

    In test_convert_args line 100:
    test_bt_convert_run_args 'path non-option arg + user filter named `muxer`' "--component muxer:filter.salut.com $path_to_trace" "--component muxer:filter.salut.com --component auto-disc-source-ctf-fs:source.ctf.fs --params 'inputs=[\"$path_to_trace\"]' --component pretty:sink.text.pretty --component muxer-0:filter.utils.muxer --connect auto-disc-source-ctf-fs:muxer-0 --connect muxer-0:muxer --connect muxer:pretty"
                             ^-- SC2016: Expressions don't expand in single quotes, use double quotes for that.

    In test_convert_args line 101:
    test_bt_convert_run_args 'path non-option arg + --begin + user filter named `trimmer`' "$path_to_trace --component trimmer:filter.salut.com --begin=abc" "--component trimmer:filter.salut.com --component auto-disc-source-ctf-fs:source.ctf.fs --params 'inputs=[\"$path_to_trace\"]' --component pretty:sink.text.pretty --component muxer:filter.utils.muxer --component trimmer-0:filter.utils.trimmer --params 'begin=\"abc\"' --connect auto-disc-source-ctf-fs:muxer --connect muxer:trimmer-0 --connect trimmer-0:trimmer --connect trimmer:pretty"
                             ^-- SC2016: Expressions don't expand in single quotes, use double quotes for that.

Because we have backticks in single quotes, like:

  'hello `you`'

shellcheck thinks that we want to execute the command "you".  So it
warns us that this is not going to happen, given that it is between
single quotes.  This is fine though, as we actually want a string with
backticks in it.

Circumvent it by using double quotes, but escaping the backticks.

Change-Id: Iead2f7842463167969d52f9324b3954896b87686
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reported-by: shellcheck
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3144
Tested-by: jenkins <jenkins@lttng.org>
tests/cli/convert/test_convert_args
This page took 0.025097 seconds and 4 git commands to generate.