Merge branch 'windows_tests' into 'master'

Support running tests and benchmarks for windows

See merge request OpenMW/openmw!839
libera
psi29a 4 years ago
commit e9fbd76e9b

@ -170,6 +170,10 @@ variables: &cs-targets
targets: "openmw-cs,bsatool,esmtool,niftest" targets: "openmw-cs,bsatool,esmtool,niftest"
package: "CS" package: "CS"
variables: &tests-targets
targets: "openmw_test_suite,openmw_detournavigator_navmeshtilescache_benchmark"
package: "Tests"
.Windows_Ninja_Base: .Windows_Ninja_Base:
tags: tags:
- windows - windows
@ -188,7 +192,7 @@ variables: &cs-targets
- $time = (Get-Date -Format "HH:mm:ss") - $time = (Get-Date -Format "HH:mm:ss")
- echo ${time} - echo ${time}
- echo "started by ${GITLAB_USER_NAME}" - 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 -t
- cd MSVC2019_64_Ninja - cd MSVC2019_64_Ninja
- .\ActivateMSVC.ps1 - .\ActivateMSVC.ps1
- cmake --build . --config $config --target ($targets.Split(',')) - cmake --build . --config $config --target ($targets.Split(','))
@ -200,6 +204,7 @@ variables: &cs-targets
Get-ChildItem -Recurse *.pdb | Remove-Item Get-ChildItem -Recurse *.pdb | Remove-Item
} }
- 7z a -tzip ..\..\OpenMW_MSVC2019_64_${package}_${config}_${CI_COMMIT_REF_NAME}.zip '*' - 7z a -tzip ..\..\OpenMW_MSVC2019_64_${package}_${config}_${CI_COMMIT_REF_NAME}.zip '*'
- if ($executables) { foreach ($exe in $executables.Split(',')) { & .\$exe } }
after_script: after_script:
- Copy-Item C:\ProgramData\chocolatey\logs\chocolatey.log - Copy-Item C:\ProgramData\chocolatey\logs\chocolatey.log
cache: cache:
@ -263,6 +268,15 @@ Windows_Ninja_CS_RelWithDebInfo:
<<: *cs-targets <<: *cs-targets
config: "RelWithDebInfo" config: "RelWithDebInfo"
Windows_Ninja_Tests_RelWithDebInfo:
extends: .Windows_Ninja_Base
stage: build
variables:
<<: *tests-targets
config: "RelWithDebInfo"
# Gitlab can't successfully execute following binaries due to unknown reason
# executables: "openmw_test_suite.exe,openmw_detournavigator_navmeshtilescache_benchmark.exe"
.Windows_MSBuild_Base: .Windows_MSBuild_Base:
tags: tags:
- windows - windows
@ -280,7 +294,7 @@ Windows_Ninja_CS_RelWithDebInfo:
- $time = (Get-Date -Format "HH:mm:ss") - $time = (Get-Date -Format "HH:mm:ss")
- echo ${time} - echo ${time}
- echo "started by ${GITLAB_USER_NAME}" - 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 -t
- cd MSVC2019_64 - cd MSVC2019_64
- cmake --build . --config $config --target ($targets.Split(',')) - cmake --build . --config $config --target ($targets.Split(','))
- cd $config - cd $config
@ -291,6 +305,7 @@ Windows_Ninja_CS_RelWithDebInfo:
Get-ChildItem -Recurse *.pdb | Remove-Item Get-ChildItem -Recurse *.pdb | Remove-Item
} }
- 7z a -tzip ..\..\OpenMW_MSVC2019_64_${package}_${config}_${CI_COMMIT_REF_NAME}.zip '*' - 7z a -tzip ..\..\OpenMW_MSVC2019_64_${package}_${config}_${CI_COMMIT_REF_NAME}.zip '*'
- if ($executables) { foreach ($exe in $executables.Split(',')) { & .\$exe } }
after_script: after_script:
- Copy-Item C:\ProgramData\chocolatey\logs\chocolatey.log - Copy-Item C:\ProgramData\chocolatey\logs\chocolatey.log
cache: cache:
@ -354,6 +369,15 @@ Windows_MSBuild_CS_RelWithDebInfo:
<<: *cs-targets <<: *cs-targets
config: "RelWithDebInfo" config: "RelWithDebInfo"
Windows_MSBuild_Tests_RelWithDebInfo:
extends: .Windows_MSBuild_Base
stage: build
variables:
<<: *tests-targets
config: "RelWithDebInfo"
# 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: Debian_AndroidNDK_arm64-v8a:
tags: tags:
- linux - linux

