2016-03-04 21:22:34 +00:00
|
|
|
if (TARGET gmock)
|
|
|
|
message(STATUS "Google Mock found - building tests")
|
|
|
|
|
|
|
|
set(TEST_SOURCES
|
|
|
|
# Framework related source files
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Initializer.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Settings.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Settings.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/TestFixture.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/TestFixture.h
|
|
|
|
|
|
|
|
# Test related source files
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/AST.FromFile.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/BuiltInResource.FromFile.cpp
|
2016-05-19 17:50:49 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Config.FromFile.cpp
|
Parser: Implement extension GL_AMD_gpu_shader_half_float.
- Add built-in types: float16_t, f16vec, f16mat.
- Add support of half float constant: hf, HF.
- Extend built-in floating-point operators: +, -, *, /, ++, --, +=, -=,
*=, /=, ==, !=, >=, <=, >, <.
- Add support of type conversions: float16_t -> XXX, XXX -> float16_t.
- Add new built-in functions.
2016-07-29 08:00:05 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/HexFloat.cpp
|
2016-05-16 16:50:30 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Hlsl.FromFile.cpp
|
2016-05-18 03:03:28 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Link.FromFile.cpp
|
2016-03-04 21:22:34 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Pp.FromFile.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Spv.FromFile.cpp
|
2016-09-02 15:21:12 +00:00
|
|
|
# -- Remapper tests
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Remap.FromFile.cpp
|
2016-03-04 21:22:34 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(glslangtests ${TEST_SOURCES})
|
2016-05-05 18:45:53 +00:00
|
|
|
set_property(TARGET glslangtests PROPERTY FOLDER tests)
|
2016-06-02 18:37:24 +00:00
|
|
|
glslang_set_link_args(glslangtests)
|
2016-05-05 18:58:26 +00:00
|
|
|
install(TARGETS glslangtests
|
|
|
|
RUNTIME DESTINATION bin)
|
|
|
|
|
2016-10-05 14:25:09 +00:00
|
|
|
set(GLSLANG_TEST_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../Test")
|
|
|
|
# Supply a default test root directory, so that manual testing
|
|
|
|
# doesn't have to specify the --test-root option in the normal
|
|
|
|
# case that you want to use the tests from the same source tree.
|
2016-03-04 21:22:34 +00:00
|
|
|
target_compile_definitions(glslangtests
|
2016-10-05 14:25:09 +00:00
|
|
|
PRIVATE GLSLANG_TEST_DIRECTORY="${GLSLANG_TEST_DIRECTORY}")
|
2016-03-04 21:22:34 +00:00
|
|
|
target_include_directories(glslangtests PRIVATE
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${PROJECT_SOURCE_DIR}
|
|
|
|
${gmock_SOURCE_DIR}/include
|
|
|
|
${gtest_SOURCE_DIR}/include)
|
2017-01-11 21:50:16 +00:00
|
|
|
|
|
|
|
set(LIBRARIES
|
|
|
|
SPVRemapper glslang OSDependent OGLCompiler glslang
|
|
|
|
SPIRV glslang-default-resource-limits)
|
|
|
|
if(ENABLE_HLSL)
|
|
|
|
set(LIBRARIES ${LIBRARIES} HLSL)
|
|
|
|
endif(ENABLE_HLSL)
|
|
|
|
target_link_libraries(glslangtests PRIVATE ${LIBRARIES} gmock)
|
|
|
|
|
2016-10-05 14:25:09 +00:00
|
|
|
add_test(NAME glslang-gtests
|
2017-01-11 21:50:16 +00:00
|
|
|
COMMAND glslangtests --test-root "${GLSLANG_TEST_DIRECTORY}")
|
2016-03-04 21:22:34 +00:00
|
|
|
endif()
|