go/src/testing
sunnymilk 402dc98759 testing: enable better loop time measurement for benchmarking.
With b.Loop() in place, the time measurement of loop scaling could be improved to be tighter. By identifying the first call to b.Loop(), we can avoid measuring the expensive ramp-up time by reset the timer tightly before the loop starts. The remaining loop scaling logic of b.N style loop is largely reused.

For #61515.

Change-Id: Ia7b8f0a8838f57c00ac6c5ef779d86f8d713c9b6
Reviewed-on: https://go-review.googlesource.com/c/go/+/612835
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-09-20 19:10:01 +00:00
..
fstest os,path/filepath,testing: use slices to clean up tests 2024-07-25 00:23:06 +00:00
internal/testdeps cmd/go: fix problems with coverage percentage reporting w/ -coverpkg 2024-06-14 11:46:05 +00:00
iotest testing: add available godoc link 2023-11-08 17:55:47 +00:00
quick testing: add available godoc link 2023-11-08 17:55:47 +00:00
slogtest testing: add available godoc link 2023-11-08 17:55:47 +00:00
allocs_test.go all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
allocs.go all: single space after period. 2016-03-02 00:13:47 +00:00
benchmark_test.go testing: implement testing.B.Loop 2024-09-20 19:09:41 +00:00
benchmark.go testing: enable better loop time measurement for benchmarking. 2024-09-20 19:10:01 +00:00
cover.go cmd/go,testing: re-implement testing.Coverage 2023-05-23 11:37:31 +00:00
example.go all: change from sort functions to slices functions where feasible 2024-05-23 01:00:11 +00:00
export_test.go testing: add Chdir 2024-08-16 23:48:50 +00:00
flag_test.go testing: use testenv.Executable 2024-09-03 18:03:28 +00:00
fuzz.go testing: rename testContext to testState 2024-08-21 20:52:09 +00:00
helper_test.go testing: use testenv.Executable 2024-09-03 18:03:28 +00:00
helperfuncs_test.go testing: use subprocesses in TestTBHelper and TestTBHelperParallel 2023-11-21 17:24:47 +00:00
match_test.go cmd/go, testing: add go test -skip flag 2022-09-16 14:48:54 +00:00
match.go all: use built-in clear to clear maps 2023-07-27 22:07:13 +00:00
newcover.go internal/coverage/cfile: remove //go:linkname into testing 2024-05-22 09:58:07 +00:00
panic_test.go Revert "testing: simplify concurrency and cleanup logic" 2023-11-27 16:49:24 +00:00
run_example_wasm.go all: add wasip1 support 2023-04-11 20:56:32 +00:00
run_example.go all: add wasip1 support 2023-04-11 20:56:32 +00:00
sub_test.go testing: rename testContext to testState 2024-08-21 20:52:09 +00:00
testing_other.go testing: use time.Since in highPrecisionTime 2024-04-27 19:42:36 +00:00
testing_test.go testing: use testenv.Executable 2024-09-03 18:03:28 +00:00
testing_windows_test.go testing: use QueryPerformanceCounter on Windows 2024-04-26 22:55:25 +00:00
testing_windows.go testing: use QueryPerformanceCounter on Windows 2024-04-26 22:55:25 +00:00
testing.go testing: rename testContext to testState 2024-08-21 20:52:09 +00:00