summaryrefslogtreecommitdiff
path: root/init_test.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2020-02-26 16:28:57 +0000
committerNick White <git@njw.name>2020-02-26 16:28:57 +0000
commita47b35dc44f0e770a1bb1f7b53b6aa11d6895e0b (patch)
tree3994c41d70fafe44e94eae89dd4be5653c51e616 /init_test.go
parentd900d8bd656fffc1d2f2581d50eaac15c428ba17 (diff)
Fix flag parsing with go test, and switch to -short to gate long tests
Diffstat (limited to 'init_test.go')
-rw-r--r--init_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/init_test.go b/init_test.go
new file mode 100644
index 0000000..37e510b
--- /dev/null
+++ b/init_test.go
@@ -0,0 +1,19 @@
+// Copyright 2019 Nick White.
+// Use of this source code is governed by the GPLv3
+// license that can be found in the LICENSE file.
+
+package preproc
+
+import (
+ "flag"
+ "os"
+ "testing"
+)
+
+var update = flag.Bool("update", false, "update golden files")
+
+// TestMain is needed to ensure flags are parsed
+func TestMain(m *testing.M) {
+ flag.Parse()
+ os.Exit(m.Run())
+}