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 34 35 36 37
|
#!/bin/sh
# autopkgtest check: Build and run a program against libcaca, to verify that
# the headers and pkg-config file are installed correctly
# (C) 2013 Canonical Ltd.
# Author: Vibhav Pant <vibhavp@ubuntu.com>
set -e
WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
cat <<EOF > caca_test.c
#include <caca.h>
#include <stdio.h>
#include <assert.h>
int main(void)
{
caca_canvas_t *c;
printf("Testing libcaca version %s\n", caca_get_version());
c = caca_create_canvas(20,30);
assert(c != NULL);
assert(caca_free_canvas(c) != -1);
return 0;
}
EOF
gcc -o caca_test caca_test.c `pkg-config --cflags --libs caca` -Wall -Werror
echo "build: OK"
[ -x caca_test ]
export TERM=linux
./caca_test
echo "run: OK"
|