File: gettests.sh

package info (click to toggle)
mpdecimal 4.0.1-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,236 kB
  • sloc: ansic: 17,917; cpp: 6,508; sh: 4,236; makefile: 621; lisp: 502; python: 85; asm: 18
file content (25 lines) | stat: -rwxr-xr-x 761 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

if [ ! -d testdata ]; then
    mkdir testdata
fi

if [ x"$1" != x"--local" -a ! -f testdata/add.decTest ]; then
    # The official tests are freely downloadable, but copyrighted.
    WGET=`which wget`
    if [ ! -f "$WGET" ]; then
        printf "\n*** gettests.sh: error: could not find wget. In order to run the tests, \n"
        printf "    download http://speleotrove.com/decimal/dectest.zip and extract the \n"
        printf "    archive into tests/testdata.\n\n"
        exit 1
    fi
    printf "\nGetting official tests ... \n\n"
    $WGET -nv http://speleotrove.com/decimal/dectest.zip 2>&1 &&
    cd testdata &&
    unzip -qq ../dectest.zip &&
    cd ../
fi

if [ ! -f testdata/baseconv.decTest ]; then
    cp testdata_dist/* testdata
fi