blob: 5c826a1766bdaca56b5ff87f4fcb5e0fbf7c43bb [file] [log] [blame]
Patrick Williams0ca19cc2021-08-16 14:03:13 -05001#!/bin/sh
2
Patrick Williams8e7b46e2023-05-01 14:19:06 -05003export MALLOC_CONF_ALL=${MALLOC_CONF}
4# Concatenate the individual test's MALLOC_CONF and MALLOC_CONF_ALL.
5export_malloc_conf() {
6 if [ "x${MALLOC_CONF}" != "x" -a "x${MALLOC_CONF_ALL}" != "x" ] ; then
7 export MALLOC_CONF="${MALLOC_CONF},${MALLOC_CONF_ALL}"
8 else
9 export MALLOC_CONF="${MALLOC_CONF}${MALLOC_CONF_ALL}"
10 fi
11}
12
13
14
Patrick Williams0ca19cc2021-08-16 14:03:13 -050015saved_dir=$PWD
16for dir in tests/* ; do
17 cd $dir
18 for atest in * ; do
Patrick Williams8e7b46e2023-05-01 14:19:06 -050019 if [[ "${atest##*.}" == "sh" ]]; then
20 continue
21 fi
22 if [ -e "${atest}.sh" ] ; then
23 # Source the shell script corresponding to the test in a subshell and
24 # execute the test. This allows the shell script to set MALLOC_CONF, which
25 # is then used to set MALLOC_CONF (thus allowing the
26 # per test shell script to ignore the detail).
27 enable_fill=1 \
28 enable_prof=1 \
29 . $(pwd)/${atest}.sh && \
30 export_malloc_conf
31 else
32 export MALLOC_CONF= && \
33 export_malloc_conf
34 fi
Patrick Williams0ca19cc2021-08-16 14:03:13 -050035 if [ \( -x $atest \) -a \( -f $atest \) ] ; then
36 rm -rf tests.log
37 ./$atest > tests.log 2>&1
38 sed -e '/: pass/ s/^/PASS: /g' \
39 -e '/: skip/ s/^/SKIP: /g' \
40 -e '/: fail/ s/^/FAIL: /g' \
41 -e 's/: pass//g' \
42 -e 's/: skip//g' \
43 -e 's/: fail//g' \
44 -e '/^--- pass:/d' tests.log
45 fi
46 done
47 cd $saved_dir
48done