X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tests%2Fplugins%2Fsrc.ctf.fs%2Fsucceed%2Ftest_succeed;h=16f07ad146fa6f3b6ee302ae257ff096c808f51a;hb=8e03dac57df3ee78b8c7c78bfdec4dec5669741c;hp=a0e06d4446806210e09714b16af24f8ff5c9dd5d;hpb=1eb289076eed1e36fa2c7256f504fb22f40f9f7c;p=babeltrace.git diff --git a/tests/plugins/src.ctf.fs/succeed/test_succeed b/tests/plugins/src.ctf.fs/succeed/test_succeed index a0e06d44..16f07ad1 100755 --- a/tests/plugins/src.ctf.fs/succeed/test_succeed +++ b/tests/plugins/src.ctf.fs/succeed/test_succeed @@ -58,8 +58,43 @@ test_ctf_single() { ok $? "Trace '$name' gives the expected output" } -plan_tests 3 +test_packet_end() { + local name="$1" + local expected_stdout="$expect_dir/trace-$name.expect" + local ret=0 + local ret_stdout + local ret_stderr + local details_comp=("-c" "sink.text.details") + local details_args=("-p" "with-trace-name=no,with-stream-name=no,with-metadata=no,compact=yes") + local temp_stdout_output_file="$(mktemp -t actual_stdout.XXXXXX)" + local temp_greped_stdout_output_file="$(mktemp -t greped_stdout.XXXXXX)" + local temp_stderr_output_file="$(mktemp -t actual_stderr.XXXXXX)" + + bt_cli "$temp_stdout_output_file" "$temp_stderr_output_file" \ + "$succeed_trace_dir/$name" "${details_comp[@]}" \ + "${details_args[@]}" + + "$BT_TESTS_GREP_BIN" "Packet end" "$temp_stdout_output_file" > "$temp_greped_stdout_output_file" + + bt_diff "$expected_stdout" "$temp_greped_stdout_output_file" + ret_stdout=$? + + bt_diff /dev/null "$temp_stderr_output_file" + ret_stderr=$? + + if ((ret_stdout != 0 || ret_stderr != 0)); then + ret=1 + fi + + ok $ret "Trace '$name' gives the expected output" + rm -f "$temp_stdout_output_file" "$temp_stderr_output_file" "$temp_greped_stdout_output_file" +} + +plan_tests 6 test_ctf_gen_single simple test_ctf_single smalltrace test_ctf_single 2packets +test_ctf_single barectf-event-before-packet +test_packet_end lttng-event-after-packet +test_packet_end lttng-crash