From 3f472a4e5ca21e3ddb13737473e636b2b11a408a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:22:56 +0200 Subject: Adding debian version 13.2.0-10. Signed-off-by: Daniel Baumann --- debian/tests/control | 31 ++++++++++++++++++ debian/tests/libc-link | 30 +++++++++++++++++ debian/tests/libgfortran-link | 22 +++++++++++++ debian/tests/libgm2-link | 26 +++++++++++++++ debian/tests/libgnat-link | 24 ++++++++++++++ debian/tests/libgo-link | 25 ++++++++++++++ debian/tests/libgomp-link | 76 +++++++++++++++++++++++++++++++++++++++++++ debian/tests/libgphobos-link | 32 ++++++++++++++++++ debian/tests/libstdcxx-link | 26 +++++++++++++++ debian/tests/runtime-libs | 29 +++++++++++++++++ debian/tests/shlib-build | 45 +++++++++++++++++++++++++ 11 files changed, 366 insertions(+) create mode 100644 debian/tests/control create mode 100755 debian/tests/libc-link create mode 100755 debian/tests/libgfortran-link create mode 100755 debian/tests/libgm2-link create mode 100755 debian/tests/libgnat-link create mode 100755 debian/tests/libgo-link create mode 100755 debian/tests/libgomp-link create mode 100755 debian/tests/libgphobos-link create mode 100755 debian/tests/libstdcxx-link create mode 100755 debian/tests/runtime-libs create mode 100755 debian/tests/shlib-build (limited to 'debian/tests') diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..2602301 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,31 @@ +Tests: runtime-libs +Depends: apt, python3-minimal +Restrictions: allow-stderr + +Tests: libc-link +Depends: gcc-13, libc6-dev | libc-dev + +Tests: libstdcxx-link +Depends: g++-13 + +Tests: libgfortran-link +Depends: gfortran-13 + +Tests: libgo-link +Depends: gccgo-13 + +Tests: libgomp-link +Depends: gfortran-13, gcc-13 + +Tests: libgm2-link +Depends: gm2-13 + +Tests: libgnat-link +Depends: gnat-13 + +Tests: libgphobos-link +Depends: gdc-13 +Architecture: !powerpc !ppc64 !ppc64el + +Tests: shlib-build +Depends: gcc-13, libc6-dev | libc-dev diff --git a/debian/tests/libc-link b/debian/tests/libc-link new file mode 100755 index 0000000..fbe4224 --- /dev/null +++ b/debian/tests/libc-link @@ -0,0 +1,30 @@ +#!/bin/sh +# autopkgtest check: Build and run a simple program against libc, to verify +# basic compile-time and run-time linking functionality. +# +# (C) 2012 Canonical Ltd. +# Author: Martin Pitt + +set -e + +BV=$(sed '/^Depends: gcc-\([0-9.]\+\).*/!d;s//\1/;q' debian/tests/control) +CC=gcc-$BV + +cd "$AUTOPKGTEST_TMP" +cat < libctest.c +#include +#include + +int main() +{ + assert (1 > 0); + assert (strcmp ("hello", "hello") == 0); + return 0; +} +EOF + +$CC -o libctest libctest.c +echo "build: OK" +[ -x libctest ] +./libctest +echo "run: OK" diff --git a/debian/tests/libgfortran-link b/debian/tests/libgfortran-link new file mode 100755 index 0000000..70bf6b2 --- /dev/null +++ b/debian/tests/libgfortran-link @@ -0,0 +1,22 @@ +#!/bin/sh +# autopkgtest check: Build and run a simple program against libgfortran, +# to verify basic compile-time and run-time linking functionality. + +set -e + +BV=$(sed '/^Depends: gcc-\([0-9.]\+\).*/!d;s//\1/;q' debian/tests/control) +F95=gfortran-$BV + +cd "$AUTOPKGTEST_TMP" +cat < libgfortran.f + program hello + print *, "Hello World!" + end program hello +EOF + +$F95 -o ftest libgfortran.f +echo "build: OK" +ldd ftest +[ -x ftest ] +./ftest +echo "run: OK" diff --git a/debian/tests/libgm2-link b/debian/tests/libgm2-link new file mode 100755 index 0000000..2f975c3 --- /dev/null +++ b/debian/tests/libgm2-link @@ -0,0 +1,26 @@ +#!/bin/sh +# autopkgtest check: Build and run a simple program against libgo, +# to verify basic compile-time and run-time linking functionality. + +set -e + +BV=$(sed '/^Depends: gcc-\([0-9.]\+\).*/!d;s//\1/;q' debian/tests/control) +GM2=gm2-$BV + +cd "$AUTOPKGTEST_TMP" +cat < hello.mod +MODULE hello ; + +FROM StrIO IMPORT WriteString, WriteLn ; + +BEGIN + WriteString ('hello world') ; WriteLn +END hello. +EOF + +$GM2 -g -o hello hello.mod +echo "build: OK" +ldd hello +[ -x hello ] +./hello +echo "run: OK" diff --git a/debian/tests/libgnat-link b/debian/tests/libgnat-link new file mode 100755 index 0000000..c357a55 --- /dev/null +++ b/debian/tests/libgnat-link @@ -0,0 +1,24 @@ +#!/bin/sh +# autopkgtest check: Build and run a simple program against libgnat, +# to verify basic compile-time and run-time linking functionality. + +set -e + +BV=$(sed '/^Depends: gcc-\([0-9.]\+\).*/!d;s//\1/;q' debian/tests/control) +GNATMAKE=gnatmake-$BV + +cd "$AUTOPKGTEST_TMP" +cat < hello.adb +with Ada.Text_IO; use Ada.Text_IO; +procedure Hello is +begin + Put_Line("Hello gnatmake."); +end Hello; +EOF + +$GNATMAKE -eS -vm -o adatest hello.adb +echo "build: OK" +ldd adatest +[ -x adatest ] +./adatest +echo "run: OK" diff --git a/debian/tests/libgo-link b/debian/tests/libgo-link new file mode 100755 index 0000000..76a3f2a --- /dev/null +++ b/debian/tests/libgo-link @@ -0,0 +1,25 @@ +#!/bin/sh +# autopkgtest check: Build and run a simple program against libgo, +# to verify basic compile-time and run-time linking functionality. + +set -e + +BV=$(sed '/^Depends: gcc-\([0-9.]\+\).*/!d;s//\1/;q' debian/tests/control) +GO=go-$BV + +cd "$AUTOPKGTEST_TMP" +cat < hello.go +package main +import "fmt" +func main() { + fmt.Println("hello world") +} +EOF + +$GO run hello.go +$GO build hello.go +echo "build: OK" +ldd hello +[ -x hello ] +./hello +echo "run: OK" diff --git a/debian/tests/libgomp-link b/debian/tests/libgomp-link new file mode 100755 index 0000000..ec7dbc4 --- /dev/null +++ b/debian/tests/libgomp-link @@ -0,0 +1,76 @@ +#!/bin/sh +# autopkgtest check: Build and run a simple program against libgfortran, +# to verify basic compile-time and run-time linking functionality. + +set -e + +BV=$(sed '/^Depends: gcc-\([0-9.]\+\).*/!d;s//\1/;q' debian/tests/control) +CC=gcc-$BV +F95=gfortran-$BV + +cd "$AUTOPKGTEST_TMP" +cat < hello-gomp.c +#include +#include +#include +int main (int argc, char *argv[]) { + +int nthreads, tid; + +/* Fork a team of threads giving them their own copies of variables */ +#pragma omp parallel private(nthreads, tid) + { + + /* Obtain thread number */ + tid = omp_get_thread_num(); + printf("Hello World from thread = %d\n", tid); + + /* Only master thread does this */ + if (tid == 0) + { + nthreads = omp_get_num_threads(); + printf("Number of threads = %d\n", nthreads); + } + + } /* All threads join master thread and disband */ +} +EOF + +$CC -fopenmp -o gctest hello-gomp.c +echo "build: OK" +ldd gctest +[ -x gctest ] +./gctest +echo "run: OK" + +cat < hello-gomp.f + program omp_par_do + implicit none + + integer, parameter :: n = 100 + real, dimension(n) :: dat, result + integer :: i + + !$OMP PARALLEL DO + do i = 1, n + result(i) = my_function(dat(i)) + end do + !$OMP END PARALLEL DO + + contains + + function my_function(d) result(y) + real, intent(in) :: d + real :: y + + ! do something complex with data to calculate y + end function my_function + end program omp_par_do +EOF + +$F95 -fopenmp -o gftest hello-gomp.f +echo "build: OK" +ldd gftest +[ -x gftest ] +./gftest +echo "run: OK" diff --git a/debian/tests/libgphobos-link b/debian/tests/libgphobos-link new file mode 100755 index 0000000..8c1fe26 --- /dev/null +++ b/debian/tests/libgphobos-link @@ -0,0 +1,32 @@ +#!/bin/sh +# autopkgtest check: Build and run a simple program against libgphobos, +# to verify basic compile-time and run-time linking functionality. + +set -e + +BV=$(sed '/^Depends: gcc-\([0-9.]\+\).*/!d;s//\1/;q' debian/tests/control) +GDC=gdc-$BV + +if ! dpkg -l libgphobos-$BV-dev >/dev/null 2>&1; then + echo "skip test on architecture without libgphobos-dev" + exit 0 +fi + +cd "$AUTOPKGTEST_TMP" +cat < libgphobos.d +immutable str = "Hello, World!"; + +void main() +{ + // Scoped and selective imports can be used. + import std.stdio : writeln; + writeln(str); +} +EOF + +$GDC -o dtest libgphobos.d +echo "build: OK" +ldd dtest +[ -x dtest ] +./dtest +echo "run: OK" diff --git a/debian/tests/libstdcxx-link b/debian/tests/libstdcxx-link new file mode 100755 index 0000000..ca39928 --- /dev/null +++ b/debian/tests/libstdcxx-link @@ -0,0 +1,26 @@ +#!/bin/sh +# autopkgtest check: Build and run a simple program against libstdc++, +# to verify basic compile-time and run-time linking functionality. + +set -e + +BV=$(sed '/^Depends: gcc-\([0-9.]\+\).*/!d;s//\1/;q' debian/tests/control) +CXX=g++-$BV + +cd "$AUTOPKGTEST_TMP" +cat < libstdcxx.cc +#include +using namespace std; + +int main() { + cout << "Hello! World!\n"; + return 0; +} +EOF + +$CXX -o cxxtest libstdcxx.cc +echo "build: OK" +ldd cxxtest +[ -x cxxtest ] +./cxxtest +echo "run: OK" diff --git a/debian/tests/runtime-libs b/debian/tests/runtime-libs new file mode 100755 index 0000000..b849ae1 --- /dev/null +++ b/debian/tests/runtime-libs @@ -0,0 +1,29 @@ +#!/bin/sh +# autopkgtest check: start a "simple" program and check that +# dynamic loading of modules works + +set -e + + +cd "$AUTOPKGTEST_TMP" + +echo "Running exexutable linked with libgcc and libstdc++ (apt)..." +if [ -x /usr/bin/apt ]; then + apt=/usr/bin/apt +elif [ -x /bin/apt ]; then + apt=/bin/apt +else + echo "apt not found" + exit 1 +fi + +ldd $apt +apt show libgcc-s1 libstdc++6 + +echo "Running dynamically linked executable (python3)..." +python3 -c 'print("Hello World!")' +echo "OK" + +echo "Loading extension module..." +python3 -c 'import _hashlib; print(_hashlib.__dict__)' +echo "OK" diff --git a/debian/tests/shlib-build b/debian/tests/shlib-build new file mode 100755 index 0000000..751fadf --- /dev/null +++ b/debian/tests/shlib-build @@ -0,0 +1,45 @@ +#!/bin/sh +# autopkgtest check: Build and link against a simple shared library, to test +# basic binutils compile-time and run-time linking functionality. +# +# (C) 2012 Canonical Ltd. +# Author: Martin Pitt + +set -e + +BV=$(sed '/^Depends: gcc-\([0-9.]\+\).*/!d;s//\1/;q' debian/tests/control) +CC=gcc-$BV + +cd "$AUTOPKGTEST_TMP" +cat < testlib.c + +int ultimate_answer() +{ + return 42; +} +EOF + +$CC -Wall -Werror -shared -o libultimate.so testlib.c +echo "library build: OK" + +# should export the symbol +nm -D libultimate.so | grep -q 'T ultimate_answer' + +# link it against a program +cat < testprog.c +#include + +int ultimate_answer(); + +int main() +{ + assert (ultimate_answer() == 42); + return 0; +} +EOF + +$CC -Wall -Werror -L . -o testprog testprog.c -lultimate +echo "program build: OK" +[ -x testprog ] +LD_LIBRARY_PATH=. ./testprog +echo "run: OK" -- cgit v1.2.3