From 2459d9471afbe2b019744f4335f66025b73965de Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 11:24:33 +0200 Subject: Adding debian version 1:3.9.0-4. Signed-off-by: Daniel Baumann --- debian/tests/test-libpci | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 debian/tests/test-libpci (limited to 'debian/tests/test-libpci') diff --git a/debian/tests/test-libpci b/debian/tests/test-libpci new file mode 100755 index 0000000..12aaf0d --- /dev/null +++ b/debian/tests/test-libpci @@ -0,0 +1,39 @@ +#!/bin/sh +# Copyright © 2020 Collabora Ltd. +# Copyright © 2020 Guillem Jover +# SPDX-License-Identifier: GPL-2.0-or-later + +set -e +set -u +set -x + +if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then + CC="$DEB_HOST_GNU_TYPE-gcc" + PKG_CONFIG="$DEB_HOST_GNU_TYPE-pkg-config" +else + CC=gcc + PKG_CONFIG=pkg-config +fi + +CFLAGS="-Wall -g -O2 -D_GNU_SOURCE" +LIBS=$($PKG_CONFIG --cflags --libs libpci) + +cd "$AUTOPKGTEST_TMP" + +cat <test-libpci.c +#include + +int main(void) +{ + struct pci_access *a; + a = pci_alloc(); + pci_init(a); + pci_cleanup(a); + return 0; +} +EOF + +# Test building minimal code against the installed library. +$CC $CFLAGS -o test-dynamic test-libpci.c $LIBS + test -x ./test-dynamic +./test-dynamic -- cgit v1.2.3