[Openmp-commits] [PATCH] D29172: [libomptarget] Align test code with runtime/

Jonas Hahnfeld via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Feb 6 23:09:51 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL294284: [libomptarget] Align test code with runtime/ (authored by Hahnfeld).

Changed prior to commit:
  https://reviews.llvm.org/D29172?vs=85881&id=87366#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D29172

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


Index: openmp/trunk/libomptarget/test/lit.site.cfg.in
===================================================================
--- openmp/trunk/libomptarget/test/lit.site.cfg.in
+++ openmp/trunk/libomptarget/test/lit.site.cfg.in
@@ -13,7 +13,7 @@
 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")
Index: openmp/trunk/libomptarget/test/CMakeLists.txt
===================================================================
--- openmp/trunk/libomptarget/test/CMakeLists.txt
+++ openmp/trunk/libomptarget/test/CMakeLists.txt
@@ -23,22 +23,22 @@
     "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 @@
     "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 @@
   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()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29172.87366.patch
Type: text/x-patch
Size: 3627 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20170207/772f827f/attachment.bin>


More information about the Openmp-commits mailing list