From 4d7e5245a3f1d7a6691f96bd6c6d15621861f427 Mon Sep 17 00:00:00 2001 From: elsid Date: Mon, 10 May 2021 00:17:11 +0200 Subject: [PATCH 1/3] Support benchmarks for windows Don't run the binary because gitlab can't execute it successfully due to unknown reason. --- .gitlab-ci.yml | 28 ++++++++++++++++++++++++++-- CI/before_script.msvc.sh | 10 ++++++++++ CMakeLists.txt | 4 ++++ apps/benchmarks/CMakeLists.txt | 7 ------- 4 files changed, 40 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7be8fc997b..8d486ebf98 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -170,6 +170,10 @@ variables: &cs-targets targets: "openmw-cs,bsatool,esmtool,niftest" package: "CS" +variables: &tests-targets + targets: "openmw_detournavigator_navmeshtilescache_benchmark" + package: "Tests" + .Windows_Ninja_Base: tags: - windows @@ -188,7 +192,7 @@ variables: &cs-targets - $time = (Get-Date -Format "HH:mm:ss") - echo ${time} - echo "started by ${GITLAB_USER_NAME}" - - sh CI/before_script.msvc.sh -c $config -p Win64 -v 2019 -k -V -N + - sh CI/before_script.msvc.sh -c $config -p Win64 -v 2019 -k -V -N -b - cd MSVC2019_64_Ninja - .\ActivateMSVC.ps1 - cmake --build . --config $config --target ($targets.Split(',')) @@ -200,6 +204,7 @@ variables: &cs-targets Get-ChildItem -Recurse *.pdb | Remove-Item } - 7z a -tzip ..\..\OpenMW_MSVC2019_64_${package}_${config}_${CI_COMMIT_REF_NAME}.zip '*' + - if ($executables) { foreach ($exe in $executables.Split(',')) { & .\$exe } } after_script: - Copy-Item C:\ProgramData\chocolatey\logs\chocolatey.log cache: @@ -263,6 +268,15 @@ Windows_Ninja_CS_RelWithDebInfo: <<: *cs-targets config: "RelWithDebInfo" +Windows_Ninja_Tests_RelWithDebInfo: + extends: .Windows_Ninja_Base + stage: build + variables: + <<: *tests-targets + config: "RelWithDebInfo" + # Gitlab can't successfully execute benchamark binary due to unknown reason + # executables: "openmw_detournavigator_navmeshtilescache_benchmark.exe" + .Windows_MSBuild_Base: tags: - windows @@ -280,7 +294,7 @@ Windows_Ninja_CS_RelWithDebInfo: - $time = (Get-Date -Format "HH:mm:ss") - echo ${time} - echo "started by ${GITLAB_USER_NAME}" - - sh CI/before_script.msvc.sh -c $config -p Win64 -v 2019 -k -V + - sh CI/before_script.msvc.sh -c $config -p Win64 -v 2019 -k -V -b - cd MSVC2019_64 - cmake --build . --config $config --target ($targets.Split(',')) - cd $config @@ -291,6 +305,7 @@ Windows_Ninja_CS_RelWithDebInfo: Get-ChildItem -Recurse *.pdb | Remove-Item } - 7z a -tzip ..\..\OpenMW_MSVC2019_64_${package}_${config}_${CI_COMMIT_REF_NAME}.zip '*' + - if ($executables) { foreach ($exe in $executables.Split(',')) { & .\$exe } } after_script: - Copy-Item C:\ProgramData\chocolatey\logs\chocolatey.log cache: @@ -354,6 +369,15 @@ Windows_MSBuild_CS_RelWithDebInfo: <<: *cs-targets config: "RelWithDebInfo" +Windows_MSBuild_Tests_RelWithDebInfo: + extends: .Windows_MSBuild_Base + stage: build + variables: + <<: *tests-targets + config: "RelWithDebInfo" + # Gitlab can't successfully execute benchamark binary due to unknown reason + # executables: "openmw_detournavigator_navmeshtilescache_benchmark.exe" + Debian_AndroidNDK_arm64-v8a: tags: - linux diff --git a/CI/before_script.msvc.sh b/CI/before_script.msvc.sh index d98c280380..bb662c9de1 100644 --- a/CI/before_script.msvc.sh +++ b/CI/before_script.msvc.sh @@ -73,6 +73,7 @@ CONFIGURATIONS=() TEST_FRAMEWORK="" GOOGLE_INSTALL_ROOT="" INSTALL_PREFIX="." +BUILD_BENCHMARKS="" ACTIVATE_MSVC="" SINGLE_CONFIG="" @@ -133,6 +134,9 @@ while [ $# -gt 0 ]; do INSTALL_PREFIX=$(echo "$1" | sed 's;\\;/;g' | sed -E 's;/+;/;g') shift ;; + b ) + BUILD_BENCHMARKS=true ;; + h ) cat </dev/null 2>&1 || { echo "Error: vswhere is not on the path."; wrappedExit 1; } diff --git a/CMakeLists.txt b/CMakeLists.txt index 1041401074..a9f33c743f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -669,6 +669,10 @@ if (WIN32) if (BUILD_WIZARD) set_target_properties(openmw-wizard PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}") endif() + + if (BUILD_BENCHMARKS) + set_target_properties(openmw_detournavigator_navmeshtilescache_benchmark PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}") + endif() endif(MSVC) # TODO: At some point release builds should not use the console but rather write to a log file diff --git a/apps/benchmarks/CMakeLists.txt b/apps/benchmarks/CMakeLists.txt index b7170003ee..f9aa9aad49 100644 --- a/apps/benchmarks/CMakeLists.txt +++ b/apps/benchmarks/CMakeLists.txt @@ -19,16 +19,9 @@ FetchContent_MakeAvailableExcludeFromAll(benchmark) set(CMAKE_CXX_FLAGS "${SAVED_CMAKE_CXX_FLAGS}") openmw_add_executable(openmw_detournavigator_navmeshtilescache_benchmark detournavigator/navmeshtilescache.cpp) -target_compile_options(openmw_detournavigator_navmeshtilescache_benchmark PRIVATE -Wall) target_compile_features(openmw_detournavigator_navmeshtilescache_benchmark PRIVATE cxx_std_17) target_link_libraries(openmw_detournavigator_navmeshtilescache_benchmark benchmark::benchmark components) if (UNIX AND NOT APPLE) target_link_libraries(openmw_detournavigator_navmeshtilescache_benchmark ${CMAKE_THREAD_LIBS_INIT}) endif() - -if (MSVC) - if (CMAKE_CL_64) - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj") - endif (CMAKE_CL_64) -endif (MSVC) From 3ef1b270993a9b09e3a3613a142206e6ea9a9a27 Mon Sep 17 00:00:00 2001 From: elsid Date: Tue, 18 May 2021 01:21:42 +0200 Subject: [PATCH 2/3] Add missing includes --- apps/openmw_test_suite/detournavigator/navigator.cpp | 1 + apps/openmw_test_suite/detournavigator/recastmeshbuilder.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/apps/openmw_test_suite/detournavigator/navigator.cpp b/apps/openmw_test_suite/detournavigator/navigator.cpp index 6192765888..333613e77a 100644 --- a/apps/openmw_test_suite/detournavigator/navigator.cpp +++ b/apps/openmw_test_suite/detournavigator/navigator.cpp @@ -11,6 +11,7 @@ #include #include +#include #include MATCHER_P3(Vec3fEq, x, y, z, "") diff --git a/apps/openmw_test_suite/detournavigator/recastmeshbuilder.cpp b/apps/openmw_test_suite/detournavigator/recastmeshbuilder.cpp index 5f43f48008..b4b6645693 100644 --- a/apps/openmw_test_suite/detournavigator/recastmeshbuilder.cpp +++ b/apps/openmw_test_suite/detournavigator/recastmeshbuilder.cpp @@ -14,6 +14,8 @@ #include #include +#include + namespace DetourNavigator { static inline bool operator ==(const RecastMesh::Water& lhs, const RecastMesh::Water& rhs) From 959165bcb99140d38afbf7dc420f5ce647a321ea Mon Sep 17 00:00:00 2001 From: elsid Date: Tue, 18 May 2021 01:33:11 +0200 Subject: [PATCH 3/3] Support running unit tests on gitlab CI for windows But not actually run them because gitlab fails to do this. --- .gitlab-ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8d486ebf98..ceba2841fe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -171,7 +171,7 @@ variables: &cs-targets package: "CS" variables: &tests-targets - targets: "openmw_detournavigator_navmeshtilescache_benchmark" + targets: "openmw_test_suite,openmw_detournavigator_navmeshtilescache_benchmark" package: "Tests" .Windows_Ninja_Base: @@ -192,7 +192,7 @@ variables: &tests-targets - $time = (Get-Date -Format "HH:mm:ss") - echo ${time} - echo "started by ${GITLAB_USER_NAME}" - - sh CI/before_script.msvc.sh -c $config -p Win64 -v 2019 -k -V -N -b + - sh CI/before_script.msvc.sh -c $config -p Win64 -v 2019 -k -V -N -b -t - cd MSVC2019_64_Ninja - .\ActivateMSVC.ps1 - cmake --build . --config $config --target ($targets.Split(',')) @@ -274,8 +274,8 @@ Windows_Ninja_Tests_RelWithDebInfo: variables: <<: *tests-targets config: "RelWithDebInfo" - # Gitlab can't successfully execute benchamark binary due to unknown reason - # executables: "openmw_detournavigator_navmeshtilescache_benchmark.exe" + # Gitlab can't successfully execute following binaries due to unknown reason + # executables: "openmw_test_suite.exe,openmw_detournavigator_navmeshtilescache_benchmark.exe" .Windows_MSBuild_Base: tags: @@ -294,7 +294,7 @@ Windows_Ninja_Tests_RelWithDebInfo: - $time = (Get-Date -Format "HH:mm:ss") - echo ${time} - echo "started by ${GITLAB_USER_NAME}" - - sh CI/before_script.msvc.sh -c $config -p Win64 -v 2019 -k -V -b + - sh CI/before_script.msvc.sh -c $config -p Win64 -v 2019 -k -V -b -t - cd MSVC2019_64 - cmake --build . --config $config --target ($targets.Split(',')) - cd $config @@ -375,8 +375,8 @@ Windows_MSBuild_Tests_RelWithDebInfo: variables: <<: *tests-targets config: "RelWithDebInfo" - # Gitlab can't successfully execute benchamark binary due to unknown reason - # executables: "openmw_detournavigator_navmeshtilescache_benchmark.exe" + # Gitlab can't successfully execute following binaries due to unknown reason + # executables: "openmw_test_suite.exe,openmw_detournavigator_navmeshtilescache_benchmark.exe" Debian_AndroidNDK_arm64-v8a: tags: