| 1 |
#!/bin/sh |
| 2 |
# autopkgtest check: Build a program against libhyperscan and check whether a |
| 3 |
# runnable binary is produced. |
| 4 |
# Author: Sascha Steinbiss <[email protected]> |
| 5 |
set -e |
| 6 |
|
| 7 |
SRC=$(pwd)/examples/simplegrep.c |
| 8 |
RES=$(pwd)/debian/tests/simplegrep.result |
| 9 |
WORKDIR=$(mktemp -d) |
| 10 |
|
| 11 |
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM |
| 12 |
cd $WORKDIR |
| 13 |
|
| 14 |
gcc -o simplegrep $SRC $(pkg-config --cflags --libs libhs) |
| 15 |
[ -x simplegrep ] |
| 16 |
echo "build: OK" |
| 17 |
|
| 18 |
echo "barbaz" > 1 |
| 19 |
./simplegrep ba 1 > 2 |
| 20 |
diff 2 $RES |
| 21 |
echo "run: OK" |