jemalloc: improve the ptest output

Previouly we only show the output of each text program, actually
each test program includes serveral test cases. Improve the ptest
script to show the output of each test case.

Before:
 # ./run-ptest
 [snip]
 PASS: tests/integration/MALLOCX_ARENA
 PASS: tests/integration/aligned_alloc
 [snip]

After:
 # ./run-ptest
 [snip]
 PASS: test_MALLOCX_ARENA (non-reentrant)
 PASS: test_MALLOCX_ARENA (libc-reentrant)
 PASS: test_MALLOCX_ARENA (arena_new-reentrant)
 PASS: test_alignment_errors (non-reentrant)
 PASS: test_alignment_errors (libc-reentrant)
 PASS: test_alignment_errors (arena_new-reentrant)
 PASS: test_oom_errors (non-reentrant)
 PASS: test_oom_errors (libc-reentrant)
 PASS: test_oom_errors (arena_new-reentrant)
 PASS: test_alignment_and_size (non-reentrant)
 PASS: test_alignment_and_size (libc-reentrant)
 PASS: test_alignment_and_size (arena_new-reentrant)
 PASS: test_zero_alloc (non-reentrant)
 PASS: test_zero_alloc (libc-reentrant)
 PASS: test_zero_alloc (arena_new-reentrant)
 [snip]

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Mingli Yu
2021-08-13 08:44:54 +08:00
committed by Khem Raj
parent 344bb081f5
commit 71c5cc44c7
@@ -5,13 +5,15 @@ for dir in tests/* ; do
cd $dir cd $dir
for atest in * ; do for atest in * ; do
if [ \( -x $atest \) -a \( -f $atest \) ] ; then if [ \( -x $atest \) -a \( -f $atest \) ] ; then
./$atest > ${atest}.stdout 2> ${atest}.stderr rm -rf tests.log
if [ $? = 0 ] ; then ./$atest > tests.log 2>&1
echo "PASS: $dir $atest" sed -e '/: pass/ s/^/PASS: /g' \
rm ${atest}.stdout ${atest}.stderr -e '/: skip/ s/^/SKIP: /g' \
else -e '/: fail/ s/^/FAIL: /g' \
echo "FAIL: ${dir}/${atest}" -e 's/: pass//g' \
fi -e 's/: skip//g' \
-e 's/: fail//g' \
-e '/^--- pass:/d' tests.log
fi fi
done done
cd $saved_dir cd $saved_dir