From: "cron2 (Code Review)" Date: Wed, 7 May 2025 12:35:22 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <7050be758d77d7e6adc09690716bb94f584cdabc-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="dQkRvzc2pfo="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: CMake: Make sure to treat UNIT_TEST_SOURCEDIR as path List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: plaisthos , openvpn-devel --dQkRvzc2pfo= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/98= 1?usp=3Demail ) Change subject: CMake: Make sure to treat UNIT_TEST_SOURCEDIR as path ...................................................................... CMake: Make sure to treat UNIT_TEST_SOURCEDIR as path This makes sure that it is properly normalized, and on Windows seems to prevent CMake from using back slashes which would break the build due to "unknown escape sequence" errors. Change-Id: I2551edfaaf5107649398a3fa1db2009ee8644671 Signed-off-by: Frank Lichtenheld Acked-by: Arne Schwabe Message-Id: <20250507121226.13824-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31= 587.html Signed-off-by: Gert Doering --- M CMakeLists.txt 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a8fb64b..6687b56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -679,11 +679,11 @@ endif () foreach (test_name ${unit_tests}) + cmake_path(SET _UT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tests/un= it_tests/openvpn) # test_networking needs special environment if (NOT ${test_name} STREQUAL "test_networking") add_test(${test_name} ${test_name}) # for compat with autotools make check - set(_UT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tests/unit_test= s/openvpn) set_tests_properties(${test_name} PROPERTIES ENVIRONMENT "srcdir=3D${_UT_SOURCE_DIR}") endif () @@ -703,7 +703,7 @@ # for compat with IDEs like Clion that ignore the tests properties # for the environment variable srcdir when running tests as fallba= ck - target_compile_definitions(${test_name} PRIVATE "-DUNIT_TEST_SOURC= EDIR=3D\"${CMAKE_SOURCE_DIR}/tests/unit_tests/openvpn\"") + target_compile_definitions(${test_name} PRIVATE "UNIT_TEST_SOURCED= IR=3D\"${_UT_SOURCE_DIR}\"") if (NOT ${test_name} STREQUAL "test_buffer") target_sources(${test_name} PRIVATE -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/981?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I2551edfaaf5107649398a3fa1db2009ee8644671 Gerrit-Change-Number: 981 Gerrit-PatchSet: 2 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: merged --dQkRvzc2pfo= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

CMake: Make sure to treat UNIT_TEST_SOURCEDIR =
as path

This makes sure that it is properly normalized, and
on Wi= ndows seems to prevent CMake from using back
slashes which would break t= he build due to "unknown escape
sequence" errors.

Chang= e-Id: I2551edfaaf5107649398a3fa1db2009ee8644671
Signed-off-by: Frank Lic= htenheld <frank@...2641...>
Acked-by: Arne Schwabe <arne-openvp= n@...1227...>
Message-Id: <20250507121226.13824-1-gert@...1296...&= gt;
URL: https://www.mail-archive.com/openvpn-devel@...475...= t/msg31587.html
Signed-off-by: Gert Doering <gert@...1296...>
-= --
M CMakeLists.txt
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a8fb6= 4b..6687b56 100644
--- a/CMakeLists.txt
+++= b/CMakeLists.txt
@@ -679,11 +679,11 @@
= endif ()

foreach (test_name ${unit= _tests})
+ cma= ke_path(SET _UT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tests/unit_tests/ope= nvpn)
# test_networking needs special environment<= /span>
if (NOT ${test_name} STREQUAL "test_networkin= g")
add_test(${test_name} ${test_name})
# for compat with autotools make check- set(_UT_SOURCE_DIR= ${CMAKE_CURRENT_SOURCE_DIR}/tests/unit_tests/openvpn)
= set_tests_properties(${test_name} PROPERTIES
= ENVIRONMENT "srcdir=3D${_UT_SOURCE_DIR}")
<= span> endif ()

@@ -703,7 +703,7 @@
=
# for compat with IDEs like Clion that ignore th= e tests properties
# for the environment variable = srcdir when running tests as fallback
- target_compile_definitions(${test_name} PRIVATE &qu= ot;-DUNIT_TEST_SOURCEDIR=3D\"${CMAKE_SOURCE_DIR}/tests/unit_tests/open= vpn\"")
+ = target_compile_definitions(${test_name} PRIVATE "UNIT_TEST_SOURC= EDIR=3D\"${_UT_SOURCE_DIR}\"")

<= span> if (NOT ${test_name} STREQUAL "test_buffer")
=
target_sources(${test_name} PRIVATE
=

To view, visit change 981. To unsubscribe, or for help writi= ng mail filters, visit setti= ngs.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I2551edfaaf5107649398a3fa1db= 2009ee8644671
Gerrit-Change-Number: 981
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: merged
--dQkRvzc2pfo=--