File: build

package info (click to toggle)
libpipeline 1.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,260 kB
  • sloc: ansic: 23,186; sh: 6,245; makefile: 167
file content (32 lines) | stat: -rwxr-xr-x 727 bytes parent folder | download | duplicates (3)
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"