[Openvpn-devel,v2] automake: Add build-tests recursive target

Message ID 20261020152730.4293-1-gert@greenie.muc.de
State New
Headers
Series [Openvpn-devel,v2] automake: Add build-tests recursive target |

Commit Message

Gert Doering Oct. 20, 2026, 3:27 p.m. UTC
  From: Frank Lichtenheld <frank@lichtenheld.com>

So that we can build unit-tests without running them.
Something automake doesn't seem to offer out of the
box.

Change-Id: I149d0ba7011e62a115a565813e1f5873907d464e
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Razvan Cojocaru <razvanc@mailbox.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2022
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2022
This mail reflects revision 2 of this Change.

Acked-by according to Gerrit (reflected above):
Razvan Cojocaru <razvanc@mailbox.org>
  

Patch

diff --git a/configure.ac b/configure.ac
index 52b0d20..8bf2c8a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,6 +47,8 @@ 
 AC_CANONICAL_HOST
 AC_USE_SYSTEM_EXTENSIONS
 
+AM_EXTRA_RECURSIVE_TARGETS([build-tests])
+
 AX_CODE_COVERAGE
 
 AC_ARG_ENABLE(
diff --git a/tests/unit_tests/example_test/Makefile.am b/tests/unit_tests/example_test/Makefile.am
index 1ae80c8..942e9d1 100644
--- a/tests/unit_tests/example_test/Makefile.am
+++ b/tests/unit_tests/example_test/Makefile.am
@@ -15,3 +15,5 @@ 
 example2_testdriver_CFLAGS  = @TEST_CFLAGS@
 example2_testdriver_LDFLAGS = @TEST_LDFLAGS@
 example2_testdriver_SOURCES = test2.c
+
+build-tests-local: $(check_PROGRAMS)
diff --git a/tests/unit_tests/openvpn/Makefile.am b/tests/unit_tests/openvpn/Makefile.am
index 38299f5..43a6743 100644
--- a/tests/unit_tests/openvpn/Makefile.am
+++ b/tests/unit_tests/openvpn/Makefile.am
@@ -445,3 +445,5 @@ 
 	$(top_srcdir)/src/openvpn/env_set.c \
 	$(top_srcdir)/src/openvpn/run_command.c \
 	$(top_srcdir)/src/openvpn/socket_util.c
+
+build-tests-local: $(check_PROGRAMS)
diff --git a/tests/unit_tests/openvpnserv/Makefile.am b/tests/unit_tests/openvpnserv/Makefile.am
index 19de666..210c9e6 100644
--- a/tests/unit_tests/openvpnserv/Makefile.am
+++ b/tests/unit_tests/openvpnserv/Makefile.am
@@ -14,3 +14,5 @@ 
 	$(top_srcdir)/src/openvpnserv/validate.c \
 	$(top_srcdir)/src//openvpn/wfp_block.c \
 	$(top_srcdir)/src//openvpn/wfp_block.h
+
+build-tests-local: $(check_PROGRAMS)
diff --git a/tests/unit_tests/plugins/auth-pam/Makefile.am b/tests/unit_tests/plugins/auth-pam/Makefile.am
index 7da299c..fd7cf91 100644
--- a/tests/unit_tests/plugins/auth-pam/Makefile.am
+++ b/tests/unit_tests/plugins/auth-pam/Makefile.am
@@ -12,3 +12,5 @@ 
 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
 auth_pam_testdriver_LDFLAGS = @TEST_LDFLAGS@
+
+build-tests-local: $(check_PROGRAMS)