File: test-examples

package info (click to toggle)
libvorbis 1.3.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,444 kB
  • sloc: ansic: 54,738; sh: 4,210; xml: 982; perl: 786; makefile: 329
file content (34 lines) | stat: -rwxr-xr-x 909 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
26
27
28
29
30
31
32
33
34
#!/bin/sh
#
# Try to build and run the example code.  Provide input on both stdin
# and as first argument as the programs seem to handle either or both.
# The goal is to verify that it is possible to link with the libvorbis
# library and run the resulting binaries.

set -e

if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
    CC="$DEB_HOST_GNU_TYPE-gcc"
  else
    CC=gcc
fi

retval=0
cd $AUTOPKGTEST_TMP

# Some small ogg file, picked randomly from sound-theme-freedesktop
cp /usr/share/sounds/freedesktop/stereo/bell.oga testinput.ogg

for f in /usr/share/doc/libvorbis-dev/examples/*.c; do
    echo "****** Testing $f ******"
    cp $f .
    ${CC} -o example $(basename $f) -logg -lvorbisenc -lvorbisfile -lvorbis -lm

    if cat testinput.ogg | ./example testinput.ogg > testoutput 2>&1 ; then
        echo "success running $f"
    else
        echo "error running $f"
        retval=1
    fi
done
exit $retval