From 3868036ea7c80f46e9f305775d1145b883b5d0bb Mon Sep 17 00:00:00 2001 From: Chris Kitching Date: Wed, 18 Oct 2017 08:27:22 +0100 Subject: [PATCH] Look for FileCheck for running lit tests, too Use of grep in `lit` RUN lines is deprecated: https://llvm.org/docs/TestingGuide.html#writing-new-regression-tests Using grep leads to really unhelpful failure output (it literally just says "the test failed"). FileCheck is much more helpful, and distributed with LLVM on most distros anyway, so this extra dependency shouldn't prove problematic. --- hipamd/hipify-clang/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hipamd/hipify-clang/CMakeLists.txt b/hipamd/hipify-clang/CMakeLists.txt index 18939c0210..e7c46557f8 100644 --- a/hipamd/hipify-clang/CMakeLists.txt +++ b/hipamd/hipify-clang/CMakeLists.txt @@ -3,11 +3,12 @@ project(hipify-clang) option(HIPIFY_CLANG_TESTS "Build the tests for hipify-clang, if lit is installed" ON) -# Disable the tests if `lit` is not installed. +# Disable the tests if `lit` or `FileCheck` is not installed. find_program(LIT_COMMAND lit) -if (NOT LIT_COMMAND) +find_program(FILECHECK_COMMAND FileCheck) +if (NOT LIT_COMMAND OR NOT FILECHECK_COMMAND) set(HIPIFY_CLANG_TESTS OFF CACHE INTERNAL "") - message(STATUS "hipify-clang's tests are not being built because `lit` is not installed.") + message(STATUS "hipify-clang's tests are not being built because `lit` or `FileCheck` could not be found.") endif() set(BUILD_HIPIFY_CLANG 0 CACHE INTERNAL "")