X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;f=tests%2Fcli%2Ftest_trimmer;h=4b415b475a98f01187daea52d247bf6cac99212b;hb=75e396f6b20bdf52c76a3c7312e7fb815ac1e5e9;hp=9ef8980c812dd075c1b31778da22f0ebf8990989;hpb=bfb5625df591dcd384f50af3a93c5904ea6b7fcd;p=babeltrace.git diff --git a/tests/cli/test_trimmer b/tests/cli/test_trimmer index 9ef8980c..4b415b47 100755 --- a/tests/cli/test_trimmer +++ b/tests/cli/test_trimmer @@ -1,23 +1,13 @@ #!/bin/bash # -# Copyright (C) 2017 Julien Desfossez -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License, version 2 only, as -# published by the Free Software Foundation. +# SPDX-License-Identifier: GPL-2.0-only # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. +# Copyright (C) 2017 Julien Desfossez # -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. SH_TAP=1 -if [ "x${BT_TESTS_SRCDIR:-}" != "x" ]; then +if [ -n "${BT_TESTS_SRCDIR:-}" ]; then UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh" else UTILSSH="$(dirname "$0")/../utils/utils.sh" @@ -51,7 +41,7 @@ function expect_success() local msg="$2" shift 2 - "${BT_TESTS_BT2_BIN}" "${TRACE_PATH}" "$@" 2>/dev/null > "${tmp_out}" + bt_cli "${tmp_out}" /dev/null "${TRACE_PATH}" "$@" ok $? "trimmer: ${msg}: exit status" num_events=$(wc -l < "${tmp_out}") @@ -76,7 +66,7 @@ function expect_failure() # We check the error message logged by the trimmer plugin, set the env # var necessary for it to log errors. - BABELTRACE_FLT_UTILS_TRIMMER_LOG_LEVEL=E "${BT_TESTS_BT2_BIN}" "${TRACE_PATH}" "$@" 2> "${tmp_err}" > "${tmp_out}" + BABELTRACE_FLT_UTILS_TRIMMER_LOG_LEVEL=E bt_cli "${tmp_out}" "${tmp_err}" "${TRACE_PATH}" "$@" isnt $? 0 "trimmer: ${msg}: exit status" num_events=$(wc -l < "${tmp_out}") @@ -116,7 +106,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"