File tree Expand file tree Collapse file tree 8 files changed +52
-16
lines changed
Expand file tree Collapse file tree 8 files changed +52
-16
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ before_build:
1515 - git submodule update --init --recursive
1616build_script :
1717 - ps : . $Env:APPVEYOR_BUILD_FOLDER/ci/appveyor/build.ps1
18-
18+ test_script :
19+ - ps : . $Env:APPVEYOR_BUILD_FOLDER/ci/appveyor/test.ps1
1920
2021deploy :
2122 - provider : GitHub
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ if ($DeployBuild) {
111111 7z a " $ ( $PackageName ) -builds-$ ( $buildConfig.PackageType ) .zip" " $env: APPVEYOR_BUILD_FOLDER /../install/*"
112112 Push-AppveyorArtifact " $ ( $PackageName ) -builds-$ ( $buildConfig.PackageType ) .zip"
113113} else {
114- cmake - DFSO_USE_SPEECH= " ON" - DFSO_FATAL_WARNINGS= " ON" - DFSO_USE_VOICEREC= " ON" - DMSVC_SIMD_INSTRUCTIONS= SSE2 `
114+ cmake - DFSO_USE_SPEECH= " ON" - DFSO_FATAL_WARNINGS= " ON" - DFSO_USE_VOICEREC= " ON" - DFSO_BUILD_TESTS = " ON " - DMSVC_SIMD_INSTRUCTIONS= SSE2 `
115115 - G " $Env: CMAKE_GENERATOR " - T " $Env: PlatformToolset " ..
116116
117117 cmake -- build . -- config " $Env: CONFIGURATION " -- / verbosity:minimal
Original file line number Diff line number Diff line change 1+
2+ if ([System.Convert ]::ToBoolean($env: DeployBuild )) {
3+ # Skip tests for deployment
4+ exit 0
5+ } else {
6+ # Appveyor doesn't have OpenAL so copy our DLLs to the output FOLDER
7+ $arch = " "
8+ if ($Env: CMAKE_GENERATOR -Match " Win64" ) {
9+ $arch = " win64"
10+ } else {
11+ $arch = " win32"
12+ }
13+ $dllPath = " $Env: APPVEYOR_BUILD_FOLDER \lib\openal\libs\$arch \OpenAL32.dll"
14+ $copyDestination = " $pwd \bin\$Env: CONFIGURATION \"
15+
16+ write " Copying OpenAL DLL..."
17+ Copy-Item " $dllPath " " $copyDestination "
18+
19+ write " Running unit tests..."
20+ # Run unit tests
21+ & " $pwd \bin\$Env: CONFIGURATION \unittests.exe" -- gtest_shuffle 2>&1
22+
23+ if (! ($? )) {
24+ exit 1
25+ }
26+ }
Original file line number Diff line number Diff line change @@ -66,6 +66,22 @@ ENDIF(EXISTS \"${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${FILE}\")
6666 SET (${OUTVAR} "${CMAKE_COMMAND} " -P ${CMAKE_CURRENT_BINARY_DIR} /${TARGET} /${NAME} PARENT_SCOPE)
6767ENDFUNCTION (EP_CHECK_FILE_EXISTS)
6868
69+ MACRO (COPY_FILE_TO_TARGET _target _file)
70+ if (UNIX )
71+ ADD_CUSTOM_COMMAND (
72+ TARGET ${_target} POST_BUILD
73+ COMMAND cp -a "${_file} " "$<TARGET_FILE_DIR:${_target} >/${LIBRAY_DESTINATION} /"
74+ COMMENT "copying '${_file} '..."
75+ )
76+ else ()
77+ ADD_CUSTOM_COMMAND (
78+ TARGET ${_target} POST_BUILD
79+ COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_file} " "$<TARGET_FILE_DIR:${_target} >/${LIBRAY_DESTINATION} /"
80+ COMMENT "copying '${_file} '..."
81+ )
82+ endif ()
83+ endmacro (COPY_FILE_TO_TARGET)
84+
6985MACRO (COPY_FILES_TO_TARGET _target)
7086 if (UNIX )
7187 ADD_CUSTOM_COMMAND (
@@ -76,19 +92,7 @@ MACRO(COPY_FILES_TO_TARGET _target)
7692 endif ()
7793
7894 FOREACH (file IN LISTS TARGET_COPY_FILES)
79- if (UNIX )
80- ADD_CUSTOM_COMMAND (
81- TARGET ${_target} POST_BUILD
82- COMMAND cp -a "${file} " "$<TARGET_FILE_DIR:${_target} >/${LIBRAY_DESTINATION} /"
83- COMMENT "copying '${file} '..."
84- )
85- else ()
86- ADD_CUSTOM_COMMAND (
87- TARGET ${_target} POST_BUILD
88- COMMAND ${CMAKE_COMMAND} -E copy_if_different "${file} " "$<TARGET_FILE_DIR:${_target} >/${LIBRAY_DESTINATION} /"
89- COMMENT "copying '${file} '..."
90- )
91- endif ()
95+ COPY_FILE_TO_TARGET("${_target} " "${file} " )
9296 ENDFOREACH (file)
9397ENDMACRO (COPY_FILES_TO_TARGET)
9498
Original file line number Diff line number Diff line change @@ -12,3 +12,6 @@ set_target_properties(unittests PROPERTIES FOLDER "tests")
1212file (TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /../test_data" TEST_DATA_PATH)
1313string (REPLACE "\\ " "\\\\ " TEST_DATA_PATH "${TEST_DATA_PATH} " )
1414target_compile_definitions (unittests PRIVATE "TEST_DATA_PATH=\" ${TEST_DATA_PATH} \" " )
15+
16+ INCLUDE (util)
17+ COPY_FILES_TO_TARGET(unittests)
Original file line number Diff line number Diff line change 33#include < gtest/gtest.h>
44#include < globalincs/vmallocator.h>
55
6+ #include < cstdint>
7+
68namespace test {
79
810enum InitFlags {
@@ -13,7 +15,7 @@ enum InitFlags {
1315
1416class FSTestFixture : public ::testing::Test {
1517 private:
16- uint64_t _initFlags;
18+ std:: uint64_t _initFlags;
1719
1820 SCP_vector<SCP_string> _cmdlineArgs;
1921 SCP_string _currentModDir;
You can’t perform that action at this time.
0 commit comments