3 message(STATUS "Google Mock found - building tests")
6 # Framework related source files
7 ${CMAKE_CURRENT_SOURCE_DIR}/Initializer.h
8 ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
9 ${CMAKE_CURRENT_SOURCE_DIR}/Settings.cpp
10 ${CMAKE_CURRENT_SOURCE_DIR}/Settings.h
11 ${CMAKE_CURRENT_SOURCE_DIR}/TestFixture.cpp
12 ${CMAKE_CURRENT_SOURCE_DIR}/TestFixture.h
14 # Test related source files
15 ${CMAKE_CURRENT_SOURCE_DIR}/AST.FromFile.cpp
16 ${CMAKE_CURRENT_SOURCE_DIR}/BuiltInResource.FromFile.cpp
17 ${CMAKE_CURRENT_SOURCE_DIR}/Config.FromFile.cpp
18 ${CMAKE_CURRENT_SOURCE_DIR}/HexFloat.cpp
19 ${CMAKE_CURRENT_SOURCE_DIR}/Hlsl.FromFile.cpp
20 ${CMAKE_CURRENT_SOURCE_DIR}/Link.FromFile.cpp
21 ${CMAKE_CURRENT_SOURCE_DIR}/Link.FromFile.Vk.cpp
22 ${CMAKE_CURRENT_SOURCE_DIR}/Pp.FromFile.cpp
23 ${CMAKE_CURRENT_SOURCE_DIR}/Spv.FromFile.cpp
26 ${CMAKE_CURRENT_SOURCE_DIR}/Remap.FromFile.cpp)
28 add_executable(glslangtests ${TEST_SOURCES})
29 set_property(TARGET glslangtests PROPERTY FOLDER tests)
30 glslang_set_link_args(glslangtests)
31 install(TARGETS glslangtests
32 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
34 set(GLSLANG_TEST_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../Test")
35 # Supply a default test root directory, so that manual testing
36 # doesn't have to specify the --test-root option in the normal
37 # case that you want to use the tests from the same source tree.
38 target_compile_definitions(glslangtests
39 PRIVATE GLSLANG_TEST_DIRECTORY="${GLSLANG_TEST_DIRECTORY}")
40 target_include_directories(glslangtests PRIVATE
41 ${CMAKE_CURRENT_SOURCE_DIR}
43 ${gmock_SOURCE_DIR}/include
44 ${gtest_SOURCE_DIR}/include)
47 SPVRemapper glslang OSDependent OGLCompiler glslang
48 SPIRV glslang-default-resource-limits)
50 set(LIBRARIES ${LIBRARIES} HLSL)
52 target_link_libraries(glslangtests PRIVATE ${LIBRARIES} gmock)
54 add_test(NAME glslang-gtests
55 COMMAND glslangtests --test-root "${GLSLANG_TEST_DIRECTORY}")