File tree 4 files changed +88
-5
lines changed
4 files changed +88
-5
lines changed Original file line number Diff line number Diff line change
1
+ version : ' {build}'
2
+
3
+ os : Visual Studio 2015
4
+
5
+ environment :
6
+ matrix :
7
+ - Toolset : v140
8
+ - Toolset : v120
9
+ - Toolset : v110
10
+ - Toolset : v100
11
+
12
+ platform :
13
+ - Win32
14
+ - x64
15
+
16
+ configuration :
17
+ # - Release
18
+ - Debug
19
+
20
+ build :
21
+ verbosity : minimal
22
+
23
+ artifacts :
24
+ - path : ' _build/Testing/Temporary/*'
25
+ name : test_results
26
+
27
+ before_build :
28
+ - ps : |
29
+ Write-Output "Configuration: $env:CONFIGURATION"
30
+ Write-Output "Platform: $env:PLATFORM"
31
+ $generator = switch ($env:TOOLSET)
32
+ {
33
+ "v140" {"Visual Studio 14 2015"}
34
+ "v120" {"Visual Studio 12 2013"}
35
+ "v110" {"Visual Studio 11 2012"}
36
+ "v100" {"Visual Studio 10 2010"}
37
+ }
38
+ if ($env:PLATFORM -eq "x64")
39
+ {
40
+ $generator = "$generator Win64"
41
+ }
42
+
43
+ build_script :
44
+ - ps : |
45
+ if (($env:TOOLSET -eq "v100") -and ($env:PLATFORM -eq "x64"))
46
+ {
47
+ return
48
+ }
49
+ md _build -Force | Out-Null
50
+ cd _build
51
+
52
+ & cmake -G "$generator" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -Dgtest_build_tests=ON -Dgtest_build_samples=ON -Dgmock_build_tests=ON ..
53
+ if ($LastExitCode -ne 0) {
54
+ throw "Exec: $ErrorMessage"
55
+ }
56
+ & cmake --build . --config $env:CONFIGURATION
57
+ if ($LastExitCode -ne 0) {
58
+ throw "Exec: $ErrorMessage"
59
+ }
60
+
61
+ test_script :
62
+ - ps : |
63
+ if (($env:Toolset -eq "v100") -and ($env:PLATFORM -eq "x64"))
64
+ {
65
+ return
66
+ }
67
+
68
+ & ctest -C $env:CONFIGURATION --output-on-failure
69
+ if ($LastExitCode -ne 0) {
70
+ throw "Exec: $ErrorMessage"
71
+ }
Original file line number Diff line number Diff line change @@ -80,6 +80,10 @@ macro(config_compiler_and_linker)
80
80
# http://stackoverflow.com/questions/3232669 explains the issue.
81
81
set (cxx_base_flags "${cxx_base_flags} -wd4702" )
82
82
endif ()
83
+ if (NOT (MSVC_VERSION GREATER 1900)) # 1900 is Visual Studio 2015
84
+ # BigObj required for tests.
85
+ set (cxx_base_flags "${cxx_base_flags} -bigobj" )
86
+ endif ()
83
87
84
88
set (cxx_base_flags "${cxx_base_flags} -D_UNICODE -DUNICODE -DWIN32 -D_WIN32" )
85
89
set (cxx_base_flags "${cxx_base_flags} -DSTRICT -DWIN32_LEAN_AND_MEAN" )
@@ -235,8 +239,16 @@ function(py_test name)
235
239
# directly bind it from cmake. ${CTEST_CONFIGURATION_TYPE} is known
236
240
# only at ctest runtime (by calling ctest -c <Configuration>), so
237
241
# we have to escape $ to delay variable substitution here.
238
- add_test (${name}
239
- ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} /test /${name} .py
242
+ if (${CMAKE_MAJOR_VERSION} .${CMAKE_MINOR_VERSION} GREATER 3.1)
243
+ add_test (
244
+ NAME ${name}
245
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} /test /${name} .py
246
+ --build_dir=${CMAKE_CURRENT_BINARY_DIR} /$<CONFIGURATION >)
247
+ else (${CMAKE_MAJOR_VERSION} .${CMAKE_MINOR_VERSION} GREATER 3.1)
248
+ add_test (
249
+ ${name}
250
+ ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} /test /${name} .py
240
251
--build_dir=${CMAKE_CURRENT_BINARY_DIR} /\${CTEST_CONFIGURATION_TYPE} )
252
+ endif (${CMAKE_MAJOR_VERSION} .${CMAKE_MINOR_VERSION} GREATER 3.1)
241
253
endif ()
242
254
endfunction ()
Original file line number Diff line number Diff line change 71
71
TypedTest/0\. # TypeParam = (VeryLo{245}|class VeryLo{239})\.\.\.
72
72
TestA
73
73
TestB
74
- TypedTest/1\. # TypeParam = int\s*\*
74
+ TypedTest/1\. # TypeParam = int\s*\*( __ptr64)?
75
75
TestA
76
76
TestB
77
77
TypedTest/2\. # TypeParam = .*MyArray<bool,\s*42>
80
80
My/TypeParamTest/0\. # TypeParam = (VeryLo{245}|class VeryLo{239})\.\.\.
81
81
TestA
82
82
TestB
83
- My/TypeParamTest/1\. # TypeParam = int\s*\*
83
+ My/TypeParamTest/1\. # TypeParam = int\s*\*( __ptr64)?
84
84
TestA
85
85
TestB
86
86
My/TypeParamTest/2\. # TypeParam = .*MyArray<bool,\s*42>
Original file line number Diff line number Diff line change @@ -12,4 +12,4 @@ cmake -Dgtest_build_samples=ON \
12
12
-DCMAKE_CXX_FLAGS=$CXX_FLAGS \
13
13
../../$GTEST_TARGET
14
14
make
15
- make test
15
+ CTEST_OUTPUT_ON_FAILURE=1 make test
You can’t perform that action at this time.
0 commit comments