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: Michael Jeanson <mjeanson@efficios.com>
Change-Id: I15aef8c6987e40bcb018f32c7c094eabbc3d83c3
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1476
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
"${BT_BIN}" "${TRACE_PATH}" "$@" 2>/dev/null > "${tmp_out}"
ok $? "trimmer: ${msg}: exit status"
num_events=$(wc -l < "${tmp_out}")
- is "${num_events}" "${expected_num_events}" "trimmer: ${msg}: number of events (${expected_num_events})"
+ # Use bash parameter expansion to strip spaces added by BSD 'wc' on macOs and Solaris
+ is "${num_events// /}" "${expected_num_events}" "trimmer: ${msg}: number of events (${expected_num_events})"
}
expect_success 18 "--begin, GMT relative timestamps" \