cmake_minimum_required(VERSION 2.8)
project(spirv-tools)
+enable_testing()
set(SPIRV_TOOLS "SPIRV-Tools")
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
${CMAKE_CURRENT_SOURCE_DIR}
${gmock_SOURCE_DIR}/include ${gtest_SOURCE_DIR}/include)
target_link_libraries(UnitSPIRV PRIVATE ${SPIRV_TOOLS} gmock)
+ add_test(NAME spirv-tools-testsuite COMMAND UnitSPIRV)
else()
message(STATUS "Did not find googletest, tests will not be built."
"To enable tests place googletest in '<spirv-dir>/external/googletest'.")
* `spirv-val` - the standalone validator
* `<spirv-dir>/spirv-val`
-### UnitSPIRV tool
+### Tests
+
+Tests are only built when googletest is found.
The `<spirv-build-dir>/UnitSPIRV` executable runs the project tests.
It supports the standard `googletest` command line options.
+The project also adds a CMake test `spirv-tools-testsuite`, which executes
+`UnitSPIRV`. That way it's possible to run the tests using `ctest`.
+
## Future Work
<a name="future"></a>