| 1 |
#!/bin/sh |
| 2 |
# autopkgtest check: Build and run a simple program against pupnp |
| 3 |
|
| 4 |
set -e |
| 5 |
|
| 6 |
# Require $AUTOPKGTEST_TMP for temporary build files |
| 7 |
if [ -z "$AUTOPKGTEST_TMP" ] |
| 8 |
then |
| 9 |
echo "Required envvar \"$AUTOPKGTEST_TMP\"is not set" >&2 |
| 10 |
exit 1 |
| 11 |
fi |
| 12 |
|
| 13 |
cp debian/tests/pupnp-test.c "$AUTOPKGTEST_TMP" |
| 14 |
cd "$AUTOPKGTEST_TMP" |
| 15 |
|
| 16 |
# Build programs - once with raw libraries and once with pkg-config |
| 17 |
gcc -Wall -Werror -o pupnp-test1 pupnp-test.c -I/usr/include/upnp -lupnp |
| 18 |
echo "build1: OK" |
| 19 |
gcc -Wall -Werror -o pupnp-test2 pupnp-test.c $(pkg-config --cflags --libs libupnp) |
| 20 |
echo "build2: OK" |
| 21 |
|
| 22 |
# Run them |
| 23 |
./pupnp-test1 |
| 24 |
echo "run1: OK" |
| 25 |
./pupnp-test2 |
| 26 |
echo "run2: OK" |