From 847c05098b105f2626a3494e4ae263c847fb6903 Mon Sep 17 00:00:00 2001 From: Thymir Date: Fri, 23 Feb 2024 16:05:20 +0100 Subject: [PATCH 1/2] Upgrade to msvc17, openssl3, gtest 1.14, c++20. Delete CI scripts and configuration files. Merge pipelines. --- CMakeLists.txt | 2 +- ci/pipelines/Build.jenkinsfile | 93 +++++-- ci/pipelines/NewtonDebug.properties | 11 - ci/pipelines/NewtonRelease.properties | 11 - ci/pipelines/Release.jenkinsfile | 106 -------- ci/pipelines/SnowDebug.properties | 11 - ci/pipelines/SnowRelease.properties | 11 - ci/scripts/build_docs.cfg | 0 ci/scripts/build_docs.sh | 252 ------------------ conanfile.py | 33 +-- .../ReplyCORSHeadersBuilderServiceTest.cpp | 2 +- .../Tests/RequestURIParserServiceTest.cpp | 2 +- .../Tests/SecuredServerTest.cpp | 2 +- .../Tests/ServerTest.cpp | 2 +- test_package/conanfile.py | 3 - vs2022.conanprofile | 9 + 16 files changed, 86 insertions(+), 464 deletions(-) delete mode 100644 ci/pipelines/NewtonDebug.properties delete mode 100644 ci/pipelines/NewtonRelease.properties delete mode 100644 ci/pipelines/Release.jenkinsfile delete mode 100644 ci/pipelines/SnowDebug.properties delete mode 100644 ci/pipelines/SnowRelease.properties delete mode 100644 ci/scripts/build_docs.cfg delete mode 100644 ci/scripts/build_docs.sh create mode 100644 vs2022.conanprofile diff --git a/CMakeLists.txt b/CMakeLists.txt index 17c78bf..bab910c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.2) project(HttpLibWebServerAdapter) # Configure environment -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) diff --git a/ci/pipelines/Build.jenkinsfile b/ci/pipelines/Build.jenkinsfile index e231a5a..9348693 100644 --- a/ci/pipelines/Build.jenkinsfile +++ b/ci/pipelines/Build.jenkinsfile @@ -1,11 +1,13 @@ def channel = "testing" def version = "0.0.0" +def profile = "vs2022.conanprofile" +def archs = ['x86', 'x86_64'] +def configs = ['Debug', 'Release'] library identifier: "cpp-jenkins-pipelines@master", retriever: modernSCM( [$class: "GitSCMSource", - remote: "https://github.com/systelab/cpp-jenkins-pipelines.git", - credentialsId: "GitHubCredentials"]) + remote: "https://github.com/systelab/cpp-jenkins-pipelines.git"]) pipeline { @@ -16,7 +18,15 @@ pipeline parameters { - booleanParam( name: 'uploadTestingPkg', + string( name: 'version', + description: 'Version to build (must match the name of the tag that will be checked out), leave blank for checkout of current branch', + defaultValue: '' ) + + booleanParam( name: 'stable', + description: 'Show if generated library should be uploaded as stable or testing', + defaultValue: false ) + + booleanParam( name: 'uploadPackage', description: 'Whether or not to upload testing conan package', defaultValue: false ) } @@ -35,8 +45,19 @@ pipeline steps { deleteDir() - configureConanRemotes() - checkoutSourceCode() + script + { + if (params.version == '') + { + checkoutSourceCode() + } + else + { + checkoutSourceCodeFromTag(version) + version = params.version + } + channel = params.stable ? "stable" : "testing" + } } } @@ -46,43 +67,55 @@ pipeline { script { - def configurations = ['NewtonDebug', 'NewtonRelease', 'SnowDebug', 'SnowRelease'] - for(int i=0; i < configurations.size(); i++) - { - stage('Build ' + configurations[i]) - { - def props = readProperties file:"ci/pipelines/${configurations[i]}.properties" - props.each { propKey, propValue -> println "${propKey}: ${propValue}" } - - sh "mkdir build-${configurations[i]}" - dir("build-${configurations[i]}") + archs.each + { arch -> + configs.each + { config -> + stage("Build ${config}|${arch}") { - sh "conan install .. -s build_type=${props.conanBuildType} -s compiler.toolset=${props.conanCompilerToolset} -s arch=${props.conanArch} -o gtest=${props.conanGTestVersion} -o openssl=${props.conanOpenSSLVersion}" - sh "cmake .. -G '${props.cmakeVS}' -A ${props.cmakePlatform}" - sh "cmake --build . --config ${props.cmakeConfiguration}" - sh "conan export-pkg ../conanfile.py HttpLibWebServerAdapter/${version}@systelab/${channel} -s build_type=${props.conanBuildType} -s compiler.toolset=${props.conanCompilerToolset} -s arch=${props.conanArch} -o gtest=${props.conanGTestVersion} -o openssl=${props.conanOpenSSLVersion} --force" - sh "conan test ../test_package/conanfile.py HttpLibWebServerAdapter/${version}@systelab/${channel} -s build_type=${props.conanBuildType} -s compiler.toolset=${props.conanCompilerToolset} -s arch=${props.conanArch} -o gtest=${props.conanGTestVersion} -o openssl=${props.conanOpenSSLVersion}" - sh "bin/${props.conanBuildType}/HttpLibWebServerAdapterTest.exe --gtest_output=xml:HttpLibWebServerAdapterTest.xml" + def buildFolder = "build/${config}-${arch}" + bat "conan install . --install-folder ${buildFolder} --profile=${profile} -s arch=${arch} -s build_type=${config}" + bat "conan build . --build-folder ${buildFolder}" + bat "conan export-pkg . HttpLibWebServerAdapter/${version}@systelab/${channel} --build-folder ${buildFolder} --force" + + dir("${buildFolder}/bin/${config}/") + { + bat "HttpLibWebServerAdapterTest.exe --gtest_output=xml:HttpLibWebServerAdapterTest.xml" + } + } } } } } } + stage('Test Packages') + { + steps + { + script + { + archs.each + { arch -> + configs.each + { config -> + def buildFolder = "build/${config}-${arch}" + bat "conan test ./test_package/conanfile.py HttpLibWebServerAdapter/${version}@systelab/${channel} --profile=${profile} -s arch=${arch} -s build_type=${config}" + } + } + } + } + } stage('Deploy') { when { - expression { return params.uploadTestingPkg } + expression { params.uploadPackage } } steps { - script - { - sh "conan remove HttpLibWebServerAdapter/${version}@systelab/${channel} -r systelab-conan-local --force" - sh "conan upload HttpLibWebServerAdapter/${version}@systelab/${channel} --all -r systelab-conan-local --force" - } + bat "conan upload HttpLibWebServerAdapter/${version}@systelab/${channel} --all -r systelab-conan-local --force" } } } @@ -91,7 +124,11 @@ pipeline { always { - junit allowEmptyResults: true, testResults: "build*/HttpLibWebServerAdapterTest.xml" + junit allowEmptyResults: true, testResults: "build/**/HttpLibWebServerAdapterTest.xml" + script + { + currentBuild.description = "${version}/${channel}" + } } } } \ No newline at end of file diff --git a/ci/pipelines/NewtonDebug.properties b/ci/pipelines/NewtonDebug.properties deleted file mode 100644 index 3dce7f7..0000000 --- a/ci/pipelines/NewtonDebug.properties +++ /dev/null @@ -1,11 +0,0 @@ -# Conan-related properties -conanBuildType=Debug -conanCompilerToolset=v142 -conanArch=x86_64 -conanGTestVersion=1.10.0 -conanOpenSSLVersion=1.1.1g - -# CMake-related properties -cmakePlatform=x64 -cmakeVS=Visual Studio 16 2019 -cmakeConfiguration=Debug diff --git a/ci/pipelines/NewtonRelease.properties b/ci/pipelines/NewtonRelease.properties deleted file mode 100644 index 6aaf8a9..0000000 --- a/ci/pipelines/NewtonRelease.properties +++ /dev/null @@ -1,11 +0,0 @@ -# Conan-related properties -conanBuildType=Release -conanCompilerToolset=v142 -conanArch=x86_64 -conanGTestVersion=1.10.0 -conanOpenSSLVersion=1.1.1g - -# CMake-related properties -cmakePlatform=x64 -cmakeVS=Visual Studio 16 2019 -cmakeConfiguration=Release diff --git a/ci/pipelines/Release.jenkinsfile b/ci/pipelines/Release.jenkinsfile deleted file mode 100644 index 5ee7fcb..0000000 --- a/ci/pipelines/Release.jenkinsfile +++ /dev/null @@ -1,106 +0,0 @@ -def channel = "testing" -def version = "0.0.0" - - -library identifier: "cpp-jenkins-pipelines@master", retriever: modernSCM( - [$class: "GitSCMSource", - remote: "https://github.com/systelab/cpp-jenkins-pipelines.git", - credentialsId: "GitHubCredentials"]) - -pipeline -{ - agent - { - label 'lib-build' - } - - parameters - { - string( name: 'version', - description: 'Number of the version to build (must match the name of the tag that will be checked out)', - defaultValue: '0.0.0' ) - - booleanParam( name: 'stable', - description: 'Show if generated library should be uploaded as stable or testing', - defaultValue: false ) - } - - options - { - skipDefaultCheckout(true) - disableConcurrentBuilds() - } - - stages - { - stage('Checkout') - { - steps - { - script - { - version = params.version - channel = params.stable ? "stable" : "testing" - } - deleteDir() - configureConanRemotes() - checkoutSourceCodeFromTag(version) - } - } - - stage('Build') - { - steps - { - script - { - def configurations = ['NewtonDebug', 'NewtonRelease', 'SnowDebug', 'SnowRelease'] - for(int i=0; i < configurations.size(); i++) - { - stage('Build ' + configurations[i]) - { - def props = readProperties file: "ci/pipelines/${configurations[i]}.properties" - props.each { propKey, propValue -> println "${propKey}: ${propValue}" } - - sh "mkdir build-${configurations[i]}" - dir("build-${configurations[i]}") - { - sh "conan install .. -s build_type=${props.conanBuildType} -s compiler.toolset=${props.conanCompilerToolset} -s arch=${props.conanArch} -o gtest=${props.conanGTestVersion} -o openssl=${props.conanOpenSSLVersion}" - sh "cmake .. -G '${props.cmakeVS}' -A ${props.cmakePlatform}" - sh "cmake --build . --config ${props.cmakeConfiguration}" - sh "conan export-pkg ../conanfile.py HttpLibWebServerAdapter/${version}@systelab/${channel} -s build_type=${props.conanBuildType} -s compiler.toolset=${props.conanCompilerToolset} -s arch=${props.conanArch} -o gtest=${props.conanGTestVersion} -o openssl=${props.conanOpenSSLVersion} --force" - sh "conan test ../test_package/conanfile.py HttpLibWebServerAdapter/${version}@systelab/${channel} -s build_type=${props.conanBuildType} -s compiler.toolset=${props.conanCompilerToolset} -s arch=${props.conanArch} -o gtest=${props.conanGTestVersion} -o openssl=${props.conanOpenSSLVersion}" - sh "bin/${props.conanBuildType}/HttpLibWebServerAdapterTest.exe --gtest_output=xml:HttpLibWebServerAdapterTest.xml" - } - } - } - } - } - } - - stage('Deploy') - { - steps - { - script - { - sh "conan remove HttpLibWebServerAdapter/${version}@systelab/${channel} -r systelab-conan-local --force" - sh "conan upload HttpLibWebServerAdapter/${version}@systelab/${channel} --all -r systelab-conan-local --force" - } - } - } - } - - post - { - always - { - junit allowEmptyResults: true, testResults: "build*/HttpLibWebServerAdapterTest.xml" - script - { - currentBuild.description = "${version}/${channel}" - } - } - } - -} \ No newline at end of file diff --git a/ci/pipelines/SnowDebug.properties b/ci/pipelines/SnowDebug.properties deleted file mode 100644 index 46a21dc..0000000 --- a/ci/pipelines/SnowDebug.properties +++ /dev/null @@ -1,11 +0,0 @@ -# Conan-related properties -conanBuildType=Debug -conanCompilerToolset=v142 -conanArch=x86 -conanGTestVersion=1.10.0 -conanOpenSSLVersion=1.1.1k - -# CMake-related properties -cmakePlatform=Win32 -cmakeVS=Visual Studio 16 2019 -cmakeConfiguration=Debug diff --git a/ci/pipelines/SnowRelease.properties b/ci/pipelines/SnowRelease.properties deleted file mode 100644 index 4595b6c..0000000 --- a/ci/pipelines/SnowRelease.properties +++ /dev/null @@ -1,11 +0,0 @@ -# Conan-related properties -conanBuildType=Release -conanCompilerToolset=v142 -conanArch=x86 -conanGTestVersion=1.10.0 -conanOpenSSLVersion=1.1.1k - -# CMake-related properties -cmakePlatform=Win32 -cmakeVS=Visual Studio 16 2019 -cmakeConfiguration=Release diff --git a/ci/scripts/build_docs.cfg b/ci/scripts/build_docs.cfg deleted file mode 100644 index e69de29..0000000 diff --git a/ci/scripts/build_docs.sh b/ci/scripts/build_docs.sh deleted file mode 100644 index 4fe4cfe..0000000 --- a/ci/scripts/build_docs.sh +++ /dev/null @@ -1,252 +0,0 @@ -#!/bin/bash - -#usage -function usage -{ - echo "Usage: $0 -o REPO_OWNER -s REPO_SLUG -t TAG -c CI -n CONFIG_NAME -j JOB_ID -p TEST_PROJECTS" - echo "" - echo - echo " -o ARG Owner of the associated GitHub repository" - echo " -s ARG Slug of the associated GitHub repository" - echo " -t ARG Tag name associated to current build" - echo " -c ARG Continuous Integration system (AppVeyor or Travis)" - echo " -n ARG Configuration name of the build" - echo " -j ARG Identifier of the build job" - echo " -p ARG Comma separated list of test projects" -} - -function checkErrors -{ - if [ $? != 0 ] - then - echo - echo "An error occured while deploying artifacts." - echo - exit 1 - fi -} - -function parseParameters -{ - REPO_OWNER=systelab - REPO_SLUG= - TAG_NAME= - CI_NAME= - CONFIG_NAME= - JOB_ID= - TEST_PROJECTS= - - while getopts "ho:s:t:c:n:j:p:" OPTION - do - case $OPTION in - h) - usage - exit - ;; - o) - REPO_OWNER=$OPTARG - ;; - s) - REPO_SLUG=$OPTARG - ;; - t) - TAG_NAME=$OPTARG - ;; - c) - CI_NAME=$OPTARG - ;; - n) - CONFIG_NAME=$OPTARG - ;; - j) - JOB_ID=$OPTARG - ;; - p) - TEST_PROJECTS=$OPTARG - ;; - ?) - echo "Invalid parameter" - usage - exit - ;; - esac - done -} - -function findTestProjectConfiguration -{ - TEST_PROJECT_REPORT="" - TEST_PROJECT_TYPE="" - - echo "Searching configuration for test project $TEST_PROJECT_NAME" - - SEARCH_EXPRESSION="[$TEST_PROJECT_NAME]" - INSIDE_SECTION=0 - while read line; do - if [[ $INSIDE_SECTION == 1 ]] - then - if [ "${line:0:1}" == "[" ] - then - INSIDE_SECTION=0 - else - if [ "${line:0:7}" == "report=" ] - then - TEST_PROJECT_REPORT="${line:7}" - fi - - if [ "${line:0:5}" == "type=" ] - then - TEST_PROJECT_TYPE="${line:5}" - fi - fi - else - if [ "$line" = "$SEARCH_EXPRESSION" ] - then - echo "Found section for project $TEST_PROJECT_NAME at line $line" - INSIDE_SECTION=1 - fi - fi - done < $CONFIG_FILE - - # Process test project report file found - if [[ -z "$TEST_PROJECT_REPORT" ]] - then - echo "Test report file for $TEST_PROJECT_NAME not found, using default (build/bin/$TEST_PROJECT_NAME.xml)" - TEST_PROJECT_REPORT="build/bin/$TEST_PROJECT_NAME.xml" - else - echo "Test report file: $TEST_PROJECT_REPORT" - fi - - # Process test project type found - if [[ -z "$TEST_PROJECT_TYPE" ]] - then - echo "Test project type for $TEST_PROJECT_NAME not found, using default (Unit Tests)" - TEST_PROJECT_TYPE="Unit Tests" - else - echo "Test project type: $TEST_PROJECT_TYPE" - fi - - echo "" -} - -function queryGitHubReleaseInternalId -{ - echo "Querying for GitHub Release internal identifier..." - GITHUB_RELEASE_URL="https://api.github.com/repos/$REPO_OWNER/$REPO_SLUG/releases/tags/$TAG_NAME" - echo "URL: $GITHUB_RELEASE_URL" - - GITHUB_RELEASE_DATA_JSON=$(curl --silent "$GITHUB_RELEASE_URL" -H "Authorization: token $GITHUB_ACTION_DISPATCH_TOKEN") - checkErrors - echo "GitHub Release data performed successfully." - - GITHUB_RELEASE_INTERNAL_ID=$(echo $GITHUB_RELEASE_DATA_JSON | python3 -c "import sys, json; print(json.load(sys.stdin)['id'])") - echo "Release internal identifier is $GITHUB_RELEASE_INTERNAL_ID" - echo "" -} - -function uploadTestReportToGitHub -{ - if [[ -z "$GITHUB_RELEASE_INTERNAL_ID" ]] - then - queryGitHubReleaseInternalId - fi - - echo "Uploading test report $TEST_PROJECT_REPORT as an asset of GitHub release..."; - - GITHUB_ASSET_FILENAME="$TEST_PROJECT_NAME-$JOB_ID.xml" - GITHUB_ASSET_UPLOAD_URL="https://uploads.github.com/repos/$REPO_OWNER/$REPO_SLUG/releases/$GITHUB_RELEASE_INTERNAL_ID/assets?name=$GITHUB_ASSET_FILENAME" - GITHUB_ASSET_CONTENT_TYPE=$(file -b --mime-type $TEST_PROJECT_REPORT) - echo "URL: $GITHUB_ASSET_UPLOAD_URL" - echo "Content-Type: $GITHUB_ASSET_CONTENT_TYPE" - - GITHUB_ASSET_UPLOAD_RESPONSE=$(curl --silent -H "Authorization: token $GITHUB_ACTION_DISPATCH_TOKEN" -H "Content-Type: $GITHUB_ASSET_CONTENT_TYPE" --data-binary @$TEST_PROJECT_REPORT $GITHUB_ASSET_UPLOAD_URL) - checkErrors - echo "Report uploaded successfully." - - TEST_PROJECT_ASSET_URL=$(echo $GITHUB_ASSET_UPLOAD_RESPONSE | python3 -c "import sys, json; print(json.load(sys.stdin)['url'])") - checkErrors - echo "Report asset URL is $TEST_PROJECT_ASSET_URL" - echo "" -} - -function buildTestProjectsJSON -{ - CONFIG_FILE="ci/build_docs.cfg" - GITHUB_RELEASE_INTERNAL_ID="" - - TEST_PROJECTS_JSON="[" - - FIRST_TEST_PROJECT=1 - for TEST_PROJECT_NAME in $TEST_PROJECTS - do - if [[ $FIRST_TEST_PROJECT == 0 ]] - then - TEST_PROJECTS_JSON+= ", " - fi - FIRST_TEST_PROJECT=0 - - findTestProjectConfiguration - uploadTestReportToGitHub - - TEST_PROJECT_JSON="{" - TEST_PROJECT_JSON+="\"url\":" - TEST_PROJECT_JSON+="\"${TEST_PROJECT_ASSET_URL}\"," - TEST_PROJECT_JSON+="\"name\":" - TEST_PROJECT_JSON+="\"$TEST_PROJECT_NAME\"," - TEST_PROJECT_JSON+="\"type\":" - TEST_PROJECT_JSON+="\"$TEST_PROJECT_TYPE\"" - TEST_PROJECT_JSON+="}" - - TEST_PROJECTS_JSON+="$TEST_PROJECT_JSON" - - done #TEST_PROJECT_NAME - - TEST_PROJECTS_JSON+="]" -} - -function dispatchDocBuildsEvent -{ - if [[ -z $REPO_SLUG ]] - then - echo - echo "Syntax error: no repository slug specified. Use -s." - exit 0 - fi - - if [[ -z $TAG_NAME ]] - then - echo - echo "Syntax error: no tag name specified. Use -t." - exit 0 - fi - - TEST_PROJECTS=${TEST_PROJECTS//,/ } - - echo "Dispatch GitHub Action to build documentation..." - echo "REPO_OWNER=$REPO_OWNER" - echo "REPO_SLUG=$REPO_SLUG" - echo "TAG=$TAG_NAME" - echo "CI=$CI_NAME" - echo "CONFIG_NAME=$CONFIG_NAME" - echo "JOB=$JOB_ID" - echo "TEST_PROJECTS=$TEST_PROJECTS" - echo "" - - buildTestProjectsJSON - BODY_CONTENT="{\"event_type\": \"doc-build\", \"client_payload\": {\"tag\": \"$TAG_NAME\", \"configuration\": \"$CONFIG_NAME\", \"ci\": \"$CI_NAME\", \"job\": \"$JOB_ID\", \"tests\": $TEST_PROJECTS_JSON}}" - echo "BODY_CONTENT is $BODY_CONTENT" - echo "" - - curl -H "Authorization: token $GITHUB_ACTION_DISPATCH_TOKEN" \ - -H 'Accept: application/vnd.github.everest-preview+json' \ - "https://api.github.com/repos/$REPO_OWNER/$REPO_SLUG/dispatches" \ - -d "$BODY_CONTENT" - checkErrors - echo "Done." - echo "" -} - - -# MAIN -parseParameters "${@}" -dispatchDocBuildsEvent diff --git a/conanfile.py b/conanfile.py index a190e03..2db8d1f 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,4 +1,4 @@ -from conans import ConanFile, tools +from conans import ConanFile, tools, CMake class HttpLibWebServerAdapterConan(ConanFile): name = "HttpLibWebServerAdapter" @@ -10,36 +10,17 @@ class HttpLibWebServerAdapterConan(ConanFile): license = "MIT" generators = "cmake_find_package" settings = "os", "compiler", "build_type", "arch" - options = {"gtest": ["1.7.0", "1.8.1", "1.10.0"], "openssl": ["1.0.2s", "1.1.1g", "1.1.1k"]} - default_options = {"gtest":"1.10.0", "openssl":"1.1.1k"} - exports_sources = "*", "!build-*", "!*.yml", "!*.md", "!*.in", "!ci", "!.gitattributes", "!.gitignore", "!LICENSE" + exports_sources = "*", "!build*", "!*.yml", "!*.xml", "!*.md", "!*.in", "!ci", "!.gitattributes", "!.gitignore" def configure(self): - self.options["WebServerAdapterTestUtilities"].gtest = self.options.gtest self.options["openssl"].shared = True def requirements(self): - self.requires("WebServerAdapterInterface/2.0.1@systelab/stable") - self.requires("zlib/1.2.11#e69eb26137def0a77953bb0afe1bcb54") - - if self.options.openssl == "1.1.1g": - self.requires("openssl/1.1.1g#58b78c1738d0cff868861e077e707ca4") - elif self.options.openssl == "1.1.1k": - self.requires("openssl/1.1.1k#64a45e7ba6f25fd93cec135fe3b3d958") - else: - self.requires(f"openssl/{self.options.openssl}") - - def build_requirements(self): - self.build_requires("WebServerAdapterTestUtilities/2.0.1@systelab/stable") - - if self.options.gtest == "1.7.0": - self.build_requires("gtest/1.7.0@systelab/stable") - elif self.options.gtest == "1.8.1": - self.build_requires("gtest/1.8.1") - elif self.options.gtest == "1.10.0": - self.build_requires("gtest/1.10.0#0c895f60b461f8fee0da53a84d659131") - else: - self.build_requires(f"gtest/{self.options.gtest}") + self.requires("WebServerAdapterInterface/2.0.2@systelab/stable") + self.requires("zlib/1.2.13#13c96f538b52e1600c40b88994de240f") + self.requires("openssl/3.0.12#1670458f93ec138c3bb6afc65a1cd667") + self.requires("gtest/1.14.0#4372c5aed2b4018ed9f9da3e218d18b3", private=True) + self.requires("WebServerAdapterTestUtilities/2.0.2@systelab/stable", private=True) def build(self): cmake = CMake(self) diff --git a/test/HttpLibWebServerAdapterTest/Tests/ReplyCORSHeadersBuilderServiceTest.cpp b/test/HttpLibWebServerAdapterTest/Tests/ReplyCORSHeadersBuilderServiceTest.cpp index 9faba6a..1949aa8 100644 --- a/test/HttpLibWebServerAdapterTest/Tests/ReplyCORSHeadersBuilderServiceTest.cpp +++ b/test/HttpLibWebServerAdapterTest/Tests/ReplyCORSHeadersBuilderServiceTest.cpp @@ -161,6 +161,6 @@ namespace systelab { namespace web_server { namespace httplib { namespace test { ASSERT_TRUE(compareReplyHeaders(GetParam().expectedReplyHeaders, actualReplyHeaders)); } - INSTANTIATE_TEST_CASE_P(WebServer, ReplyCORSHeadersBuilderServiceTest, testing::ValuesIn(replyCORSHeadersBuilderServiceTestData)); + INSTANTIATE_TEST_SUITE_P(WebServer, ReplyCORSHeadersBuilderServiceTest, testing::ValuesIn(replyCORSHeadersBuilderServiceTestData)); }}}} diff --git a/test/HttpLibWebServerAdapterTest/Tests/RequestURIParserServiceTest.cpp b/test/HttpLibWebServerAdapterTest/Tests/RequestURIParserServiceTest.cpp index 4422212..939bfce 100644 --- a/test/HttpLibWebServerAdapterTest/Tests/RequestURIParserServiceTest.cpp +++ b/test/HttpLibWebServerAdapterTest/Tests/RequestURIParserServiceTest.cpp @@ -93,6 +93,6 @@ namespace systelab { namespace web_server { namespace httplib { namespace test { } } - INSTANTIATE_TEST_CASE_P(WebServer, RequestURIParserServiceTest, testing::ValuesIn(requestURIParserServiceTestData)); + INSTANTIATE_TEST_SUITE_P(WebServer, RequestURIParserServiceTest, testing::ValuesIn(requestURIParserServiceTestData)); }}}} diff --git a/test/HttpLibWebServerAdapterTest/Tests/SecuredServerTest.cpp b/test/HttpLibWebServerAdapterTest/Tests/SecuredServerTest.cpp index f88fd68..a4ed1c9 100644 --- a/test/HttpLibWebServerAdapterTest/Tests/SecuredServerTest.cpp +++ b/test/HttpLibWebServerAdapterTest/Tests/SecuredServerTest.cpp @@ -134,6 +134,6 @@ namespace systelab { namespace web_server { namespace httplib { namespace test { EXPECT_TRUE(EntityComparator()(expectedReply, *reply)); } - INSTANTIATE_TEST_CASE_P(SecuredServer, SecuredServerTest, testing::ValuesIn(ServerTestDataBuilder::build())); + INSTANTIATE_TEST_SUITE_P(SecuredServer, SecuredServerTest, testing::ValuesIn(ServerTestDataBuilder::build())); }}}} diff --git a/test/HttpLibWebServerAdapterTest/Tests/ServerTest.cpp b/test/HttpLibWebServerAdapterTest/Tests/ServerTest.cpp index ca4480f..3a76c01 100644 --- a/test/HttpLibWebServerAdapterTest/Tests/ServerTest.cpp +++ b/test/HttpLibWebServerAdapterTest/Tests/ServerTest.cpp @@ -58,6 +58,6 @@ namespace systelab { namespace web_server { namespace httplib { namespace test { EXPECT_TRUE(EntityComparator()(expectedReply, *reply)); } - INSTANTIATE_TEST_CASE_P(Server, ServerTest, testing::ValuesIn(ServerTestDataBuilder::build())); + INSTANTIATE_TEST_SUITE_P(Server, ServerTest, testing::ValuesIn(ServerTestDataBuilder::build())); }}}} diff --git a/test_package/conanfile.py b/test_package/conanfile.py index b8347c3..3fccd88 100644 --- a/test_package/conanfile.py +++ b/test_package/conanfile.py @@ -3,11 +3,8 @@ class HttpLibWebServerAdapterTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "cmake_find_package" - options = {"gtest": ["1.7.0", "1.8.1", "1.10.0"], "openssl": ["1.0.2n", "1.0.2s", "1.1.1g", "1.1.1k"]} - default_options = {"gtest":"1.10.0", "openssl":"1.1.1k"} def configure(self): - self.options["HttpLibWebServerAdapter"].gtest = self.options.gtest self.options["HttpLibWebServerAdapter"].openssl = self.options.openssl def build(self): diff --git a/vs2022.conanprofile b/vs2022.conanprofile new file mode 100644 index 0000000..fdad5d4 --- /dev/null +++ b/vs2022.conanprofile @@ -0,0 +1,9 @@ +[settings] +os=Windows +os_build=Windows +compiler=Visual Studio +compiler.version=17 +compiler.toolset=v143 + +[options] +openssl:shared=true From 560fcb380bd929321c2bf06630a5c7c65f98a117 Mon Sep 17 00:00:00 2001 From: Thymir Date: Fri, 23 Feb 2024 16:14:41 +0100 Subject: [PATCH 2/2] only openssl shared option left in test_package conanfile --- test_package/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_package/conanfile.py b/test_package/conanfile.py index 3fccd88..78677fe 100644 --- a/test_package/conanfile.py +++ b/test_package/conanfile.py @@ -5,7 +5,7 @@ class HttpLibWebServerAdapterTestConan(ConanFile): generators = "cmake_find_package" def configure(self): - self.options["HttpLibWebServerAdapter"].openssl = self.options.openssl + self.options["openssl"].shared = True def build(self): cmake = CMake(self)