File: build

package info (click to toggle)
criterion 2.4.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 3,864 kB
  • sloc: ansic: 17,945; cpp: 774; python: 74; makefile: 25; sh: 19
file content (26 lines) | stat: -rw-r--r-- 573 bytes parent folder | download | duplicates (2)
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"