Skip to contentSkip to conversation

Change in openvpn[master]: unit_tests: Remove useless wrapping for argv/buffer tests

Openvpn-devel In review flichtenheld (Code Review) 2 participants 7 messages Sep 30, 2025 – Oct 7, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1759239739000.I937105abeb5e8f796bf6bbe8432972adb60b3e2a@...2715...

#1 lore raw

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1243?usp=email

to review the following change.

Change subject: unit_tests: Remove useless wrapping for argv/buffer tests
......................................................................

unit_tests: Remove useless wrapping for argv/buffer tests

If not using mock() or check_expected(), and
not linking the original function, then there
is no need for wrapping support.

Change-Id I937105abeb5e8f796bf6bbe8432972adb60b3e2a

---
M CMakeLists.txt
M tests/unit_tests/openvpn/Makefile.am
M tests/unit_tests/openvpn/test_argv.c

3 files changed, 11 insertions(+), 14 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/43/1243/1

CMakeLists.txt +5 -8
index be66357..aeef480 100644
@@ -654,6 +654,7 @@
     endif ()
 
     set(unit_tests
+        "test_argv"
         "test_auth_token"
         "test_buffer"
         "test_crypto"
@@ -684,7 +685,6 @@
     # Clang-cl (which is also MSVC) is wrongly detected to support wrap
     if (NOT MSVC AND "${LD_SUPPORTS_WRAP}")
         list(APPEND unit_tests
-            "test_argv"
             "test_tls_crypt"
             )
     endif ()
@@ -887,13 +887,10 @@
         src/openvpn/list.c
         )
 
-    if (TARGET test_argv)
-        target_link_options(test_argv PRIVATE -Wl,--wrap=parse_line)
-        target_sources(test_argv PRIVATE
-            tests/unit_tests/openvpn/mock_get_random.c
-            src/openvpn/argv.c
-            )
-    endif ()
+    target_sources(test_argv PRIVATE
+        tests/unit_tests/openvpn/mock_get_random.c
+        src/openvpn/argv.c
+        )
 
     if (TARGET test_cryptoapi)
         target_sources(test_cryptoapi PRIVATE
tests/unit_tests/openvpn/Makefile.am +4 -4
index ec8cc69..e4749d2 100644
@@ -4,12 +4,12 @@
 
 AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING) Unit-Tests'
 
-test_binaries = crypto_testdriver packet_id_testdriver auth_token_testdriver \
+test_binaries = argv_testdriver buffer_testdriver crypto_testdriver packet_id_testdriver auth_token_testdriver \
 	ncp_testdriver misc_testdriver pkt_testdriver ssl_testdriver \
 	user_pass_testdriver push_update_msg_testdriver provider_testdriver socket_testdriver
 
 if HAVE_LD_WRAP_SUPPORT
-test_binaries += argv_testdriver buffer_testdriver
+test_binaries += options_parse_testdriver
 if !WIN32
 test_binaries += tls_crypt_testdriver
 endif
@@ -36,7 +36,7 @@
 endif
 
 argv_testdriver_CFLAGS  = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@
-argv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn -Wl,--wrap=parse_line
+argv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
 argv_testdriver_SOURCES = test_argv.c \
 	mock_msg.c mock_msg.h test_common.h \
 	mock_get_random.c \
@@ -46,7 +46,7 @@
 	$(top_srcdir)/src/openvpn/argv.c
 
 buffer_testdriver_CFLAGS  = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@
-buffer_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn -Wl,--wrap=parse_line
+buffer_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
 buffer_testdriver_SOURCES = test_buffer.c \
 	mock_msg.c mock_msg.h test_common.h \
 	mock_get_random.c \
tests/unit_tests/openvpn/test_argv.c +2 -2
index a04fabc..25c0371 100644
@@ -22,8 +22,8 @@
 #define SCRIPT_CMD "\"" PATH1 PATH2 "\"" PARAM1 "\"" PARAM2 "\""
 
 int
