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
|
#!/bin/sh
# autopkgtest check: Build and run a program against libg3d, to verify that the
# headers are installed correctly
# Source taken from http://leenissen.dk/fann/wp/help/getting-started/
# (C) 2013 Vibhav Pant
# Author: Vibhav Pant <martin.pitt@ubuntu.com>
set -e
WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
cat <<EOF > g3d_test.c
#include <g3d/g3d.h>
#include <assert.h>
int main(void)
{
G3DContext *context;
context = g3d_context_new();
g3d_context_update_progress_bar(context, 40, TRUE);
g3d_context_free(context);
return 0;
}
EOF
gcc -o g3d_test g3d_test.c `pkg-config --cflags --libs libg3d` -Wall -Werror
echo "build: OK"
[ -x g3d_test ]
./g3d_test
echo "run: OK"
|