File: build-and-test.sh

package info (click to toggle)
pngtools 1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 928 kB
  • sloc: ansic: 871; sh: 684; python: 558; makefile: 32
file content (40 lines) | stat: -rwxr-xr-x 855 bytes parent folder | download
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
set -e

cd "$(dirname "$0")/.."

# Run autotools if configure doesn't exist
if [ ! -f configure ]; then
    echo "==> Running autotools..."
    aclocal
    autoconf
    automake --add-missing
    autoreconf
fi

# Run configure if Makefile doesn't exist
if [ ! -f Makefile ]; then
    echo "==> Running ./configure..."
    ./configure
fi

# Build
echo "==> Building..."
make -j"$(nproc)"

# Set up test venv if it doesn't exist
if [ ! -f tests/.venv/bin/stestr ]; then
    echo "==> Setting up test venv..."
    python3 -m venv tests/.venv
    tests/.venv/bin/pip install -r test-requirements.txt
fi

# Generate test images if needed
if [ ! -f testdata/with_text.png ]; then
    echo "==> Generating test images..."
    tests/.venv/bin/python tests/generate_test_images.py
fi

# Run tests
echo "==> Running tests..."
tests/.venv/bin/stestr run