initial import from Debian
version: 14.3.0-5 commit: bee30ab0fff2fd6af94c62376c8aa4221bb831e0
This commit is contained in:
31
debian/tests/control
vendored
Normal file
31
debian/tests/control
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
Tests: runtime-libs
|
||||
Depends: apt, python3-minimal
|
||||
Restrictions: allow-stderr
|
||||
|
||||
Tests: libc-link
|
||||
Depends: gcc-14, libc6-dev | libc-dev
|
||||
|
||||
Tests: libstdcxx-link
|
||||
Depends: g++-14
|
||||
|
||||
Tests: libgfortran-link
|
||||
Depends: gfortran-14
|
||||
|
||||
Tests: libgo-link
|
||||
Depends: gccgo-14
|
||||
|
||||
Tests: libgomp-link
|
||||
Depends: gfortran-14, gcc-14
|
||||
|
||||
Tests: libgm2-link
|
||||
Depends: gm2-14
|
||||
|
||||
Tests: libgnat-link
|
||||
Depends: gnat-14
|
||||
|
||||
Tests: libgphobos-link
|
||||
Depends: gdc-14
|
||||
Architecture: !powerpc !ppc64 !ppc64el
|
||||
|
||||
Tests: shlib-build
|
||||
Depends: gcc-14, libc6-dev | libc-dev
|
30
debian/tests/libc-link
vendored
Executable file
30
debian/tests/libc-link
vendored
Executable file
@@ -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 <martin.pitt@ubuntu.com>
|
||||
|
||||
set -e
|
||||
|
||||
BV=$(sed '/^Depends: gcc-\([0-9.]\+\).*/!d;s//\1/;q' debian/tests/control)
|
||||
CC=gcc-$BV
|
||||
|
||||
cd "$AUTOPKGTEST_TMP"
|
||||
cat <<EOF > libctest.c
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
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"
|
22
debian/tests/libgfortran-link
vendored
Executable file
22
debian/tests/libgfortran-link
vendored
Executable file
@@ -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 <<EOF > 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"
|
26
debian/tests/libgm2-link
vendored
Executable file
26
debian/tests/libgm2-link
vendored
Executable file
@@ -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 <<EOF > 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"
|
24
debian/tests/libgnat-link
vendored
Executable file
24
debian/tests/libgnat-link
vendored
Executable file
@@ -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 <<EOF > 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"
|
25
debian/tests/libgo-link
vendored
Executable file
25
debian/tests/libgo-link
vendored
Executable file
@@ -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 <<EOF > 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"
|
76
debian/tests/libgomp-link
vendored
Executable file
76
debian/tests/libgomp-link
vendored
Executable file
@@ -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 <<EOF > hello-gomp.c
|
||||
#include <omp.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
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 <<EOF > 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"
|
32
debian/tests/libgphobos-link
vendored
Executable file
32
debian/tests/libgphobos-link
vendored
Executable file
@@ -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 <<EOF > 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"
|
26
debian/tests/libstdcxx-link
vendored
Executable file
26
debian/tests/libstdcxx-link
vendored
Executable file
@@ -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 <<EOF > libstdcxx.cc
|
||||
#include <iostream>
|
||||
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"
|
29
debian/tests/runtime-libs
vendored
Executable file
29
debian/tests/runtime-libs
vendored
Executable file
@@ -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"
|
45
debian/tests/shlib-build
vendored
Executable file
45
debian/tests/shlib-build
vendored
Executable file
@@ -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 <martin.pitt@ubuntu.com>
|
||||
|
||||
set -e
|
||||
|
||||
BV=$(sed '/^Depends: gcc-\([0-9.]\+\).*/!d;s//\1/;q' debian/tests/control)
|
||||
CC=gcc-$BV
|
||||
|
||||
cd "$AUTOPKGTEST_TMP"
|
||||
cat <<EOF > 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 <<EOF > testprog.c
|
||||
#include <assert.h>
|
||||
|
||||
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"
|
Reference in New Issue
Block a user