Skip to content
Snippets Groups Projects
Commit 75089832 authored by Simon McVittie's avatar Simon McVittie
Browse files

debian/tests: Add a smoke-test using autopkgtest


This just checks that we can link and initialize the library, and
not that we can actually do anything interesting.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 73eafcae
No related branches found
No related tags found
1 merge request!311Build capsule-capture-libs from a bundled copy of libcapsule
Tests: smoke
Depends:
build-essential,
libcapsule-dev,
#!/bin/bash
# Copyright © 2017 Collabora Ltd.
#
# This library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of the
# License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <http://www.gnu.org/licenses/>.
set -eu -o pipefail
exec 3>&1
BASH_XTRACEFD=3
PS4='# execute: '
set -x
scratch="$(mktemp -d)"
cd "$scratch"
trap 'cd /; rm -fr $scratch' EXIT
echo "1..5"
cat > trivial.c <<'EOF'
#define _GNU_SOURCE
#include <stdio.h>
#include <capsule.h>
int
main (void)
{
capsule_init();
printf( "ok 4 - capsule_init() didn't crash\n" );
return 0;
}
EOF
gcc -c -o trivial.o trivial.c $(pkg-config --cflags capsule)
echo "ok 1 - compiled"
gcc -o trivial trivial.o $(pkg-config --libs capsule)
echo "ok 2 - linked"
test -x trivial
echo "ok 3 - result is executable"
./trivial
echo "ok 5 - exited successfully"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment