[Openmp-commits] [openmp] r294284 - [libomptarget] Align test code with runtime/

Jonas Hahnfeld via Openmp-commits openmp-commits at lists.llvm.org
Mon Feb 6 22:58:15 PST 2017


Author: hahnfeld
Date: Tue Feb  7 00:58:15 2017
New Revision: 294284

URL: http://llvm.org/viewvc/llvm-project?rev=294284&view=rev
Log:
[libomptarget] Align test code with runtime/

This change allows setting LIBOMPTARGET_LLVM_LIT_EXECUTABLE and
LIBOMPTARGET_FILECHECK_EXECUTABLE as full path. It also honors
OPENMP_LLVM_TOOLS_DIR which is meant as a common configuration
for both libomp and libomptarget.

Maybe this should be done in a common CMake module, but I'm no expert here.

Differential Revision: https://reviews.llvm.org/D29172

Modified:
    openmp/trunk/libomptarget/test/CMakeLists.txt
    openmp/trunk/libomptarget/test/lit.site.cfg.in

Modified: openmp/trunk/libomptarget/test/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/libomptarget/test/CMakeLists.txt?rev=294284&r1=294283&r2=294284&view=diff
==============================================================================
--- openmp/trunk/libomptarget/test/CMakeLists.txt (original)
+++ openmp/trunk/libomptarget/test/CMakeLists.txt Tue Feb  7 00:58:15 2017
@@ -23,22 +23,22 @@ if(${LIBOMPTARGET_STANDALONE_BUILD})
     "C++ compiler to use for testing OpenMP offloading library")
   set(LIBOMPTARGET_TEST_OPENMP_FLAG -fopenmp CACHE STRING
     "OpenMP compiler flag to use for testing OpenMP offloading library")
-  set(LIBOMPTARGET_LLVM_LIT_EXECUTABLE "" CACHE STRING
-    "Path to llvm-lit")
-  find_program(LIT_EXECUTABLE NAMES llvm-lit ${LIBOMPTARGET_LLVM_LIT_EXECUTABLE})
-  if(NOT LIT_EXECUTABLE)
+  find_program(LIBOMPTARGET_LLVM_LIT_EXECUTABLE
+    NAMES llvm-lit lit.py lit
+    PATHS ${OPENMP_LLVM_TOOLS_DIR})
+  if(NOT LIBOMPTARGET_LLVM_LIT_EXECUTABLE)
     libomptarget_say("Cannot find llvm-lit.")
-    libomptarget_say("Please put llvm-lit in your PATH or set LIBOMPTARGET_LLVM_LIT_EXECUTABLE to its full path")
+    libomptarget_say("Please put llvm-lit in your PATH or set LIBOMPTARGET_LLVM_LIT_EXECUTABLE to its full path or point OPENMP_LLVM_TOOLS_DIR to its directory")
     libomptarget_warning_say("The check-libomptarget target will not be available!")
     return()
   endif()
   
-  set(LIBOMPTARGET_FILECHECK_EXECUTABLE "" CACHE STRING
-    "Path to FileCheck")
-  find_program(LIBOMPTARGET_FILECHECK NAMES FileCheck ${LIBOMPTARGET_FILECHECK_EXECUTABLE})
-  if(NOT LIBOMPTARGET_FILECHECK)
+  find_program(LIBOMPTARGET_FILECHECK_EXECUTABLE
+    NAMES FileCheck
+    PATHS ${OPENMP_LLVM_TOOLS_DIR})
+  if(NOT LIBOMPTARGET_FILECHECK_EXECUTABLE)
     libomptarget_say("Cannot find FileCheck.")
-    libomptarget_say("Please put FileCheck in your PATH or set LIBOMPTARGET_FILECHECK_EXECUTABLE to its full path")
+    libomptarget_say("Please put FileCheck in your PATH or set LIBOMPTARGET_FILECHECK_EXECUTABLE to its full path or point OPENMP_LLVM_TOOLS_DIR to its directory")
     libomptarget_warning_say("The check-libomptarget target will not be available!")
     return()
   endif()
@@ -55,7 +55,7 @@ if(${LIBOMPTARGET_STANDALONE_BUILD})
     "Default options for lit")
   separate_arguments(LIBOMPTARGET_LIT_ARGS)
   add_custom_target(check-libomptarget
-    COMMAND ${PYTHON_EXECUTABLE} ${LIT_EXECUTABLE} ${LIBOMPTARGET_LIT_ARGS} ${CMAKE_CURRENT_BINARY_DIR}
+    COMMAND ${PYTHON_EXECUTABLE} ${LIBOMPTARGET_LLVM_LIT_EXECUTABLE} ${LIBOMPTARGET_LIT_ARGS} ${CMAKE_CURRENT_BINARY_DIR}
     DEPENDS omptarget
     COMMENT "Running libomptarget tests"
     ${cmake_3_2_USES_TERMINAL}
@@ -70,7 +70,7 @@ else()
   if(NOT MSVC)
     set(LIBOMPTARGET_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
     set(LIBOMPTARGET_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++)
-    set(LIBOMPTARGET_FILECHECK ${LLVM_RUNTIME_OUTPUT_INTDIR}/FileCheck)
+    set(LIBOMPTARGET_FILECHECK_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/FileCheck)
   else()
     libomptarget_warning_say("Not prepared to run tests on Windows systems.")
   endif()

Modified: openmp/trunk/libomptarget/test/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/libomptarget/test/lit.site.cfg.in?rev=294284&r1=294283&r2=294284&view=diff
==============================================================================
--- openmp/trunk/libomptarget/test/lit.site.cfg.in (original)
+++ openmp/trunk/libomptarget/test/lit.site.cfg.in Tue Feb  7 00:58:15 2017
@@ -13,7 +13,7 @@ config.omp_host_rtl_directory = "@LIBOMP
 config.operating_system = "@CMAKE_SYSTEM_NAME@"
 config.libomptarget_all_targets = "@LIBOMPTARGET_ALL_TARGETS@".split()
 config.libomptarget_system_targets = "@LIBOMPTARGET_SYSTEM_TARGETS@".split()
-config.libomptarget_filecheck = "@LIBOMPTARGET_FILECHECK@"
+config.libomptarget_filecheck = "@LIBOMPTARGET_FILECHECK_EXECUTABLE@"
 
 # Let the main config do the real work.
 lit_config.load_config(config, "@LIBOMPTARGET_BASE_DIR@/test/lit.cfg")




More information about the Openmp-commits mailing list