File: test

package info (click to toggle)
python-av 14.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,664 kB
  • sloc: python: 4,712; sh: 175; ansic: 174; makefile: 123
file content (39 lines) | stat: -rwxr-xr-x 792 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
#!/bin/bash

# Exit as soon as something errors.
set -e

if [[ ! "$_PYAV_ACTIVATED" ]]; then
    export here="$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd)"
    source "$here/activate.sh"
fi

cd "$PYAV_ROOT"


TESTSUITE="${1-main}"

istest() {
    [[ "$TESTSUITE" == all || "$TESTSUITE" == "$1" ]]
    return $?
}

$PYAV_PYTHON -c "import av; print(f'PyAV: {av.__version__}'); print(f'FFMPEG: {av.ffmpeg_version_info}')"

if istest main; then
    $PYAV_PYTHON -m pytest
fi

if istest examples; then
    for name in $(find examples -name '*.py'); do
        echo
        echo === $name
        cd "$PYAV_ROOT"
        mkdir -p "sandbox/$1"
        cd "sandbox/$1"
        if ! python "$PYAV_ROOT/$name"; then
            echo FAILED $name with code $?
            exit $?
        fi
    done
fi