-__wrap_parse_line(const char *line, char **p, const int n, const char *file, const int line_num,
-                  msglvl_t msglevel, struct gc_arena *gc)
+parse_line(const char *line, char **p, const int n, const char *file, const int line_num,
+           msglvl_t msglevel, struct gc_arena *gc)
 {
     p[0] = PATH1 PATH2;
     p[1] = PARAM1;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1243?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I937105abeb5e8f796bf6bbe8432972adb60b3e2a
Gerrit-Change-Number: 1243
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1243?usp=email

to look at the new patch set (#2).

Change subject: unit_tests: Remove useless wrapping for argv/buffer tests
......................................................................

unit_tests: Remove useless wrapping for argv/buffer tests

If not using mock() or check_expected(), and
not linking the original function, then there
is no need for wrapping support.

Change-Id I937105abeb5e8f796bf6bbe8432972adb60b3e2a

---
M CMakeLists.txt
M tests/unit_tests/openvpn/Makefile.am
M tests/unit_tests/openvpn/test_argv.c

3 files changed, 10 insertions(+), 14 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/43/1243/2

CMakeLists.txt +5 -8
index be66357..aeef480 100644
@@ -654,6 +654,7 @@
     endif ()
 
     set(unit_tests
+        "test_argv"
         "test_auth_token"
         "test_buffer"
         "test_crypto"
@@ -684,7 +685,6 @@
     # Clang-cl (which is also MSVC) is wrongly detected to support wrap
     if (NOT MSVC AND "${LD_SUPPORTS_WRAP}")
         list(APPEND unit_tests
-            "test_argv"
             "test_tls_crypt"
             )
     endif ()
@@ -887,13 +887,10 @@
         src/openvpn/list.c
         )
 
-    if (TARGET test_argv)
-        target_link_options(test_argv PRIVATE -Wl,--wrap=parse_line)
-        target_sources(test_argv PRIVATE
-            tests/unit_tests/openvpn/mock_get_random.c
-            src/openvpn/argv.c
-            )
-    endif ()
+    target_sources(test_argv PRIVATE
+        tests/unit_tests/openvpn/mock_get_random.c
+        src/openvpn/argv.c
+        )
 
     if (TARGET test_cryptoapi)
         target_sources(test_cryptoapi PRIVATE
tests/unit_tests/openvpn/Makefile.am +3 -4
index ec8cc69..f7b1bc8 100644
@@ -4,12 +4,11 @@
 
 AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING) Unit-Tests'
 
-test_binaries = crypto_testdriver packet_id_testdriver auth_token_testdriver \
+test_binaries = argv_testdriver buffer_testdriver crypto_testdriver packet_id_testdriver auth_token_testdriver \
 	ncp_testdriver misc_testdriver pkt_testdriver ssl_testdriver \
 	user_pass_testdriver push_update_msg_testdriver provider_testdriver socket_testdriver
 
 if HAVE_LD_WRAP_SUPPORT
-test_binaries += argv_testdriver buffer_testdriver
 if !WIN32
 test_binaries += tls_crypt_testdriver
 endif
@@ -36,7 +35,7 @@
 endif
 
 argv_testdriver_CFLAGS  = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@
-argv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn -Wl,--wrap=parse_line
+argv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
 argv_testdriver_SOURCES = test_argv.c \
 	mock_msg.c mock_msg.h test_common.h \
 	mock_get_random.c \
@@ -46,7 +45,7 @@
 	$(top_srcdir)/src/openvpn/argv.c
 
 buffer_testdriver_CFLAGS  = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@
-buffer_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn -Wl,--wrap=parse_line
+buffer_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
 buffer_testdriver_SOURCES = test_buffer.c \
 	mock_msg.c mock_msg.h test_common.h \
 	mock_get_random.c \
tests/unit_tests/openvpn/test_argv.c +2 -2
index a04fabc..25c0371 100644
@@ -22,8 +22,8 @@
 #define SCRIPT_CMD "\"" PATH1 PATH2 "\"" PARAM1 "\"" PARAM2 "\""
 
 int
-__wrap_parse_line(const char *line, char **p, const int n, const char *file, const int line_num,
-                  msglvl_t msglevel, struct gc_arena *gc)
+parse_line(const char *line, char **p, const int n, const char *file, const int line_num,
+           msglvl_t msglevel, struct gc_arena *gc)
 {
     p[0] = PATH1 PATH2;
     p[1] = PARAM1;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1243?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I937105abeb5e8f796bf6bbe8432972adb60b3e2a
Gerrit-Change-Number: 1243
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>

#3 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

cron2 has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1243?usp=email )

Change subject: unit_tests: Remove useless wrapping for argv/buffer tests
......................................................................

Patch Set 2: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1243?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I937105abeb5e8f796bf6bbe8432972adb60b3e2a
Gerrit-Change-Number: 1243
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Tue, 07 Oct 2025 18:52:02 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

#4 lore raw

PATCH v2 1/1 unit_tests: Remove useless wrapping for argv/buffer tests

In reply to a message not in the archive

From: Frank Lichtenheld <[email protected]...>

If not using mock() or check_expected(), and
not linking the original function, then there
is no need for wrapping support.

Change-Id I937105abeb5e8f796bf6bbe8432972adb60b3e2a

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1243
---

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/+/1243
This mail reflects revision 2 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>

CMakeLists.txt +5 -8
index be66357..aeef480 100644
@@ -654,6 +654,7 @@
     endif ()
 
     set(unit_tests
+        "test_argv"
         "test_auth_token"
         "test_buffer"
         "test_crypto"
@@ -684,7 +685,6 @@
     # Clang-cl (which is also MSVC) is wrongly detected to support wrap
     if (NOT MSVC AND "${LD_SUPPORTS_WRAP}")
         list(APPEND unit_tests
-            "test_argv"
             "test_tls_crypt"
             )
     endif ()
@@ -887,13 +887,10 @@
         src/openvpn/list.c
         )
 
-    if (TARGET test_argv)
-        target_link_options(test_argv PRIVATE -Wl,--wrap=parse_line)
-        target_sources(test_argv PRIVATE
-            tests/unit_tests/openvpn/mock_get_random.c
-            src/openvpn/argv.c
-            )
-    endif ()
+    target_sources(test_argv PRIVATE
+        tests/unit_tests/openvpn/mock_get_random.c
+        src/openvpn/argv.c
+        )
 
     if (TARGET test_cryptoapi)
         target_sources(test_cryptoapi PRIVATE
tests/unit_tests/openvpn/Makefile.am +3 -4
index ec8cc69..f7b1bc8 100644
@@ -4,12 +4,11 @@
 
 AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING) Unit-Tests'
 
-test_binaries = crypto_testdriver packet_id_testdriver auth_token_testdriver \
+test_binaries = argv_testdriver buffer_testdriver crypto_testdriver packet_id_testdriver auth_token_testdriver \
 	ncp_testdriver misc_testdriver pkt_testdriver ssl_testdriver \
 	user_pass_testdriver push_update_msg_testdriver provider_testdriver socket_testdriver
 
 if HAVE_LD_WRAP_SUPPORT
-test_binaries += argv_testdriver buffer_testdriver
 if !WIN32
 test_binaries += tls_crypt_testdriver
 endif
@@ -36,7 +35,7 @@
 endif
 
 argv_testdriver_CFLAGS  = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@
-argv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn -Wl,--wrap=parse_line
+argv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
 argv_testdriver_SOURCES = test_argv.c \
 	mock_msg.c mock_msg.h test_common.h \
 	mock_get_random.c \
@@ -46,7 +45,7 @@
 	$(top_srcdir)/src/openvpn/argv.c
 
 buffer_testdriver_CFLAGS  = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@
-buffer_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn -Wl,--wrap=parse_line
+buffer_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
 buffer_testdriver_SOURCES = test_buffer.c \
 	mock_msg.c mock_msg.h test_common.h \
 	mock_get_random.c \
tests/unit_tests/openvpn/test_argv.c +2 -2
index a04fabc..25c0371 100644
@@ -22,8 +22,8 @@
 #define SCRIPT_CMD "\"" PATH1 PATH2 "\"" PARAM1 "\"" PARAM2 "\""
 
 int
-__wrap_parse_line(const char *line, char **p, const int n, const char *file, const int line_num,
-                  msglvl_t msglevel, struct gc_arena *gc)
+parse_line(const char *line, char **p, const int n, const char *file, const int line_num,
+           msglvl_t msglevel, struct gc_arena *gc)
 {
     p[0] = PATH1 PATH2;
     p[1] = PARAM1;
#5 lore raw

[Openvpn-devel] [PATCH applied] Re: unit_tests: Remove useless wrapping for argv/buffer tests

still builds & passes the argv/buffer UT.

Your patch has been applied to the master branch.

commit d2428900ef07b1eb9d52a5de8ba5802b37a99d65

Author: Frank Lichtenheld
Date:   Tue Oct 7 20:52:09 2025 +0200
     unit_tests: Remove useless wrapping for argv/buffer tests

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1243
     Message-Id: <[email protected]...>
     URL: https://sourceforge.net/p/openvpn/mailman/message/59243508/
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#6 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#3) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1243?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by cron2

Change subject: unit_tests: Remove useless wrapping for argv/buffer tests
......................................................................

unit_tests: Remove useless wrapping for argv/buffer tests

If not using mock() or check_expected(), and
not linking the original function, then there
is no need for wrapping support.

Change-Id I937105abeb5e8f796bf6bbe8432972adb60b3e2a

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1243
Message-Id: <[email protected]...>
URL: https://sourceforge.net/p/openvpn/mailman/message/59243508/

---
M CMakeLists.txt
M tests/unit_tests/openvpn/Makefile.am
M tests/unit_tests/openvpn/test_argv.c

3 files changed, 10 insertions(+), 14 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/43/1243/3

CMakeLists.txt +5 -8
index be66357..aeef480 100644
@@ -654,6 +654,7 @@
     endif ()
 
     set(unit_tests
+        "test_argv"
         "test_auth_token"
         "test_buffer"
         "test_crypto"
@@ -684,7 +685,6 @@
     # Clang-cl (which is also MSVC) is wrongly detected to support wrap
     if (NOT MSVC AND "${LD_SUPPORTS_WRAP}")
         list(APPEND unit_tests
-            "test_argv"
             "test_tls_crypt"
             )
     endif ()
@@ -887,13 +887,10 @@
         src/openvpn/list.c
         )
 
-    if (TARGET test_argv)
-        target_link_options(test_argv PRIVATE -Wl,--wrap=parse_line)
-        target_sources(test_argv PRIVATE
-            tests/unit_tests/openvpn/mock_get_random.c
-            src/openvpn/argv.c
-            )
-    endif ()
+    target_sources(test_argv PRIVATE
+        tests/unit_tests/openvpn/mock_get_random.c
+        src/openvpn/argv.c
+        )
 
     if (TARGET test_cryptoapi)
         target_sources(test_cryptoapi PRIVATE
tests/unit_tests/openvpn/Makefile.am +3 -4
index ec8cc69..f7b1bc8 100644
@@ -4,12 +4,11 @@
 
 AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING) Unit-Tests'
 
-test_binaries = crypto_testdriver packet_id_testdriver auth_token_testdriver \
+test_binaries = argv_testdriver buffer_testdriver crypto_testdriver packet_id_testdriver auth_token_testdriver \
 	ncp_testdriver misc_testdriver pkt_testdriver ssl_testdriver \
 	user_pass_testdriver push_update_msg_testdriver provider_testdriver socket_testdriver
 
 if HAVE_LD_WRAP_SUPPORT
-test_binaries += argv_testdriver buffer_testdriver
 if !WIN32
 test_binaries += tls_crypt_testdriver
 endif
@@ -36,7 +35,7 @@
 endif
 
 argv_testdriver_CFLAGS  = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@
-argv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn -Wl,--wrap=parse_line
+argv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
 argv_testdriver_SOURCES = test_argv.c \
 	mock_msg.c mock_msg.h test_common.h \
 	mock_get_random.c \
@@ -46,7 +45,7 @@
 	$(top_srcdir)/src/openvpn/argv.c
 
 buffer_testdriver_CFLAGS  = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@
-buffer_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn -Wl,--wrap=parse_line
+buffer_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
 buffer_testdriver_SOURCES = test_buffer.c \
 	mock_msg.c mock_msg.h test_common.h \
 	mock_get_random.c \
tests/unit_tests/openvpn/test_argv.c +2 -2
index a04fabc..25c0371 100644
@@ -22,8 +22,8 @@
 #define SCRIPT_CMD "\"" PATH1 PATH2 "\"" PARAM1 "\"" PARAM2 "\""
 
 int
-__wrap_parse_line(const char *line, char **p, const int n, const char *file, const int line_num,
-                  msglvl_t msglevel, struct gc_arena *gc)
+parse_line(const char *line, char **p, const int n, const char *file, const int line_num,
+           msglvl_t msglevel, struct gc_arena *gc)
 {
     p[0] = PATH1 PATH2;
     p[1] = PARAM1;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1243?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I937105abeb5e8f796bf6bbe8432972adb60b3e2a
Gerrit-Change-Number: 1243
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#7 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1243?usp=email )

Change subject: unit_tests: Remove useless wrapping for argv/buffer tests
......................................................................

unit_tests: Remove useless wrapping for argv/buffer tests

If not using mock() or check_expected(), and
not linking the original function, then there
is no need for wrapping support.

Change-Id I937105abeb5e8f796bf6bbe8432972adb60b3e2a

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1243
Message-Id: <[email protected]...>
URL: https://sourceforge.net/p/openvpn/mailman/message/59243508/

---
M CMakeLists.txt
M tests/unit_tests/openvpn/Makefile.am
M tests/unit_tests/openvpn/test_argv.c

3 files changed, 10 insertions(+), 14 deletions(-)
CMakeLists.txt +5 -8
index be66357..aeef480 100644
@@ -654,6 +654,7 @@
     endif ()
 
     set(unit_tests
+        "test_argv"
         "test_auth_token"
         "test_buffer"
         "test_crypto"
@@ -684,7 +685,6 @@
     # Clang-cl (which is also MSVC) is wrongly detected to support wrap
     if (NOT MSVC AND "${LD_SUPPORTS_WRAP}")
         list(APPEND unit_tests
-            "test_argv"
             "test_tls_crypt"
             )
     endif ()
@@ -887,13 +887,10 @@
         src/openvpn/list.c
         )
 
-    if (TARGET test_argv)
-        target_link_options(test_argv PRIVATE -Wl,--wrap=parse_line)
-        target_sources(test_argv PRIVATE
-            tests/unit_tests/openvpn/mock_get_random.c
-            src/openvpn/argv.c
-            )
-    endif ()
+    target_sources(test_argv PRIVATE
+        tests/unit_tests/openvpn/mock_get_random.c
+        src/openvpn/argv.c
+        )
 
     if (TARGET test_cryptoapi)
         target_sources(test_cryptoapi PRIVATE
tests/unit_tests/openvpn/Makefile.am +3 -4
index ec8cc69..f7b1bc8 100644
@@ -4,12 +4,11 @@
 
 AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING) Unit-Tests'
 
-test_binaries = crypto_testdriver packet_id_testdriver auth_token_testdriver \
+test_binaries = argv_testdriver buffer_testdriver crypto_testdriver packet_id_testdriver auth_token_testdriver \
 	ncp_testdriver misc_testdriver pkt_testdriver ssl_testdriver \
 	user_pass_testdriver push_update_msg_testdriver provider_testdriver socket_testdriver
 
 if HAVE_LD_WRAP_SUPPORT
-test_binaries += argv_testdriver buffer_testdriver
 if !WIN32
 test_binaries += tls_crypt_testdriver
 endif
@@ -36,7 +35,7 @@
 endif
 
 argv_testdriver_CFLAGS  = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@
-argv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn -Wl,--wrap=parse_line
+argv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
 argv_testdriver_SOURCES = test_argv.c \
 	mock_msg.c mock_msg.h test_common.h \
 	mock_get_random.c \
@@ -46,7 +45,7 @@
 	$(top_srcdir)/src/openvpn/argv.c
 
 buffer_testdriver_CFLAGS  = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@
-buffer_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn -Wl,--wrap=parse_line
+buffer_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
 buffer_testdriver_SOURCES = test_buffer.c \
 	mock_msg.c mock_msg.h test_common.h \
 	mock_get_random.c \
tests/unit_tests/openvpn/test_argv.c +2 -2
index a04fabc..25c0371 100644
@@ -22,8 +22,8 @@
 #define SCRIPT_CMD "\"" PATH1 PATH2 "\"" PARAM1 "\"" PARAM2 "\""
 
 int
-__wrap_parse_line(const char *line, char **p, const int n, const char *file, const int line_num,
-                  msglvl_t msglevel, struct gc_arena *gc)
+parse_line(const char *line, char **p, const int n, const char *file, const int line_num,
+           msglvl_t msglevel, struct gc_arena *gc)
 {
     p[0] = PATH1 PATH2;
     p[1] = PARAM1;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1243?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I937105abeb5e8f796bf6bbe8432972adb60b3e2a
Gerrit-Change-Number: 1243
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>