File: build

package info (click to toggle)
criterion 2.3.3git1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,832 kB
  • sloc: ansic: 17,852; cpp: 795; python: 72; sh: 27; makefile: 23
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"