X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tests%2Fcli%2Ftest_trimmer;h=d6155785cd467b96d41b22e6d64574d876088da3;hb=2f137223b8772e0d64a022f923542c2f04197389;hp=a3246b2cbeb5436e975ce480e01f2e7ea77c5943;hpb=d4d7ffc9b2ac45125334268754c11c4a57c7de66;p=babeltrace.git diff --git a/tests/cli/test_trimmer b/tests/cli/test_trimmer index a3246b2c..d6155785 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. @@ -115,7 +116,18 @@ expect_success 0 "--begin, out of range, GMT absolute timestamps" \ expect_success 0 "--begin, out of range, GMT absolute timestamps" \ --clock-gmt --end "2012-10-29 16:48:17.588680018" -export TZ=EST +# Note here that the POSIX notation is a bit weird. +# The libc documentation shed some light on this: +# The offset specifies the time value you must add to the local time to get a +# Coordinated Universal Time value. It has syntax like [+|-]hh[:mm[:ss]]. This +# is positive if the local time zone is west of the Prime Meridian and negative +# if it is east. The hour must be between 0 and 24, and the minute and seconds +# between 0 and 59. [1] +# +# This is why we use EST5 to simulate an effective UTC-5:00 time. +# +# [1] https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html +export TZ=EST5 expect_success 18 "--begin, EST relative timestamps" \ --begin "12:48:17.587029529"