• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "$1" || 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    if [ x"$1" != x"--local" ]; then
27        printf "Running official tests ...\n\n"
28        ./runtest official.decTest || { printf "\nFAIL\n\n\n"; exit 1; }
29    fi
30
31    printf "Running additional tests ...\n\n"
32    ./runtest additional.decTest || { printf "\nFAIL\n\n\n"; exit 1; }
33fi
34
35if [ -f ./runtest_shared ]; then
36    printf "\n# ========================================================================\n"
37    printf "#                         libmpdec: shared library\n"
38    printf "# ========================================================================\n\n"
39
40    PORTABLE_PWD=`pwd`
41    LD_LIBRARY_PATH="$PORTABLE_PWD/../libmpdec:$LD_LIBRARY_PATH"
42    DYLD_LIBRARY_PATH="$PORTABLE_PWD/../libmpdec:$DYLD_LIBRARY_PATH"
43    LD_64_LIBRARY_PATH="$PORTABLE_PWD/../libmpdec:$LD_64_LIBRARY_PATH"
44    LD_32_LIBRARY_PATH="$PORTABLE_PWD/../libmpdec:$LD_32_LIBRARY_PATH"
45    LD_LIBRARY_PATH_64="$PORTABLE_PWD/../libmpdec:$LD_LIBRARY_PATH_64"
46    LD_LIBRARY_PATH_32="$PORTABLE_PWD/../libmpdec:$LD_LIBRARY_PATH_32"
47    PATH="$LD_LIBRARY_PATH:$PATH"
48    export LD_LIBRARY_PATH
49    export DYLD_LIBRARY_PATH
50    export LD_64_LIBRARY_PATH
51    export LD_32_LIBRARY_PATH
52    export LD_LIBRARY_PATH_64
53    export LD_LIBRARY_PATH_32
54
55    if [ x"$1" != x"--local" ]; then
56        printf "Running official tests ...\n\n"
57        ./runtest_shared official.decTest || { printf "\nFAIL\n\n\n"; exit 1; }
58    fi
59
60    printf "Running additional tests ...\n\n"
61    ./runtest_shared additional.decTest || { printf "\nFAIL\n\n\n"; exit 1; }
62fi
63