[PATCH] D27798: [AVR] Allow setting up the integrated test suite as an external project

Dylan McKay via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 14 23:49:42 PST 2016


dylanmckay created this revision.
dylanmckay added a reviewer: chandlerc.
dylanmckay added a subscriber: llvm-commits.
Herald added a subscriber: mgorny.

This allows the AVR integrated test suite to be set up and configured
with LLVM.


https://reviews.llvm.org/D27798

Files:
  CMakeLists.txt
  cmake/modules/LLVMExternalProjectUtils.cmake


Index: cmake/modules/LLVMExternalProjectUtils.cmake
===================================================================
--- cmake/modules/LLVMExternalProjectUtils.cmake
+++ cmake/modules/LLVMExternalProjectUtils.cmake
@@ -204,3 +204,10 @@
       USES_TERMINAL)
   endforeach()
 endfunction()
+
+# Adds an external project which has nothing to install and
+# is not built by default.
+function(llvm_ExternalProject_AddTestSuite name source_dir)
+  llvm_ExternalProject_Add(${name} ${source_dir}
+    USE_TOOLCHAIN EXCLUDE_FROM_ALL NO_INSTALL ALWAYS_CLEAN)
+endfunction()
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -868,14 +868,16 @@
 endif()
 
 if( LLVM_INCLUDE_TESTS )
+  include(LLVMExternalProjectUtils)
+
   if(EXISTS ${LLVM_MAIN_SRC_DIR}/projects/test-suite AND TARGET clang)
-    include(LLVMExternalProjectUtils)
-    llvm_ExternalProject_Add(test-suite ${LLVM_MAIN_SRC_DIR}/projects/test-suite
-      USE_TOOLCHAIN
-      EXCLUDE_FROM_ALL
-      NO_INSTALL
-      ALWAYS_CLEAN)
+    llvm_ExternalProject_AddTestSuite(test-suite ${LLVM_MAIN_SRC_DIR}/projects/test-suite)
+  endif()
+
+  if(EXISTS ${LLVM_MAIN_SRC_DIR}/projects/avr-metal AND ${LLVM_TARGETS_TO_BUILD} MATCHES "AVR")
+    llvm_ExternalProject_AddTestSuite(avr-metal ${LLVM_MAIN_SRC_DIR}/projects/avr-metal)
   endif()
+
   add_subdirectory(test)
   add_subdirectory(unittests)
   if (MSVC)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27798.81536.patch
Type: text/x-patch
Size: 1448 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161215/ffe16f8f/attachment.bin>


More information about the llvm-commits mailing list