# %TEST-EXEC: chmod +x normalize-output
# %TEST-EXEC: btest -j 5 t1 t2 t3 t4 t5 2>&1 | ./normalize-output | grep "4.*5" | sed "s/[0-36-9] //" >output.j5
# %TEST-EXEC: btest -j 1 t1 t2 t3 t4 t5 2>&1 | ./normalize-output >output.j1
# %TEST-EXEC: btest -j 0 t1 t2 t3 t4 t5 2>&1 | cat >output.j0
# %TEST-EXEC: btest-diff output.j5
# %TEST-EXEC: btest-diff output.j1
# %TEST-EXEC: btest-diff output.j0

%TEST-START-FILE normalize-output
grep '\#' | \
sed 's/.#\([0-9]\). .\([0-9]\).*/test \2 thread \1/g' | \
awk '{t[$4] = t[$4] " " $2} END{ for ( i in t ) print t[i];}' | \
sort
%TEST-END-FILE

%TEST-START-FILE t1
@TEST-EXEC: echo t1.a >output
@TEST-EXEC: sleep 1
@TEST-EXEC: echo t1.b >output
%TEST-END-FILE

%TEST-START-FILE t2
@TEST-EXEC: echo t2.a >output
@TEST-EXEC: sleep 1
@TEST-EXEC: echo t2.b >output
%TEST-END-FILE

%TEST-START-FILE t3
@TEST-EXEC: echo t3.a >output
@TEST-EXEC: sleep 1
@TEST-EXEC: echo t3.b >output
%TEST-END-FILE

%TEST-START-FILE t4
@TEST-SERIALIZE: Foo
@TEST-EXEC: echo t4.a >output
@TEST-EXEC: sleep 1
@TEST-EXEC: echo t4.b >output
%TEST-END-FILE

%TEST-START-FILE t5
@TEST-SERIALIZE: Foo
@TEST-EXEC: echo t5.a >output
@TEST-EXEC: sleep 1
@TEST-EXEC: echo t5.b >output
%TEST-END-FILE

