Skip to content

Commit 80bc99c

Browse files
authored
Skip entire test/ folder if SPIRV_SKIP_TESTS is set. (KhronosGroup#5548)
Without this (or similar filtering), the `spirv-tools_expect_unittests` and `spirv-tools_spirv_test_framework_unittests` Python tests at `test/tools/` get defined even when `SPIRV_SKIP_TESTS` is set.
1 parent 0a6f0d1 commit 80bc99c

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

test/CMakeLists.txt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,23 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
if (${SPIRV_SKIP_TESTS})
16+
return()
17+
endif()
18+
19+
if (TARGET gmock_main)
20+
message(STATUS "Found Google Mock, building tests.")
21+
else()
22+
message(STATUS "Did not find googletest, tests will not be built. "
23+
"To enable tests place googletest in '<spirv-dir>/external/googletest'.")
24+
endif()
25+
1526
# Add a SPIR-V Tools unit test. Signature:
1627
# add_spvtools_unittest(
1728
# TARGET target_name
1829
# SRCS src_file.h src_file.cpp
1930
# LIBS lib1 lib2
2031
# )
21-
22-
if (NOT "${SPIRV_SKIP_TESTS}")
23-
if (TARGET gmock_main)
24-
message(STATUS "Found Google Mock, building tests.")
25-
else()
26-
message(STATUS "Did not find googletest, tests will not be built. "
27-
"To enable tests place googletest in '<spirv-dir>/external/googletest'.")
28-
endif()
29-
endif()
30-
3132
function(add_spvtools_unittest)
3233
if (NOT "${SPIRV_SKIP_TESTS}" AND TARGET gmock_main)
3334
set(one_value_args TARGET PCH_FILE)

0 commit comments

Comments
 (0)