diff options
author | Ayke van Laethem <[email protected]> | 2021-08-11 01:09:50 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2021-08-13 08:53:40 +0200 |
commit | 04f520040e6d60ace0728d0016cbe1e75bc44f71 (patch) | |
tree | a46a31874b1f2663f95045318fdb431c91911584 /testdata/testing.txt | |
parent | f57e9622fdb650f14a48cc327db01c216cd0d9c6 (diff) | |
download | tinygo-04f520040e6d60ace0728d0016cbe1e75bc44f71.tar.gz tinygo-04f520040e6d60ace0728d0016cbe1e75bc44f71.zip |
testing: add support for the -test.v flag
This flag is passed automatically with the (new) -v flag for TinyGo. For
example, this prints all the test outputs:
$ tinygo test -v crypto/md5
=== RUN TestGolden
--- PASS: TestGolden
=== RUN TestGoldenMarshal
--- PASS: TestGoldenMarshal
=== RUN TestLarge
--- PASS: TestLarge
=== RUN TestBlockGeneric
--- PASS: TestBlockGeneric
=== RUN TestLargeHashes
--- PASS: TestLargeHashes
PASS
ok crypto/md5 0.002s
This prints just a summary:
$ tinygo test crypto/md5
PASS
ok crypto/md5 0.002s
(The superfluous 'PASS' message may be removed in the future).
This is especially useful when testing a large number of packages:
$ tinygo test crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512
PASS
ok crypto/md5 0.002s
PASS
ok crypto/sha1 0.043s
PASS
ok crypto/sha256 0.002s
PASS
ok crypto/sha512 0.003s
At the moment, the -test.v flag is not supplied to binaries running in
emulation. I intend to fix this after
https://github.com/tinygo-org/tinygo/pull/2038 lands by refactoring
runPackageTest, Run, and runTestWithConfig in the main package which all
do something similar.
Diffstat (limited to 'testdata/testing.txt')
-rw-r--r-- | testdata/testing.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/testdata/testing.txt b/testdata/testing.txt new file mode 100644 index 000000000..816246c2e --- /dev/null +++ b/testdata/testing.txt @@ -0,0 +1,16 @@ +--- FAIL: TestBar + log Bar + log g + h + i + + --- FAIL: TestBar/Bar2 + log Bar2 + a + b + c + failed + after failed + log Bar end +FAIL +exitcode: 1 |