[tools][tests] Error when flags passed after globs
Adding flags after globs would previously silently ignore those flags.
Change-Id: I780c1f656adfe64688236b526c92470697692b03
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/179241
Kokoro: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/tools/src/cmd/tests/main.go b/tools/src/cmd/tests/main.go
index 4a3cfaf..890f8c4 100644
--- a/tools/src/cmd/tests/main.go
+++ b/tools/src/cmd/tests/main.go
@@ -175,6 +175,10 @@
rootPath := ""
globs := []string{}
for _, arg := range args {
+ if len(arg) > 1 && arg[0:2] == "--" {
+ return fmt.Errorf("unexpected flag after globs: %s", arg)
+ }
+
// Make absolute
if !filepath.IsAbs(arg) {
arg = filepath.Join(dawnRoot, arg)