[Openvpn-devel] tests: skip test execution when cross-compiling

Message ID 20260326062016.3856597-1-haixiao.yan.cn@windriver.com
State New
Headers show
Series [Openvpn-devel] tests: skip test execution when cross-compiling | expand

Commit Message

haixiao.yan.cn--- via Openvpn-devel March 26, 2026, 6:20 a.m. UTC
From: Haixiao Yan <haixiao.yan.cn@windriver.com>

The auth-pam unit test Makefile.am unconditionally assigns the TESTS variable,
causing test execution to fail during cross-compilation because the target
binaries are not executable on the build host.

Signed-off-by: Haixiao Yan <haixiao.yan.cn@windriver.com>
---
 tests/unit_tests/plugins/auth-pam/Makefile.am | 2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/tests/unit_tests/plugins/auth-pam/Makefile.am b/tests/unit_tests/plugins/auth-pam/Makefile.am
index ba32013ac920..7da299ccde92 100644
--- a/tests/unit_tests/plugins/auth-pam/Makefile.am
+++ b/tests/unit_tests/plugins/auth-pam/Makefile.am
@@ -4,8 +4,10 @@  AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING) auth_pam Plugin Unit-Tests
 
 if ENABLE_PLUGIN_AUTH_PAM
 check_PROGRAMS = auth_pam_testdriver
+if !CROSS_COMPILING
 TESTS = $(check_PROGRAMS)
 endif
+endif
 
 auth_pam_testdriver_SOURCES = test_search_and_replace.c  $(top_srcdir)/src/plugins/auth-pam/utils.h $(top_srcdir)/src/plugins/auth-pam/utils.c
 auth_pam_testdriver_CFLAGS  = @TEST_CFLAGS@ -I$(top_srcdir)/src/plugins/auth-pam