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
|
#!/bin/sh
# autopkgtest check: Build and run a program against Criterion, to verify that
# it is installed correctly.
set -e
WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
cat <<EOF > criterion_test.c
#include <criterion/criterion.h>
Test(samples, timed) {
cr_assert(1);
}
EOF
gcc -o criterion_test criterion_test.c `pkg-config --cflags --libs criterion`
echo "build: OK"
[ -x criterion_test ]
RES=$(./criterion_test 2>&1)
echo "run: OK"
echo $RES | grep -q "Tested: 1 | Passing: 1 | Failing: 0 | Crashing: 0"
echo "output: OK"
|