From 18463081ad82fe3164b09b70f7d6a0916ce63609 Mon Sep 17 00:00:00 2001 From: Bhargav Ravuri Date: Wed, 23 Nov 2022 23:47:11 +0530 Subject: [PATCH] scripts: go_srcs_in_module to list test packages files The shell func go_srcs_in_module will now list 1. go src files 2. go test files belong to same packages 3. go test files that belong to _test packages Fixes #14827 Signed-off-by: Bhargav Ravuri --- scripts/test_lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test_lib.sh b/scripts/test_lib.sh index d1e93ac73..8bcc6f7f4 100644 --- a/scripts/test_lib.sh +++ b/scripts/test_lib.sh @@ -108,7 +108,7 @@ function relativePath { # go_srcs_in_module [package] # returns list of all not-generated go sources in the current (dir) module. function go_srcs_in_module { - go list -f "{{with \$c:=.}}{{range \$f:=\$c.GoFiles }}{{\$c.Dir}}/{{\$f}}{{\"\n\"}}{{end}}{{range \$f:=\$c.TestGoFiles }}{{\$c.Dir}}/{{\$f}}{{\"\n\"}}{{end}}{{end}}" ./... | grep -vE "(\\.pb\\.go|\\.pb\\.gw.go)" + go list -f "{{with \$c:=.}}{{range \$f:=\$c.GoFiles }}{{\$c.Dir}}/{{\$f}}{{\"\n\"}}{{end}}{{range \$f:=\$c.TestGoFiles }}{{\$c.Dir}}/{{\$f}}{{\"\n\"}}{{end}}{{range \$f:=\$c.XTestGoFiles }}{{\$c.Dir}}/{{\$f}}{{\"\n\"}}{{end}}{{end}}" ./... | grep -vE "(\\.pb\\.go|\\.pb\\.gw.go)" } # pkgs_in_module [optional:package_pattern]