File: build

package info (click to toggle)
boxfort 0.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 508 kB
  • sloc: ansic: 3,664; asm: 225; sh: 18; makefile: 4; python: 3
file content (30 lines) | stat: -rw-r--r-- 633 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
27
28
29
30
#!/bin/sh
# autopkgtest check: Build and run a program against BoxFort, to verify that the
# headers and pkg-config file are installed correctly.

set -e

WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
cat <<EOF > boxforttest.c
#include <stdlib.h>
#include "boxfort.h"

#define _assert(Cond) do { if (!(Cond)) abort(); } while (0)

int main()
{
    bxf_context ctx;
    _assert(!bxf_context_init(&ctx));

    _assert(!bxf_context_term(ctx));
    return 0;
}
EOF

gcc -o boxforttest boxforttest.c `pkg-config --cflags --libs boxfort`
echo "build: OK"
[ -x boxforttest ]
./boxforttest
echo "run: OK"