mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-08 13:03:39 +00:00
testing: add Testing function
This is new in Go 1.21.
This commit is contained in:
committed by
Ron Evans
parent
215dd3f0be
commit
c25dd0a972
@@ -120,6 +120,15 @@ func Verbose() bool {
|
||||
return flagVerbose
|
||||
}
|
||||
|
||||
// String constant that is being set when running a test.
|
||||
var testBinary string
|
||||
|
||||
// Testing returns whether the program was compiled as a test, using "tinygo
|
||||
// test". It returns false when built using "tinygo build", "tinygo flash", etc.
|
||||
func Testing() bool {
|
||||
return testBinary == "1"
|
||||
}
|
||||
|
||||
// flushToParent writes c.output to the parent after first writing the header
|
||||
// with the given format and arguments.
|
||||
func (c *common) flushToParent(testName, format string, args ...interface{}) {
|
||||
|
||||
Reference in New Issue
Block a user