Browse code

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

Tianon Gravi authored on 2013/12/09 05:50:48
Showing 2 changed files
... ...
@@ -61,9 +61,10 @@ bundle_test() {
61 61
 # holding Go test files, and prints their paths on standard output, one per
62 62
 # line.
63 63
 find_test_dirs() {
64
-       find . -name '*_test.go' | grep -v '^./vendor' |
65
-               { while read f; do dirname $f; done; } |
66
-               sort -u
64
+	find -not \( \
65
+		\( -wholename './vendor' -o -wholename './integration' \) \
66
+		-prune \
67
+	\) -name '*_test.go' -print0 | xargs -0n1 dirname | sort -u
67 68
 }
68 69
 
69 70
 bundle_test
... ...
@@ -53,9 +53,10 @@ bundle_test() {
53 53
 # holding Go test files, and prints their paths on standard output, one per
54 54
 # line.
55 55
 find_test_dirs() {
56
-       find . -name '*_test.go' | grep -v '^./vendor' |
57
-               { while read f; do dirname $f; done; } |
58
-               sort -u
56
+	find -not \( \
57
+		\( -wholename './vendor' -o -wholename './integration' \) \
58
+		-prune \
59
+	\) -name '*_test.go' -print0 | xargs -0n1 dirname | sort -u
59 60
 }
60 61
 
61 62
 bundle_test