aboutsummaryrefslogtreecommitdiffhomepage
path: root/main_test.go
diff options
context:
space:
mode:
authorDan Kegel <[email protected]>2022-01-14 09:25:40 -0800
committerRon Evans <[email protected]>2022-01-15 10:38:22 +0100
commit0ed34e3cb0b45af5579cf6905cf3b077b4cf2c43 (patch)
treed0eb36dd56b542414ec9883cdbd7b1f1f7354666 /main_test.go
parent78a36f7724ef22980005962b8457188e3668542b (diff)
downloadtinygo-0ed34e3cb0b45af5579cf6905cf3b077b4cf2c43.tar.gz
tinygo-0ed34e3cb0b45af5579cf6905cf3b077b4cf2c43.zip
testing: print duration
TODO: account for time taken in Cleanup().
Diffstat (limited to 'main_test.go')
-rw-r--r--main_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/main_test.go b/main_test.go
index d83448bff..290955837 100644
--- a/main_test.go
+++ b/main_test.go
@@ -15,6 +15,7 @@ import (
"os"
"os/exec"
"path/filepath"
+ "regexp"
"runtime"
"strings"
"sync"
@@ -426,6 +427,11 @@ func runTestWithConfig(name string, t *testing.T, options compileopts.Options, c
actual = bytes.Replace(actual, []byte{0x1b, '[', '0', 'm'}, nil, -1)
actual = bytes.Replace(actual, []byte{'.', '.', '\n'}, []byte{'\n'}, -1)
}
+ if name == "testing.go" {
+ // Strip actual time.
+ re := regexp.MustCompile(`\([0-9]\.[0-9][0-9]s\)`)
+ actual = re.ReplaceAllLiteral(actual, []byte{'(', '0', '.', '0', '0', 's', ')'})
+ }
// Check whether the command ran successfully.
fail := false