From d962d64b29b51e404abebd8386375e6b3b306edb Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Fri, 22 Jan 2016 13:43:10 +0100 Subject: [PATCH] tests: Add script to build a CD with the test environment. * tests/make-windows-cd.sh: New file. * tests/run-tests.bat: Likewise. -- This makes it easy to deploy GnuPG with the test suite to a virtual machine for testing. Signed-off-by: Justus Winter --- tests/make-windows-cd.sh | 32 ++++++++++++++++++++++++++++++++ tests/run-tests.bat | 25 +++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 tests/make-windows-cd.sh create mode 100644 tests/run-tests.bat diff --git a/tests/make-windows-cd.sh b/tests/make-windows-cd.sh new file mode 100644 index 000000000..f4c686a12 --- /dev/null +++ b/tests/make-windows-cd.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +set -e + +if ! [ -f config.log ] || ! grep -q mingw config.log; then + echo "must be run from a configured windows build environment" +fi + +[ -z "$w32root" ] && w32root="$HOME/w32root" +ADDITIONAL_FILES= +IMAGE=gnupg-test.iso + +[ -f make-windows-cd.rc ] && . make-windows-cd.rc + +# we pick binaries from the prefix, so make sure they are current. +make install + +WORKDIR="$(mktemp --directory)" +TARGET="${WORKDIR}/gnupg" + +mkdir "$TARGET" + +[ "$ADDITIONAL_FILES" ] && cp -v $(ls -1 $ADDITIONAL_FILES) $TARGET +cp -v $w32root/bin/*.exe $w32root/bin/*.dll $TARGET +cp -v tests/gpgscm/*.exe $TARGET +cp -v tools/mk-tdata.exe $TARGET +cp -v agent/gpg-preset-passphrase.exe $TARGET +cp -v -a ../tests $TARGET +cp -v tests/openpgp/fake-pinentry.exe $TARGET/tests/openpgp +cp -v ../tests/run-tests.bat $WORKDIR +genisoimage --output "$IMAGE" -J "$WORKDIR" +[ "${WORKDIR}" ] && rm -rf -- "${WORKDIR}" diff --git a/tests/run-tests.bat b/tests/run-tests.bat new file mode 100644 index 000000000..ceb2fabab --- /dev/null +++ b/tests/run-tests.bat @@ -0,0 +1,25 @@ +@echo off +cd /d d:\ + +set TARGET=gnupg-test + +set GNUPGHOME=c:/%TARGET%/tests/openpgp +c:/%TARGET%/gpg-connect-agent.exe killagent /bye +rem is there a nicer way to sleep? +ping -n 1 localhost > nul +set GNUPGHOME= + +rmdir /q /s c:\%TARGET% +mkdir c:\%TARGET% +xcopy /q /s d:\gnupg c:\%TARGET% + +set GPGSCM_PATH=c:/%TARGET%/tests/gpgscm;c:/%TARGET%/tests/openpgp +set EXEEXT=.exe +set srcdir=/%TARGET%/tests/openpgp +set BIN_PREFIX=c:/%TARGET% + +cd /d c:\%TARGET% +c:\%TARGET%\gpgscm.exe --verbose tests/gpgscm/t-child.scm + +cd /d c:\%TARGET%\tests\openpgp +c:\%TARGET%\gpgscm.exe run-tests.scm