From cb8519dba094def1d82afa88f9cb24aa6e3fb6d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Thu, 23 Apr 2020 19:25:08 +0200
Subject: [PATCH] Set WINEPATH for tests, and remove symlink workaround.

---
 ChangeLog              |  7 +++++++
 examples/setup-env     |  9 ---------
 examples/teardown-env  |  6 ------
 run-tests              |  4 ++++
 testsuite/setup-env    | 12 ------------
 testsuite/teardown-env |  6 ------
 6 files changed, 11 insertions(+), 33 deletions(-)
 delete mode 100755 testsuite/setup-env

diff --git a/ChangeLog b/ChangeLog
index e900fb02..c14cec83 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2020-04-23  Niels Möller  <nisse@lysator.liu.se>
 
+	* run-tests: Set WINEPATH, since it appears wine doesn't search
+	for dlls in the unix PATH.
+	* examples/setup-env: Delete creation of extra dll symlinks.
+	* examples/teardown-env: Delete corresponding cleanup.
+	* testsuite/setup-env: Deleted file (same symlink creation).
+	* testsuite/teardown-env: Delete corresponding cleanup.
+
 	* testsuite/ecc-add-test.c (test_main): Delete ASSERTs with
 	functions pointer comparisons. They provide little value, and fail
 	when linking with hogweed.dll on windows.
diff --git a/examples/setup-env b/examples/setup-env
index e59b283c..3ebef2c8 100755
--- a/examples/setup-env
+++ b/examples/setup-env
@@ -2,15 +2,6 @@
 
 set -e
 
-# Workaround, it seems difficult to convince wine to put ../lib into PATH.
-case "$EMULATOR" in
-    wine*)
-	for f in ../.lib/*.dll ; do
-	  ln -sf "$f" .
-	done
-	;;
-esac
-
 if [ -x rsa-keygen$EXEEXT ] ; then
   $EMULATOR ./rsa-keygen -r rsa-decrypt$EXEEXT -o testkey || exit 1
 fi
diff --git a/examples/teardown-env b/examples/teardown-env
index 0b0e040e..36c113f6 100755
--- a/examples/teardown-env
+++ b/examples/teardown-env
@@ -3,9 +3,3 @@
 rm -rf testkey testkey.pub testsignature testsignature2 \
     testdata testtmp \
     testciphertext testcleartext
-
-case "$EMULATOR" in
-    wine*)
-	find . -type l -name '*.dll' -exec rm -f '{}' ';'
-	;;
-esac
diff --git a/run-tests b/run-tests
index 5186d0c8..c44903f6 100755
--- a/run-tests
+++ b/run-tests
@@ -35,9 +35,13 @@ if [ -n "$TEST_SHLIB_DIR" ] ; then
   DYLD_LIBRARY_PATH="$TEST_SHLIB_DIR"
   # For Windows
   PATH="${TEST_SHLIB_DIR}:${PATH}"
+  # For Wine
+  WINEPATH="${TEST_SHLIB_DIR}"
+
   export LD_LIBRARY_PATH
   export DYLD_LIBRARY_PATH
   export PATH
+  export WINEPATH
 fi
 
 # When used in make rules, we sometimes get the filenames VPATH
diff --git a/testsuite/setup-env b/testsuite/setup-env
deleted file mode 100755
index bb3e3c5d..00000000
--- a/testsuite/setup-env
+++ /dev/null
@@ -1,12 +0,0 @@
-#! /bin/sh
-
-set -e
-
-# Workaround, it seems difficult to convince wine to put ../lib into PATH.
-case "$EMULATOR" in
-    wine*)
-	for f in ../.lib/*.dll ; do
-	  ln -sf "$f" .
-	done
-	;;
-esac
diff --git a/testsuite/teardown-env b/testsuite/teardown-env
index 671a06ca..f19bbe9c 100755
--- a/testsuite/teardown-env
+++ b/testsuite/teardown-env
@@ -1,9 +1,3 @@
 #! /bin/sh
 
 rm -rf testkey.priv testkey.pub testtmp testsignature testsignature2
-
-case "$EMULATOR" in
-    wine*)
-	find . -type l -name '*.dll' -exec rm -f '{}' ';'
-	;;
-esac
-- 
GitLab