| 1 |
#!/bin/sh |
| 2 |
# autopkgtest check: Build and run a simple program using pkgconf |
| 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/smoke-test.c "$AUTOPKGTEST_TMP" |
| 14 |
cp debian/tests/smoke-test-output.txt "$AUTOPKGTEST_TMP" |
| 15 |
cd "$AUTOPKGTEST_TMP" |
| 16 |
|
| 17 |
gcc -Wall -Werror -o ./test1 smoke-test.c -lSheenBidi |
| 18 |
echo "build1: OK" |
| 19 |
gcc -Wall -Werror -o ./test2 smoke-test.c $(pkg-config --cflags --libs sheenbidi) |
| 20 |
echo "build2: OK" |
| 21 |
|
| 22 |
run_test() { |
| 23 |
echo "$1: running" |
| 24 |
"$1" | tee "$1.output" |
| 25 |
diff -u smoke-test-output.txt "$1.output" |
| 26 |
echo "$1: OK" |
| 27 |
} |
| 28 |
|
| 29 |
run_test ./test1 |
| 30 |
run_test ./test2 |