Debian Codegraph @

debian/tests/libgphobos-link

raw symbols SCIP
1 #!/bin/sh
2 # autopkgtest check: Build and run a simple program against libgphobos,
3 # to verify basic compile-time and run-time linking functionality.
4
5 set -e
6
7 GDC=gdc-12
8
9 if ! dpkg -l libgphobos-12-dev >/dev/null 2>&1; then
10 echo "skip test on architecture without libgphobos-dev"
11 exit 0
12 fi
13
14 WORKDIR=$(mktemp -d)
15 trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
16 cd $WORKDIR
17 cat <<EOF > libgphobos.d
18 immutable str = "Hello, World!";
19
20 void main()
21 {
22 // Scoped and selective imports can be used.
23 import std.stdio : writeln;
24 writeln(str);
25 }
26 EOF
27
28 $GDC -o dtest libgphobos.d
29 echo "build: OK"
30 ldd dtest
31 [ -x dtest ]
32 ./dtest
33 echo "run: OK"