Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 3 | export MALLOC_CONF_ALL=${MALLOC_CONF} |
| 4 | # Concatenate the individual test's MALLOC_CONF and MALLOC_CONF_ALL. |
| 5 | export_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 Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 15 | saved_dir=$PWD |
| 16 | for dir in tests/* ; do |
| 17 | cd $dir |
| 18 | for atest in * ; do |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 19 | 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 Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 35 | 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 |
| 48 | done |