From fb2a53a4097e814c131b1e836b3d4ae880bb6856 Mon Sep 17 00:00:00 2001 From: Brian Neradt Date: Thu, 13 Nov 2025 22:37:45 +0000 Subject: [PATCH] autest cmake target updates - Store proxy-verifier in .git directory to share across build directories. - Fix AUTEST_OPTIONS space escaping issue in cmake targets. --- CMakeLists.txt | 5 +++++ cmake/proxy-verifier.cmake | 10 +++++----- tests/CMakeLists.txt | 8 ++++---- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e7d100c6bd..a0f314ff15b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -589,6 +589,11 @@ if(ENABLE_AUTEST) "" CACHE STRING "Additional options for autest (default \"\")" ) + # Also create AUTEST_OPTIONS_LIST from the string for use in cmake targets. + # This prevents cmake from escaping spaces in the arguments, which confuses + # the autest command. The original AUTEST_OPTIONS string is used in the + # autest.sh script. + separate_arguments(AUTEST_OPTIONS_LIST UNIX_COMMAND "${AUTEST_OPTIONS}") set(PROXY_VERIFIER_VERSION "v2.12.0") set(PROXY_VERIFIER_HASH "SHA1=8e9adc6e0b31251ca8e6fc2064ae54e5d752bb72") include(proxy-verifier) diff --git a/cmake/proxy-verifier.cmake b/cmake/proxy-verifier.cmake index cf584e608ff..51e07beb4c9 100644 --- a/cmake/proxy-verifier.cmake +++ b/cmake/proxy-verifier.cmake @@ -15,7 +15,7 @@ # ####################### -# This will download and extract proxy-verifier and setup variables to point to it. +# This will download and extract proxy-verifier to .git directory and setup variables to point to it. # # Required variables: # PROXY_VERIFIER_VERSION @@ -35,14 +35,14 @@ if(NOT PROXY_VERIFIER_HASH) message(FATAL_ERROR "PROXY_VERIFIER_HASH Required") endif() -# Download proxy-verifier -set(PV_ARCHIVE ${CMAKE_BINARY_DIR}/proxy-verifier/proxy-verifier.tar.gz) +# Download proxy-verifier to .git directory. +set(PV_ARCHIVE ${CMAKE_SOURCE_DIR}/.git/proxy-verifier/proxy-verifier.tar.gz) file( DOWNLOAD https://ci.trafficserver.apache.org/bintray/proxy-verifier-${PROXY_VERIFIER_VERSION}.tar.gz ${PV_ARCHIVE} EXPECTED_HASH ${PROXY_VERIFIER_HASH} SHOW_PROGRESS ) -file(ARCHIVE_EXTRACT INPUT ${PV_ARCHIVE}) +file(ARCHIVE_EXTRACT INPUT ${PV_ARCHIVE} DESTINATION ${CMAKE_SOURCE_DIR}/.git) if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64" @@ -70,7 +70,7 @@ else() message(FATAL_ERROR "Host ${CMAKE_HOST_SYSTEM_NAME} doesnt support running proxy verifier") endif() -set(PROXY_VERIFIER_PATH ${CMAKE_BINARY_DIR}/proxy-verifier-${PROXY_VERIFIER_VERSION}/${PV_SUBDIR}) +set(PROXY_VERIFIER_PATH ${CMAKE_SOURCE_DIR}/.git/proxy-verifier-${PROXY_VERIFIER_VERSION}/${PV_SUBDIR}) set(PROXY_VERIFIER_CLIENT ${PROXY_VERIFIER_PATH}/verifier-client) set(PROXY_VERIFIER_SERVER ${PROXY_VERIFIER_PATH}/verifier-server) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a8198ef056d..593856e4f56 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -64,7 +64,7 @@ add_custom_target( COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${CMAKE_GOLD_DIR}/remap:$ENV{PYTHONPATH} ${RUNPIPENV} run env autest --directory ${CMAKE_GOLD_DIR} --ats-bin=${CMAKE_INSTALL_PREFIX}/bin --proxy-verifier-bin ${PROXY_VERIFIER_PATH} --build-root - ${CMAKE_BINARY_DIR} --sandbox ${AUTEST_SANDBOX} ${CURL_UDS_FLAG} ${AUTEST_OPTIONS} + ${CMAKE_BINARY_DIR} --sandbox ${AUTEST_SANDBOX} ${CURL_UDS_FLAG} ${AUTEST_OPTIONS_LIST} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} USES_TERMINAL ) @@ -75,7 +75,7 @@ add_custom_target( COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${CMAKE_GOLD_DIR}/remap:$ENV{PYTHONPATH} ${RUNPIPENV} run env autest --directory ${CMAKE_GOLD_DIR} --ats-bin=${CMAKE_INSTALL_PREFIX}/bin --proxy-verifier-bin ${PROXY_VERIFIER_PATH} --build-root - ${CMAKE_BINARY_DIR} --sandbox ${AUTEST_SANDBOX} ${CURL_UDS_FLAG} ${AUTEST_OPTIONS} + ${CMAKE_BINARY_DIR} --sandbox ${AUTEST_SANDBOX} ${CURL_UDS_FLAG} ${AUTEST_OPTIONS_LIST} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} USES_TERMINAL ) @@ -91,8 +91,8 @@ add_custom_target( COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${CMAKE_GOLD_DIR}/remap:$ENV{PYTHONPATH} ${RUNPIPENV} run env autest --directory ${CMAKE_GOLD_DIR} --ats-bin=${CMAKE_INSTALL_PREFIX}/bin --proxy-verifier-bin ${PROXY_VERIFIER_PATH} --build-root - ${CMAKE_BINARY_DIR} --sandbox ${AUTEST_SANDBOX} ${CURL_UDS_FLAG} ${AUTEST_OPTIONS} - COMMAND ${CMAKE_COMMAND} -E rename {CMAKE_SKIP_GOLD_DIR}/h2 ${CMAKE_GOLD_DIR}/h2 + ${CMAKE_BINARY_DIR} --sandbox ${AUTEST_SANDBOX} ${CURL_UDS_FLAG} ${AUTEST_OPTIONS_LIST} + COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_SKIP_GOLD_DIR}/h2 ${CMAKE_GOLD_DIR}/h2 COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_SKIP_GOLD_DIR}/tls ${CMAKE_GOLD_DIR}/tls COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_SKIP_GOLD_DIR}/tls_hooks ${CMAKE_GOLD_DIR}/tls_hooks WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}