tests: skip test execution when cross-compiling
PATCH 1/1 tests: skip test execution when cross-compiling
From: Haixiao Yan <[email protected]...>
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.
--- tests/unit_tests/plugins/auth-pam/Makefile.am | 2 ++ 1 file changed, 2 insertions(+)
tests/unit_tests/plugins/auth-pam/Makefile.am +2 -0
@@ -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
Signature · 1 line
2.43.0
Quoted 16 lines · haixiao.yan.cn--- via Openvpn-devel
From: Haixiao Yan <[email protected]...>
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 <[email protected]...>--- tests/unit_tests/plugins/auth-pam/Makefile.am | 2 ++ 1 file changed, 2 insertions(+)tests/unit_tests/plugins/auth-pam/Makefile.am +0
-0
tests/unit_tests/plugins/auth-pam/Makefile.am AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING) auth_pam Plugin Unit-Tests · line 10
Quoted 7 lines
tests/unit_tests/plugins/auth-pam/Makefile.am +2
-0@@ -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
Makes sense and is consistent with existing Makefile.am files in example_test and openvpn.
Regards,
Signature · 1 line
Frank Lichtenheld
Thanks for finding that bug, and letting us know.
Your patch has been applied to the master and release/2.7 branch (bugfix).
commit 690aace41a68292412da3f313389e79d4a12bfbc (master) commit 66989b384dc0056e89942bfa0a1546a2644f7831 (release/2.7)
Author: Haixiao Yan Date: Thu Mar 26 14:20:16 2026 +0800
tests: skip test execution when cross-compiling
Signed-off-by: Haixiao Yan <[email protected]...>
Acked-By: Frank Lichtenheld <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg36288.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering