| 1 | #!/bin/sh |
| 2 | # autopkgtest check: Build and run a program against console-bridge, |
| 3 | # to verify that the headers and pkg-config file are installed |
| 4 | # correctly |
| 5 | # (C) 2013 Thomas Moulard |
| 6 | # Author: Thomas Moulard <[email protected]> |
| 7 | |
| 8 | set -e |
| 9 | |
| 10 | WORKDIR=$(mktemp -d) |
| 11 | trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM |
| 12 | cd $WORKDIR |
| 13 | cat <<EOF > consolebridgetest.cpp |
| 14 | #include <console_bridge/console.h> |
| 15 | |
| 16 | int main() |
| 17 | { |
| 18 | CONSOLE_BRIDGE_logInform ("test"); |
| 19 | return 0; |
| 20 | } |
| 21 | EOF |
| 22 | |
| 23 | g++ -o consolebridgetest consolebridgetest.cpp \ |
| 24 | `pkg-config --cflags --libs console_bridge` |
| 25 | echo "build: OK" |
| 26 | [ -x consolebridgetest ] |
| 27 | ./consolebridgetest |
| 28 | echo "run: OK" |