aboutsummaryrefslogtreecommitdiff
path: root/cmd/vartan/test.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/vartan/test.go')
-rw-r--r--cmd/vartan/test.go50
1 files changed, 0 insertions, 50 deletions
diff --git a/cmd/vartan/test.go b/cmd/vartan/test.go
deleted file mode 100644
index 25bd27f..0000000
--- a/cmd/vartan/test.go
+++ /dev/null
@@ -1,50 +0,0 @@
-package main
-
-import (
- "errors"
- "fmt"
- "os"
-
- "tester"
-)
-
-
-
-func runTest(args []string) error {
- gram, _, err := readGrammar(args[0])
- if err != nil {
- return fmt.Errorf("Cannot read a grammar: %w", err)
- }
-
- var cs []*tester.TestCaseWithMetadata
- {
- cs = tester.ListTestCases(args[1])
- errOccurred := false
- for _, c := range cs {
- if c.Error != nil {
- fmt.Fprintf(os.Stderr, "Failed to read a test case or a directory: %v\n%v\n", c.FilePath, c.Error)
- errOccurred = true
- }
- }
- if errOccurred {
- return errors.New("Cannot run test")
- }
- }
-
- t := &tester.Tester{
- Grammar: gram,
- Cases: cs,
- }
- rs := t.Run()
- testFailed := false
- for _, r := range rs {
- fmt.Fprintln(os.Stdout, r)
- if r.Error != nil {
- testFailed = true
- }
- }
- if testFailed {
- return errors.New("Test failed")
- }
- return nil
-}