From 75406f26e26d5c7a454a35e7b74df315b44db46c Mon Sep 17 00:00:00 2001
From: Simon Rose <simon.rose@ess.eu>
Date: Thu, 4 May 2023 09:06:40 +0200
Subject: [PATCH] Run tests using debug architecture if available and specified

---
 configure/E3/CONFIG_TEST | 1 +
 configure/E3/RULES_TEST  | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/configure/E3/CONFIG_TEST b/configure/E3/CONFIG_TEST
index 473f4381..e8494bcf 100644
--- a/configure/E3/CONFIG_TEST
+++ b/configure/E3/CONFIG_TEST
@@ -11,5 +11,6 @@ VARS_EXCLUDES+=RMDIR
 VARS_EXCLUDES+=TEMP_CELL_PATH
 
 ifneq (,$(findstring test,$(MAKECMDGOALS)))
+  TEST_DEBUG_ARCH:=$(if $(and $(findstring debug,$(EPICS_HOST_ARCH)),$(wildcard $(EPICS_BASE)/bin/$(EPICS_HOST_ARCH)/softIocPVA)),$(EPICS_HOST_ARCH))
   E3_MODULES_PATH=$(TEMP_CELL_PATH)/$(notdir $(EPICS_BASE))/require-$(E3_REQUIRE_VERSION)
 endif
diff --git a/configure/E3/RULES_TEST b/configure/E3/RULES_TEST
index f542ecb6..148d424b 100644
--- a/configure/E3/RULES_TEST
+++ b/configure/E3/RULES_TEST
@@ -5,6 +5,10 @@ test:
 ifeq ($(shell command -v run-iocsh > /dev/null 2>&1 ; echo $$?),0)
 
 test: temp_install run_test module_tests cleanup_test
+ifneq ($(strip $(TEST_DEBUG_ARCH)),)
+run_test: EPICS_HOST_ARCH = $(TEST_DEBUG_ARCH)
+module_tests: EPICS_HOST_ARCH = $(TEST_DEBUG_ARCH)
+endif
 
 .PHONY: temp_install
 temp_install:
-- 
GitLab