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
|
#! /bin/sh
# autopkgtest check: Build and run a program against libpipeline, to verify
# that the headers and pkg-config file are installed correctly
# (C) 2013 Vibhav Pant
# 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 > libpipeline_test.c
#include <pipeline.h>
#include <assert.h>
int main (int argc, char **argv)
{
pipeline *p;
p = pipeline_new ();
pipeline_command_args (p, "true", NULL);
assert (pipeline_run (p) == 0);
return 0;
}
EOF
gcc -o libpipeline_test libpipeline_test.c \
$(pkg-config --cflags --libs libpipeline) -Wall -Werror
echo "build: OK"
[ -x libpipeline_test ]
./libpipeline_test
echo "run: OK"
|