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 BABELTRACE_BIN
=@abs_top_builddir@
/cli
/babeltrace
20 CTF_TRACES
=@abs_top_srcdir@
/tests
/ctf-traces
22 source @abs_top_srcdir@
/tests
/utils
/tap
/tap.sh
24 SUCCESS_TRACES
=(${CTF_TRACES}/succeed
/*)
25 FAIL_TRACES
=(${CTF_TRACES}/fail
/*)
27 # -2 because there is an empty trace that we skip
28 NUM_TESTS
=$
((${#SUCCESS_TRACES[@]} * 3 - 2))
32 for path
in ${SUCCESS_TRACES[@]}; do
34 text_output1
=$
(mktemp
)
35 text_output2
=$
(mktemp
)
36 trace
=$
(basename ${path})
38 $BABELTRACE_BIN ${path} 2>/dev
/null
>${text_output1}
39 cnt
=$
(cat ${text_output1} |
wc -l)
40 if test $cnt == 0; then
41 ok
0 "Empty trace, nothing to copy"
45 $BABELTRACE_BIN ${path} --component sink.ctf.fs
--path ${out_path} >/dev
/null
2>&1
46 ok $?
"Copy trace ${trace} with ctf-fs sink"
48 $BABELTRACE_BIN ${out_path} >/dev
/null
2>&1
50 fail
"Read the new trace in ${out_path}"
53 ok
0 "Read the new trace in ${out_path}"
55 $BABELTRACE_BIN ${out_path} 2>/dev
/null
>${text_output2}
56 cnt
=$
(diff ${text_output1} ${text_output2} |
wc -l)
58 ok $?
"Exact same content between the two traces"
60 rm -rf ${out_path} ${text_output} ${text_output2}
This page took 0.033049 seconds and 6 git commands to generate.