mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 11:37:46 +00:00
61f711ef26
Implements nearly all of the test logging methods for both T and B structs. Majority of the code has been copied from: golang.org/src/testing/testing.go then updated to match the existing testing.go structure. Code structure/function/method order mimics upstream. Both FailNow() and SkipNow() cannot be completely implemented, because they require an early exit from the goroutine. Instead, they call Error() to report the limitation. This incomplete implementation allows more detailed test logging and increases compatiblity with upstream.
18 lines
552 B
Go
18 lines
552 B
Go
// Copyright 2009 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
//
|
|
// This file has been modified for use by the TinyGo compiler.
|
|
|
|
package testing
|
|
|
|
// B is a type passed to Benchmark functions to manage benchmark timing and to
|
|
// specify the number of iterations to run.
|
|
//
|
|
// TODO: Implement benchmarks. This struct allows test files containing
|
|
// benchmarks to compile and run, but will not run the benchmarks themselves.
|
|
type B struct {
|
|
common
|
|
N int
|
|
}
|