[llvm] lit_test : check if there is already a deps key in kwargs (PR #87290)

Abhinav Gunjal via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 1 15:38:52 PDT 2024


https://github.com/abhigunj updated https://github.com/llvm/llvm-project/pull/87290

>From 1b33d98179c3b6f71b6c0dca0edfa6df5d9f5630 Mon Sep 17 00:00:00 2001
From: Abhinav <agunjal at google.com>
Date: Mon, 1 Apr 2024 20:49:23 +0000
Subject: [PATCH 1/2] check if there is already a deps key in kwargs

---
 utils/bazel/llvm-project-overlay/llvm/lit_test.bzl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/bazel/llvm-project-overlay/llvm/lit_test.bzl b/utils/bazel/llvm-project-overlay/llvm/lit_test.bzl
index f754a9fc7d5e48..b5cb9f375ebce6 100644
--- a/utils/bazel/llvm-project-overlay/llvm/lit_test.bzl
+++ b/utils/bazel/llvm-project-overlay/llvm/lit_test.bzl
@@ -35,7 +35,7 @@ def lit_test(
         args = args + ["-v"] + ["$(execpath %s)" % src for src in srcs],
         data = data + srcs,
         legacy_create_init = False,
-        deps = [Label("//llvm:lit")],
+        deps = [Label("//llvm:lit")] + kwargs.pop("deps", []),
         **kwargs
     )
 

>From 3d90d203ac84d359e6ed4e0ec1ec4318f0ec48a0 Mon Sep 17 00:00:00 2001
From: Abhinav <agunjal at google.com>
Date: Mon, 1 Apr 2024 22:37:52 +0000
Subject: [PATCH 2/2] addressed review commenent

---
 utils/bazel/llvm-project-overlay/llvm/lit_test.bzl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/utils/bazel/llvm-project-overlay/llvm/lit_test.bzl b/utils/bazel/llvm-project-overlay/llvm/lit_test.bzl
index b5cb9f375ebce6..74a8750011e48a 100644
--- a/utils/bazel/llvm-project-overlay/llvm/lit_test.bzl
+++ b/utils/bazel/llvm-project-overlay/llvm/lit_test.bzl
@@ -10,6 +10,7 @@ def lit_test(
         srcs,
         args = None,
         data = None,
+        deps,
         **kwargs):
     """Runs a single test file with LLVM's lit tool.
 
@@ -27,6 +28,7 @@ def lit_test(
 
     args = args or []
     data = data or []
+    deps = deps or []
 
     native.py_test(
         name = name,
@@ -35,7 +37,7 @@ def lit_test(
         args = args + ["-v"] + ["$(execpath %s)" % src for src in srcs],
         data = data + srcs,
         legacy_create_init = False,
-        deps = [Label("//llvm:lit")] + kwargs.pop("deps", []),
+        deps = deps + [Label("//llvm:lit")],
         **kwargs
     )
 



More information about the llvm-commits mailing list