diff options
author | David Neto <dneto@google.com> | 2017-11-08 00:23:42 -0500 |
---|---|---|
committer | David Neto <dneto@google.com> | 2017-11-13 11:34:21 -0500 |
commit | 76555bd4bae0f751ca01a219de5b5fdb7e68f460 (patch) | |
tree | 68576ebf22954815cdbe28e7d34a8cae68f9f7b0 /test/CMakeLists.txt | |
parent | efe12ff5a1b34d0e23d6a5515bfe0eb18aaa1761 (diff) | |
download | SPIRV-Tools-76555bd4bae0f751ca01a219de5b5fdb7e68f460.tar.gz |
Tests: Add optional dependency on Effcee stateful matcher
Add Effcee as an optional dependency for use in tests. In future it will
be a required dependency.
Effcee is a stateful pattern matcher that has much of the functionality
of LLVM's FileCheck, except in library form. Effcee makes it much easier
to write tests for optimization passes.
Demonstrate its use in a test for the strength-reduction pass.
Update README.md with example commands of how to get sources.
Update Appveyor and Travis-CI build rules.
Also: Include test libraries if not SPIRV_SKIP_TESTS
- SPIRV_SKIP_TESTS is implied by SPIRV_SKIP_EXECUTABLES
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r-- | test/CMakeLists.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 1b8cad29..176aa91e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -39,6 +39,8 @@ function(add_spvtools_unittest) spvtools_default_compile_options(${target}) if(${COMPILER_IS_LIKE_GNU}) target_compile_options(${target} PRIVATE -Wno-undef) + # Effcee and RE2 headers exhibit shadowing. + target_compile_options(${target} PRIVATE -Wno-shadow) endif() if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # Disable C4503 "decorated name length exceeded" warning, @@ -56,7 +58,14 @@ function(add_spvtools_unittest) ${gtest_SOURCE_DIR}/include ${gmock_SOURCE_DIR}/include ) + if (TARGET effcee) + # If using Effcee for testing, then add its include directory. + target_include_directories(${target} PRIVATE ${effcee_SOURCE_DIR}) + endif() target_link_libraries(${target} PRIVATE ${ARG_LIBS}) + if (TARGET effcee) + target_link_libraries(${target} PRIVATE effcee) + endif() target_link_libraries(${target} PRIVATE gmock_main) add_test(NAME spirv-tools-${target} COMMAND ${target}) set_property(TARGET ${target} PROPERTY FOLDER "SPIRV-Tools tests") |