From: Jonathan Rajotte Date: Mon, 8 Jul 2019 19:47:21 +0000 (-0400) Subject: fix: test_trimmer on macOs and Solaris X-Git-Url: https://git.efficios.com/?a=commitdiff_plain;h=bfb5625df591dcd384f50af3a93c5904ea6b7fcd;p=babeltrace.git fix: test_trimmer on macOs and Solaris The 'wc' tool on BSD based system adds leading spaces to it's output, which breaks the quoted compare. Use bash parameter expansion to trim all spaces from the 'num_events' variable. Signed-off-by: Jonathan Rajotte Change-Id: I884f59cf1fcdcb33419dd02c69886715ce4db71b Reviewed-on: https://review.lttng.org/c/babeltrace/+/1654 Tested-by: jenkins Reviewed-by: Philippe Proulx Reviewed-by: Michael Jeanson --- diff --git a/tests/cli/test_trimmer b/tests/cli/test_trimmer index a3246b2c..9ef8980c 100755 --- a/tests/cli/test_trimmer +++ b/tests/cli/test_trimmer @@ -80,7 +80,8 @@ function expect_failure() isnt $? 0 "trimmer: ${msg}: exit status" num_events=$(wc -l < "${tmp_out}") - is "${num_events}" 0 "trimmer: ${msg}: number of events (0)" + # Use bash parameter expansion to strip spaces added by BSD 'wc' on macOs and Solaris + is "${num_events// /}" 0 "trimmer: ${msg}: number of events (0)" stderr="$(cat "${tmp_err}")" # "like" doesn't like when the passed text is empty.