3 # Copyright (C) - 2017 Julien Desfossez <jdesfossez@efficios.com>
5 # This program is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License, version 2 only, as
7 # published by the Free Software Foundation.
9 # This program is distributed in the hope that it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 # You should have received a copy of the GNU General Public License along with
15 # this program; if not, write to the Free Software Foundation, Inc., 51
16 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 .
"@abs_top_builddir@/tests/utils/common.sh"
20 TRACE_PATH
="${BT_CTF_TRACES}/succeed/wk-heartbeat-u/"
28 # Run Babeltrace with some command line arguments, verify exit status and
29 # number of output events (i.e. number of output lines)
33 # $1: expected number of events
34 # $2: test description
35 # remaining arguments: command-line arguments to pass to Babeltrace
37 function expect_success
()
39 local expected_num_events
="$1"
44 "${BT_BIN}" "${TRACE_PATH}" "$@" 2>/dev/null > "${tmp_out}"
45 ok $?
"trimmer: ${msg}: exit status"
46 num_events
=$
(wc -l < "${tmp_out}")
47 is
"${num_events}" "${expected_num_events}" "trimmer: ${msg}: number of events (${expected_num_events})"
50 expect_success
18 "--begin, GMT relative timestamps" \
51 --clock-gmt --begin 17:48:17.587029529
52 expect_success
9 "--end, GMT relative timestamps" \
53 --clock-gmt --end 17:48:17.588680018
54 expect_success
7 "--begin and --end, GMT relative timestamps" \
55 --clock-gmt --begin 17:48:17.587029529 --end 17:48:17.588680018
56 expect_success
0 "--begin, out of range, GMT relative timestamps" \
57 --clock-gmt --begin 18:48:17.587029529
58 expect_success
0 "--end, out of range, GMT relative timestamps" \
59 --clock-gmt --end 16:48:17.588680018
61 expect_success
18 "--begin, GMT absolute timestamps" \
62 --clock-gmt --begin "2012-10-29 17:48:17.587029529"
63 expect_success
9 "--end, GMT absolute timestamps" \
64 --clock-gmt --end "2012-10-29 17:48:17.588680018"
65 expect_success
7 "--begin and --end, GMT absolute timestamps" \
66 --clock-gmt --begin "2012-10-29 17:48:17.587029529" --end "2012-10-29 17:48:17.588680018"
67 expect_success
0 "--begin, out of range, GMT absolute timestamps" \
68 --clock-gmt --begin "2012-10-29 18:48:17.587029529"
69 expect_success
0 "--begin, out of range, GMT absolute timestamps" \
70 --clock-gmt --end "2012-10-29 16:48:17.588680018"
74 expect_success
18 "--begin, EST relative timestamps" \
75 --begin "12:48:17.587029529"
76 expect_success
9 "--end, EST relative timestamps" \
77 --end "12:48:17.588680018"
78 expect_success
7 "--begin and --end, EST relative timestamps" \
79 --begin "12:48:17.587029529" --end "12:48:17.588680018"
80 expect_success
0 "--begin, out of range, EST relative timestamps" \
81 --begin "13:48:17.587029529"
82 expect_success
0 "--end, out of range, EST relative timestamps" \
83 --end "11:48:17.588680018"
85 expect_success
18 "--begin, EST absolute timestamps" \
86 --begin "2012-10-29 12:48:17.587029529"
87 expect_success
9 "--end, EST absolute timestamps" \
88 --end "12:48:17.588680018"
89 expect_success
7 "--begin and --end, EST absolute timestamps" \
90 --begin "2012-10-29 12:48:17.587029529" --end "2012-10-29 12:48:17.588680018"
91 expect_success
0 "--begin, out of range, EST absolute timestamps" \
92 --begin "2012-10-29 13:48:17.587029529"
93 expect_success
0 "--end, out of range, EST absolute timestamps" \
94 --end "2012-10-29 11:48:17.588680018"
This page took 0.033729 seconds and 4 git commands to generate.