3 # Copyright (C) 2015 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.
20 if [ "x${BT_TESTS_SRCDIR:-}" != "x" ]; then
21 UTILSSH
="$BT_TESTS_SRCDIR/utils/utils.sh"
23 UTILSSH
="$(dirname "$0")/../utils/utils.sh"
26 # shellcheck source=../utils/utils.sh
35 local totalevents
="$2"
40 cnt
=$
("${BT_TESTS_BT2_BIN}" "$trace" |
wc -l)
41 test "${cnt// /}" = "$totalevents"
42 ok $?
"$totalevents events in the whole trace"
44 cnt
=$
("${BT_TESTS_BT2_BIN}" --stream-intersection "$trace" 2>/dev
/null|
wc -l)
45 test "${cnt// /}" = "$intersect"
46 ok $?
"$intersect events in packets intersecting"
49 diag
"Test the stream intersection feature"
51 diag
"2 streams offsetted with 3 packets intersecting"
52 test_intersect
"${BT_CTF_TRACES_PATH}/intersection/3eventsintersect" 8 3
54 diag
"2 streams offsetted with 3 packets intersecting (exchanged file names)"
55 test_intersect
"${BT_CTF_TRACES_PATH}/intersection/3eventsintersectreverse" 8 3
57 diag
"No intersection between 2 streams"
58 test_intersect
"${BT_CTF_TRACES_PATH}/intersection/nointersect" 6 0
61 test_intersect
"${BT_CTF_TRACES_PATH}/intersection/onestream" 3 3
63 diag
"No stream at all"
64 test_intersect
"${BT_CTF_TRACES_PATH}/intersection/nostream" 0 0
This page took 0.032855 seconds and 4 git commands to generate.