summaryrefslogtreecommitdiffstats
path: root/Tests/FindPython/CMakeLists.txt
blob: bd6e8ab8d3f5e0b9055b76e3f51d5ac89bcbb2c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
if(CMake_TEST_FindPython)
  add_test(NAME FindPython.Python2.LOCATION COMMAND
    ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/FindPython/Python2"
    "${CMake_BINARY_DIR}/Tests/FindPython/Python2.LOCATION"
    ${build_generator_args}
    --build-project TestPython2
    --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION
    --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
    )
  add_test(NAME FindPython.Python2.VERSION COMMAND
    ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/FindPython/Python2"
    "${CMake_BINARY_DIR}/Tests/FindPython/Python2.VERSION"
    ${build_generator_args}
    --build-project TestPython2
    --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION
    --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
    )

  add_test(NAME FindPython.Python2Fail COMMAND
    ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/FindPython/Python2Fail"
    "${CMake_BINARY_DIR}/Tests/FindPython/Python2Fail"
    ${build_generator_args}
    --build-project TestPython2Fail
    --build-options ${build_options}
    --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
    )
  set_tests_properties(FindPython.Python2Fail PROPERTIES
    PASS_REGULAR_EXPRESSION "Could NOT find Python2 \\(missing: foobar\\)")

  add_test(NAME FindPython.Python3.LOCATION COMMAND
    ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/FindPython/Python3"
    "${CMake_BINARY_DIR}/Tests/FindPython/Python3.LOCATION"
    ${build_generator_args}
    --build-project TestPython3
    --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION
    --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
    )
  add_test(NAME FindPython.Python3.VERSION COMMAND
    ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/FindPython/Python3"
    "${CMake_BINARY_DIR}/Tests/FindPython/Python3.VERSION"
    ${build_generator_args}
    --build-project TestPython3
    --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION
    --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
    )

  add_test(NAME FindPython.Python3Fail COMMAND
    ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/FindPython/Python3Fail"
    "${CMake_BINARY_DIR}/Tests/FindPython/Python3Fail"
    ${build_generator_args}
    --build-project TestPython3Fail
    --build-options ${build_options}
    --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
    )
  set_tests_properties(FindPython.Python3Fail PROPERTIES
    PASS_REGULAR_EXPRESSION "Could NOT find Python3 \\(missing: foobar\\)")

  add_test(NAME FindPython.Python COMMAND
    ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
    "${CMake_BINARY_DIR}/Tests/FindPython/Python"
    ${build_generator_args}
    --build-project TestPython
    --build-options ${build_options}
    --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
    )

  add_test(NAME FindPython.MultiplePackages COMMAND
    ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/FindPython/MultiplePackages"
    "${CMake_BINARY_DIR}/Tests/FindPython/MultiplePackages"
    ${build_generator_args}
    --build-project TestMultiplePackages
    --build-options ${build_options}
    --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
    )

  add_test(NAME FindPython.VirtualEnv COMMAND
    ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/FindPython/VirtualEnv"
    "${CMake_BINARY_DIR}/Tests/FindPython/VirtualEnv"
    ${build_generator_args}
    --build-project TestVirtualEnv
    --build-options ${build_options}
    --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
    )

  add_test(NAME FindPython.Python2Embedded COMMAND
    ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/FindPython/Python2Embedded"
    "${CMake_BINARY_DIR}/Tests/FindPython/Python2Embedded"
    ${build_generator_args}
    --build-project TestPython2Embedded
    --build-options ${build_options}
    --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
    )
  add_test(NAME FindPython.Python3Embedded COMMAND
    ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/FindPython/Python3Embedded"
    "${CMake_BINARY_DIR}/Tests/FindPython/Python3Embedded"
    ${build_generator_args}
    --build-project TestPython3Embedded
    --build-options ${build_options}
    --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
    )

  add_test(NAME FindPython.RequiredArtifacts COMMAND
    ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts"
    "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts"
    ${build_generator_args}
    --build-project TestRequiredArtifacts
    --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
    "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
    "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
    --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
    )

  add_test(NAME FindPython.ArtifactsInteractive.ON COMMAND
    ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/FindPython/ArtifactsInteractive"
    "${CMake_BINARY_DIR}/Tests/FindPython/ArtifactsInteractive.ON"
    ${build_generator_args}
    --build-project TestArtifactsScope
    --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
    "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
    "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
    "-DCMake_TEST_FindPython_NumPy=${CMake_TEST_FindPython_NumPy}"
    "-DPython3_ARTIFACTS_INTERACTIVE=ON"
    --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
    )
  add_test(NAME FindPython.ArtifactsInteractive.OFF COMMAND
    ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/FindPython/ArtifactsInteractive"
    "${CMake_BINARY_DIR}/Tests/FindPython/ArtifactsInteractive.OFF"
    ${build_generator_args}
    --build-project TestArtifactsScope
    --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
    "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
    "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
    "-DCMake_TEST_FindPython_NumPy=${CMake_TEST_FindPython_NumPy}"
    "-DPython3_ARTIFACTS_INTERACTIVE=OFF"
    --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
    )

  add_test(NAME FindPython.CustomFailureMessage COMMAND
    ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage"
    "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage"
    ${build_generator_args}
    --build-project TestCustomFailureMessage
    --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
    "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
    "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
    "-DCMake_TEST_FindPython_NumPy=${CMake_TEST_FindPython_NumPy}"
    --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
    )

  if (CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
    add_test(NAME FindPython.Interpreter.SOABI COMMAND
      ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
      --build-and-test
      "${CMake_SOURCE_DIR}/Tests/FindPython/SOABI"
      "${CMake_BINARY_DIR}/Tests/FindPython/SOABI.Interpreter"
      ${build_generator_args}
      --build-project TestSOABI
      --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
      "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
      "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
      "-DCMake_TEST_FindPython_COMPONENT=Interpreter"
      --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
      )
    add_test(NAME FindPython.Development.SOABI COMMAND
      ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
      --build-and-test
      "${CMake_SOURCE_DIR}/Tests/FindPython/SOABI"
      "${CMake_BINARY_DIR}/Tests/FindPython/SOABI.Development"
      ${build_generator_args}
      --build-project TestSOABI
      --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
      "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
      "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
      "-DCMake_TEST_FindPython_COMPONENT=Development"
      --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
      )
  endif()
endif()

if(CMake_TEST_FindPython_NumPy)
  add_test(NAME FindPython.NumPy COMMAND
    ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/FindPython/NumPy"
    "${CMake_BINARY_DIR}/Tests/FindPython/NumPy"
    ${build_generator_args}
    --build-project TestNumPy
    --build-options ${build_options}
    --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  )
  add_test(NAME FindPython.NumPyOnly COMMAND
    ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/FindPython/NumPyOnly"
    "${CMake_BINARY_DIR}/Tests/FindPython/NumPyOnly"
    ${build_generator_args}
    --build-project TestNumPyOnly
    --build-options ${build_options}
    --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  )
 endif()

 if(CMake_TEST_FindPython_Conda)
  add_test(NAME FindPython.VirtualEnvConda COMMAND
    ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/FindPython/VirtualEnvConda"
    "${CMake_BINARY_DIR}/Tests/FindPython/VirtualEnvConda"
    ${build_generator_args}
    --build-project TestVirtualEnvConda
    --build-options ${build_options}
    --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
    )
 endif()