From 7d9039912dfcbe01414ba5faab503ea7cf77a630 Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Sat, 19 Aug 2023 18:19:20 +0200 Subject: [PATCH] CMake option to disable proxy tests --- CMakeLists.txt | 1 + test/CMakeLists.txt | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d15d0144..723ec714d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,7 @@ cpr_option(CPR_ENABLE_LINTING "Set to ON to enable clang linting." OFF) cpr_option(CPR_ENABLE_CPPCHECK "Set to ON to enable Cppcheck static analysis. Requires CPR_BUILD_TESTS and CPR_BUILD_TESTS_SSL to be OFF to prevent checking google tests source code." OFF) cpr_option(CPR_BUILD_TESTS "Set to ON to build cpr tests." OFF) cpr_option(CPR_BUILD_TESTS_SSL "Set to ON to build cpr ssl tests" ${CPR_BUILD_TESTS}) +cpr_option(CPR_BUILD_TESTS_PROXY "Set to ON to build proxy tests. They fail in case there is no valid proxy server available in proxy_tests.cpp" OFF) cpr_option(CPR_DEBUG_SANITIZER_FLAG_THREAD "Enables the ThreadSanitizer for debug builds." OFF) cpr_option(CPR_DEBUG_SANITIZER_FLAG_ADDR "Enables the AddressSanitizer for debug builds." OFF) cpr_option(CPR_DEBUG_SANITIZER_FLAG_LEAK "Enables the LeakSanitizer for debug builds." OFF) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0a09043a7..8d640bec1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -41,7 +41,10 @@ add_cpr_test(post) add_cpr_test(session) add_cpr_test(prepare) add_cpr_test(async) -add_cpr_test(proxy) +if(CPR_BUILD_TESTS_PROXY) + add_cpr_test(proxy) + add_cpr_test(proxy_auth) +endif() add_cpr_test(head) add_cpr_test(delete) add_cpr_test(put) @@ -54,7 +57,6 @@ add_cpr_test(alternating) add_cpr_test(util) add_cpr_test(structures) add_cpr_test(encoded_auth) -add_cpr_test(proxy_auth) add_cpr_test(version) add_cpr_test(download) add_cpr_test(interceptor)