ソースを参照

Add much better pruning of non-tested directories, including pruning the integration tests directory (doing more with "find" and nothing with "grep")

Tianon Gravi 11 年 前
コミット
bac3a8e6f5
2 ファイル変更8 行追加6 行削除
  1. 4 3
      hack/make/dyntest
  2. 4 3
      hack/make/test

+ 4 - 3
hack/make/dyntest

@@ -61,9 +61,10 @@ bundle_test() {
 # holding Go test files, and prints their paths on standard output, one per
 # holding Go test files, and prints their paths on standard output, one per
 # line.
 # line.
 find_test_dirs() {
 find_test_dirs() {
-       find . -name '*_test.go' | grep -v '^./vendor' |
-               { while read f; do dirname $f; done; } |
-               sort -u
+	find -not \( \
+		\( -wholename './vendor' -o -wholename './integration' \) \
+		-prune \
+	\) -name '*_test.go' -print0 | xargs -0n1 dirname | sort -u
 }
 }
 
 
 bundle_test
 bundle_test

+ 4 - 3
hack/make/test

@@ -53,9 +53,10 @@ bundle_test() {
 # holding Go test files, and prints their paths on standard output, one per
 # holding Go test files, and prints their paths on standard output, one per
 # line.
 # line.
 find_test_dirs() {
 find_test_dirs() {
-       find . -name '*_test.go' | grep -v '^./vendor' |
-               { while read f; do dirname $f; done; } |
-               sort -u
+	find -not \( \
+		\( -wholename './vendor' -o -wholename './integration' \) \
+		-prune \
+	\) -name '*_test.go' -print0 | xargs -0n1 dirname | sort -u
 }
 }
 
 
 bundle_test
 bundle_test