Make test suite optional by using CTest
This commit is contained in:
parent
5a5699bdbd
commit
8f824265ea
@ -15,6 +15,9 @@ option(ENABLE_HLSL "Enables HLSL input support" ON)
|
|||||||
|
|
||||||
project(glslang)
|
project(glslang)
|
||||||
|
|
||||||
|
# make testing optional
|
||||||
|
include(CTest)
|
||||||
|
|
||||||
if(ENABLE_AMD_EXTENSIONS)
|
if(ENABLE_AMD_EXTENSIONS)
|
||||||
add_definitions(-DAMD_EXTENSIONS)
|
add_definitions(-DAMD_EXTENSIONS)
|
||||||
endif(ENABLE_AMD_EXTENSIONS)
|
endif(ENABLE_AMD_EXTENSIONS)
|
||||||
|
|||||||
8
External/CMakeLists.txt
vendored
8
External/CMakeLists.txt
vendored
@ -1,9 +1,10 @@
|
|||||||
# Suppress all warnings from external projects.
|
# Suppress all warnings from external projects.
|
||||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS -w)
|
set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS -w)
|
||||||
|
|
||||||
if (TARGET gmock)
|
if(BUILD_TESTING)
|
||||||
|
if(TARGET gmock)
|
||||||
message(STATUS "Google Mock already configured - use it")
|
message(STATUS "Google Mock already configured - use it")
|
||||||
elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest)
|
elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest)
|
||||||
# We need to make sure Google Test does not mess up with the
|
# We need to make sure Google Test does not mess up with the
|
||||||
# global CRT settings on Windows.
|
# global CRT settings on Windows.
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
@ -27,7 +28,8 @@ elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest)
|
|||||||
gtest_disable_pthreads
|
gtest_disable_pthreads
|
||||||
gtest_force_shared_crt
|
gtest_force_shared_crt
|
||||||
gtest_hide_internal_symbols)
|
gtest_hide_internal_symbols)
|
||||||
else()
|
else()
|
||||||
message(STATUS
|
message(STATUS
|
||||||
"Google Mock was not found - tests based on that will not build")
|
"Google Mock was not found - tests based on that will not build")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
if (TARGET gmock)
|
if(BUILD_TESTING)
|
||||||
|
if(TARGET gmock)
|
||||||
message(STATUS "Google Mock found - building tests")
|
message(STATUS "Google Mock found - building tests")
|
||||||
|
|
||||||
set(TEST_SOURCES
|
set(TEST_SOURCES
|
||||||
@ -52,4 +53,5 @@ if (TARGET gmock)
|
|||||||
|
|
||||||
add_test(NAME glslang-gtests
|
add_test(NAME glslang-gtests
|
||||||
COMMAND glslangtests --test-root "${GLSLANG_TEST_DIRECTORY}")
|
COMMAND glslangtests --test-root "${GLSLANG_TEST_DIRECTORY}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user