Debian Codegraph @

debian/tests/build

raw symbols SCIP
1 #!/bin/sh
2 # autopkgtest check: Build and run a simple program against GLFW 3
3
4 set -e
5
6 # Require $AUTOPKGTEST_TMP for temporary build files
7 if [ -z "$AUTOPKGTEST_TMP" ]
8 then
9 echo "Required envvar \"$AUTOPKGTEST_TMP\"is not set" >&2
10 exit 1
11 fi
12
13 # Copy test program to AUTOPKGTEST_TMP and cd there
14 cp debian/tests/glfw3_test.c "$AUTOPKGTEST_TMP"
15 cd "$AUTOPKGTEST_TMP"
16
17 # Build programs - once with raw libraries and once with pkg-config
18 gcc -Wall -Werror -o glfw3_test1 glfw3_test.c -lglfw
19 echo "build1: OK"
20 gcc -Wall -Werror -o glfw3_test2 glfw3_test.c $(pkg-config --cflags --libs glfw3)
21 echo "build2: OK"
22
23 # Run them - ensure the correct version is reported
24 GLFW_VERSION=$(dpkg-query -f '${Version}\n' -W libglfw3-dev | \
25 sed 's/[^.0-9].*//' | sed 's/^[0-9]*\.[0-9]*$/&.0/')
26
27 TEST1_RESULT=$(./glfw3_test1)
28 echo $TEST1_RESULT
29 [ $(echo $TEST1_RESULT | cut -f 1 -d' ') = $GLFW_VERSION ]
30 echo "run1: OK"
31
32 TEST2_RESULT=$(./glfw3_test2)
33 echo $TEST2_RESULT
34 [ $(echo $TEST2_RESULT | cut -f 1 -d' ') = $GLFW_VERSION ]
35 echo "run2: OK"