@ -73,6 +73,7 @@ CONFIGURATIONS=()
TEST_FRAMEWORK="" TEST_FRAMEWORK=""
GOOGLE_INSTALL_ROOT="" GOOGLE_INSTALL_ROOT=""
INSTALL_PREFIX="." INSTALL_PREFIX="."
BUILD_BENCHMARKS=""
ACTIVATE_MSVC="" ACTIVATE_MSVC=""
SINGLE_CONFIG="" SINGLE_CONFIG=""
@ -133,6 +134,9 @@ while [ $# -gt 0 ]; do
INSTALL_PREFIX=$(echo "$1" | sed 's;\\;/;g' | sed -E 's;/+;/;g') INSTALL_PREFIX=$(echo "$1" | sed 's;\\;/;g' | sed -E 's;/+;/;g')
shift ;; shift ;;
b )
BUILD_BENCHMARKS=true ;;
h ) h )
cat <<EOF cat <<EOF
Usage: $0 [-cdehkpuvVi] Usage: $0 [-cdehkpuvVi]
@ -167,6 +171,8 @@ Options:
Run verbosely Run verbosely
-i -i
CMake install prefix CMake install prefix
-b
Build benchmarks
EOF EOF
wrappedExit 0 wrappedExit 0
;; ;;
@ -1067,6 +1073,10 @@ fi
done done
#fi #fi
if [ "${BUILD_BENCHMARKS}" ]; then
add_cmake_opts -DBUILD_BENCHMARKS=ON
fi
if [ -n "$ACTIVATE_MSVC" ]; then if [ -n "$ACTIVATE_MSVC" ]; then
echo -n "- Activating MSVC in the current shell... " echo -n "- Activating MSVC in the current shell... "
command -v vswhere >/dev/null 2>&1 || { echo "Error: vswhere is not on the path."; wrappedExit 1; } command -v vswhere >/dev/null 2>&1 || { echo "Error: vswhere is not on the path."; wrappedExit 1; }

@ -667,6 +667,10 @@ if (WIN32)
if (BUILD_WIZARD) if (BUILD_WIZARD)
set_target_properties(openmw-wizard PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}") set_target_properties(openmw-wizard PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}")
endif() endif()
if (BUILD_BENCHMARKS)
set_target_properties(openmw_detournavigator_navmeshtilescache_benchmark PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}")
endif()
endif(MSVC) endif(MSVC)
# TODO: At some point release builds should not use the console but rather write to a log file # TODO: At some point release builds should not use the console but rather write to a log file

@ -19,16 +19,9 @@ FetchContent_MakeAvailableExcludeFromAll(benchmark)
set(CMAKE_CXX_FLAGS "${SAVED_CMAKE_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "${SAVED_CMAKE_CXX_FLAGS}")
openmw_add_executable(openmw_detournavigator_navmeshtilescache_benchmark detournavigator/navmeshtilescache.cpp) 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_compile_features(openmw_detournavigator_navmeshtilescache_benchmark PRIVATE cxx_std_17)
target_link_libraries(openmw_detournavigator_navmeshtilescache_benchmark benchmark::benchmark components) target_link_libraries(openmw_detournavigator_navmeshtilescache_benchmark benchmark::benchmark components)
if (UNIX AND NOT APPLE) if (UNIX AND NOT APPLE)
target_link_libraries(openmw_detournavigator_navmeshtilescache_benchmark ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(openmw_detournavigator_navmeshtilescache_benchmark ${CMAKE_THREAD_LIBS_INIT})
endif() endif()
if (MSVC)
if (CMAKE_CL_64)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj")
endif (CMAKE_CL_64)
endif (MSVC)

@ -12,6 +12,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <gmock/gmock.h> #include <gmock/gmock.h>
#include <array>
#include <deque> #include <deque>
MATCHER_P3(Vec3fEq, x, y, z, "") MATCHER_P3(Vec3fEq, x, y, z, "")

@ -14,6 +14,8 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <gmock/gmock.h> #include <gmock/gmock.h>
#include <array>
namespace DetourNavigator namespace DetourNavigator
{ {
static inline bool operator ==(const RecastMesh::Water& lhs, const RecastMesh::Water& rhs) static inline bool operator ==(const RecastMesh::Water& lhs, const RecastMesh::Water& rhs)

Loading…
Cancel
Save