1#!/bin/sh 2 3# malloc() on OS X does not conform to the C standard. 4SYSTEM=`uname -s` 5case $SYSTEM in 6 darwin*|Darwin*) 7 export MallocLogFile=/dev/null 8 export MallocDebugReport=crash 9 ;; 10 *) 11 ;; 12esac 13 14# Download the official test cases (text files). 15./gettests.sh || exit 1 16 17if [ ! -f ./runtest -a ! -f ./runtest_shared ]; then 18 printf "\nERROR: ./runtest and ./runtest_shared not found\n\n\n"; exit 1; 19fi 20 21if [ -f ./runtest ]; then 22 printf "\n# ========================================================================\n" 23 printf "# libmpdec: static library\n" 24 printf "# ========================================================================\n\n" 25 26 printf "Running official tests with allocation failures ...\n\n" 27 ./runtest official.decTest --alloc || { printf "\nFAIL\n\n\n"; exit 1; } 28 29 printf "Running additional tests with allocation failures ...\n\n" 30 ./runtest additional.decTest --alloc || { printf "\nFAIL\n\n\n"; exit 1; } 31fi 32 33if [ -f ./runtest_shared ]; then 34 printf "\n# ========================================================================\n" 35 printf "# libmpdec: shared library\n" 36 printf "# ========================================================================\n\n" 37 38 PORTABLE_PWD=`pwd` 39 LD_LIBRARY_PATH="$PORTABLE_PWD/../libmpdec:$LD_LIBRARY_PATH" 40 DYLD_LIBRARY_PATH="$PORTABLE_PWD/../libmpdec:$DYLD_LIBRARY_PATH" 41 LD_64_LIBRARY_PATH="$PORTABLE_PWD/../libmpdec:$LD_64_LIBRARY_PATH" 42 LD_32_LIBRARY_PATH="$PORTABLE_PWD/../libmpdec:$LD_32_LIBRARY_PATH" 43 LD_LIBRARY_PATH_64="$PORTABLE_PWD/../libmpdec:$LD_LIBRARY_PATH_64" 44 LD_LIBRARY_PATH_32="$PORTABLE_PWD/../libmpdec:$LD_LIBRARY_PATH_32" 45 PATH="$LD_LIBRARY_PATH:$PATH" 46 export LD_LIBRARY_PATH 47 export DYLD_LIBRARY_PATH 48 export LD_64_LIBRARY_PATH 49 export LD_32_LIBRARY_PATH 50 export LD_LIBRARY_PATH_64 51 export LD_LIBRARY_PATH_32 52 53 printf "Running official tests with allocation failures ...\n\n" 54 ./runtest_shared official.decTest --alloc || { printf "\nFAIL\n\n\n"; exit 1; } 55 56 printf "Running additional tests with allocation failures ...\n\n" 57 ./runtest_shared additional.decTest --alloc || { printf "\nFAIL\n\n\n"; exit 1; } 58fi 59