aboutsummaryrefslogtreecommitdiffstats
path: root/test/test.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.sh.in')
-rw-r--r--test/test.sh.in29
1 files changed, 28 insertions, 1 deletions
diff --git a/test/test.sh.in b/test/test.sh.in
index a39f99f6..f0f0f979 100644
--- a/test/test.sh.in
+++ b/test/test.sh.in
@@ -11,6 +11,18 @@ case @abi@ in
;;
esac
+# Make a copy of the @JEMALLOC_CPREFIX@MALLOC_CONF passed in to this script, so
+# it can be repeatedly concatenated with per test settings.
+export MALLOC_CONF_ALL=${@JEMALLOC_CPREFIX@MALLOC_CONF}
+# Concatenate the individual test's MALLOC_CONF and MALLOC_CONF_ALL.
+export_malloc_conf() {
+ if [ "x${MALLOC_CONF}" != "x" -a "x${MALLOC_CONF_ALL}" != "x" ] ; then
+ export @JEMALLOC_CPREFIX@MALLOC_CONF="${MALLOC_CONF},${MALLOC_CONF_ALL}"
+ else
+ export @JEMALLOC_CPREFIX@MALLOC_CONF="${MALLOC_CONF}${MALLOC_CONF_ALL}"
+ fi
+}
+
# Corresponds to test_status_t.
pass_code=0
skip_code=1
@@ -24,7 +36,22 @@ for t in $@; do
echo
fi
echo "=== ${t} ==="
- ${t}@exe@ @abs_srcroot@ @abs_objroot@
+ if [ -e "@srcroot@${t}.sh" ] ; then
+ # Source the shell script corresponding to the test in a subshell and
+ # execute the test. This allows the shell script to set MALLOC_CONF, which
+ # is then used to set @JEMALLOC_CPREFIX@MALLOC_CONF (thus allowing the
+ # per test shell script to ignore the @JEMALLOC_CPREFIX@ detail).
+ $(enable_fill=@enable_fill@ \
+ enable_prof=@enable_prof@ \
+ enable_tcache=@enable_tcache@ \
+ . @srcroot@${t}.sh && \
+ export_malloc_conf && \
+ ${t}@exe@ @abs_srcroot@ @abs_objroot@)
+ else
+ $(export MALLOC_CONF= && \
+ export_malloc_conf &&
+ ${t}@exe@ @abs_srcroot@ @abs_objroot@)
+ fi
result_code=$?
case ${result_code} in
${pass_code})