[libc-commits] [PATCH] D148786: [libc] Actually run integration tests.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Apr 20 13:09:02 PDT 2023


sivachandra updated this revision to Diff 515447.
sivachandra added a comment.

Address comment.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148786/new/

https://reviews.llvm.org/D148786

Files:
  libc/cmake/modules/LLVMLibCTestRules.cmake


Index: libc/cmake/modules/LLVMLibCTestRules.cmake
===================================================================
--- libc/cmake/modules/LLVMLibCTestRules.cmake
+++ libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -529,12 +529,21 @@
     get_target_property(gpu_loader_exe libc.utils.gpu.loader "EXECUTABLE")
   endif()
 
+  # We have to use a separate var to store the command as a list because
+  # the COMMAND option of `add_custom_target` cannot handle empty vars in the
+  # command. For example, if INTEGRATION_TEST_ENV is empty, the actual
+  # command also will not run. So, we use this list and tell `add_custom_target`
+  # to expand the list (by including the option COMMAND_EXPAND_LISTS). This
+  # makes `add_custom_target` construct the correct command and execute it.
+  set(test_cmd
+      ${INTEGRATION_TEST_ENV}
+      $<$<BOOL:${LIBC_TARGET_ARCHITECTURE_IS_GPU}>:${gpu_loader_exe}>
+      ${INTEGRATION_TEST_LOADER_ARGS}
+      $<TARGET_FILE:${fq_build_target_name}> ${INTEGRATION_TEST_ARGS})
   add_custom_target(
     ${fq_target_name}
-    COMMAND ${INTEGRATION_TEST_ENV}
-            $<$<BOOL:${LIBC_TARGET_ARCHITECTURE_IS_GPU}>:${gpu_loader_exe}>
-            ${INTEGRATION_TEST_LOADER_ARGS}
-            $<TARGET_FILE:${fq_build_target_name}> ${INTEGRATION_TEST_ARGS}
+    COMMAND ${test_cmd}
+    COMMAND_EXPAND_LISTS
     COMMENT "Running integration test ${fq_target_name}"
   )
   add_dependencies(${INTEGRATION_TEST_SUITE} ${fq_target_name})


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148786.515447.patch
Type: text/x-patch
Size: 1473 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230420/7329780e/attachment.bin>


More information about the libc-commits mailing list