| 1 | #!/bin/bash |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | ARCH="$1" |
| 6 | |
| 7 | if [ "$ARCH" = x86_64 ]; then |
| 8 | WINE=/usr/lib/wine/wine64 |
| 9 | export WINESERVER=/usr/lib/wine/wineserver64 |
| 10 | elif [ "$ARCH" = i686 ]; then |
| 11 | WINE=/usr/lib/wine/wine |
| 12 | export WINESERVER=/usr/lib/wine/wineserver32 |
| 13 | else |
| 14 | printf >&2 'Unknown Architecture: %s\n' "$ARCH" |
| 15 | exit 1 |
| 16 | fi |
| 17 | GCC="${ARCH}-w64-mingw32-gcc" |
| 18 | |
| 19 | # get wine initialized, which normally spews logs to stderr |
| 20 | # (autopkgtest doesn't want stderr) |
| 21 | "$WINE" hostname 2>&1 |
| 22 | |
| 23 | if [ `dpkg --print-architecture` = 'arm64' ] ; then |
| 24 | echo "Don't fail testsuite on arm64, this test always failed there" |
| 25 | exit 0 |
| 26 | fi |
| 27 | |
| 28 | export PKG_CONFIG_PATH="/usr/${ARCH}-w64-mingw32/lib/pkgconfig" |
| 29 | |
| 30 | # see https://dev.gnupg.org/T4624 for why this is needed |
| 31 | extra_libs=(-lws2_32) |
| 32 | |
| 33 | # build a static windows binary around libassuan and run it: |
| 34 | "$GCC" -pedantic -Wall -Werror -static -o test-run.exe debian/tests/simple-build.c $(pkg-config --cflags --static --libs libassuan gpg-error) "${extra_libs[@]}" |
| 35 | "$WINE" ./test-run.exe |
| 36 | rm -f ./test-run.exe |