File: ensure_test_data.sh

package info (click to toggle)
mapnik 3.0.12%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 17,084 kB
  • ctags: 18,454
  • sloc: cpp: 142,516; python: 1,416; sh: 769; makefile: 170; xml: 140; lisp: 13
file content (23 lines) | stat: -rwxr-xr-x 973 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash

set -eu
set -o pipefail

if [[ -f RELEASE_VERSION.md ]]; then
    VERSION=$(cat RELEASE_VERSION.md)
    if [[ ! -d ./test/data ]]; then
        echo "Downloading unit test data from https://github.com/mapnik/test-data/archive/${VERSION}.tar.gz"
        mkdir -p test/data/
        curl -f -L -s https://github.com/mapnik/test-data/archive/${VERSION}.tar.gz | tar zxf - --strip-components=1 -C test/data/
    fi
    if [[ ! -d ./test/data-visual ]]; then
        echo "Downloading visual test data from https://github.com/mapnik/test-data-visual/archive/${VERSION}.tar.gz"
        mkdir -p test/data-visual/
        curl -f -L -s https://github.com/mapnik/test-data-visual/archive/${VERSION}.tar.gz | tar zxf - --strip-components=1 -C test/data-visual/
    fi
elif [[ -d .git ]]; then
    git submodule update --init test/
else
    echo "Expected either git clone directory (with .git) or release tarball with `RELEASE_VERSION.md` in root"
    exit 1
fi