-
Notifications
You must be signed in to change notification settings - Fork 434
Expand file tree
/
Copy pathtest
More file actions
executable file
·39 lines (30 loc) · 801 Bytes
/
test
File metadata and controls
executable file
·39 lines (30 loc) · 801 Bytes
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
#! /usr/bin/env 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