OXIESEC PANEL
- Current Dir:
/
/
opt
/
golang
/
1.22.0
/
src
/
testing
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
allocs.go
1.36 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
allocs_test.go
817 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
benchmark.go
23.85 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
benchmark_test.go
5.56 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
cover.go
3.41 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
example.go
2.75 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
export_test.go
207 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
flag_test.go
2.01 KB
02/02/2024 06:09:55 PM
rw-r--r--
📁
fstest
-
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
fuzz.go
22.85 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
helper_test.go
2.64 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
helperfuncs_test.go
2.44 KB
02/02/2024 06:09:55 PM
rw-r--r--
📁
internal
-
02/02/2024 06:09:55 PM
rwxr-xr-x
📁
iotest
-
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
match.go
7.69 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
match_test.go
7.99 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
newcover.go
1.75 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
panic_test.go
7.36 KB
02/02/2024 06:09:55 PM
rw-r--r--
📁
quick
-
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
run_example.go
1.29 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
run_example_wasm.go
1.76 KB
02/02/2024 06:09:55 PM
rw-r--r--
📁
slogtest
-
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
sub_test.go
23.8 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
testing.go
75.62 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
testing_other.go
386 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
testing_test.go
19.24 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
testing_windows.go
751 bytes
02/02/2024 06:09:55 PM
rw-r--r--
Editing: newcover.go
Close
// Copyright 2022 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. // Support for test coverage with redesigned coverage implementation. package testing import ( "fmt" "internal/goexperiment" "os" ) // cover2 variable stores the current coverage mode and a // tear-down function to be called at the end of the testing run. var cover2 struct { mode string tearDown func(coverprofile string, gocoverdir string) (string, error) snapshotcov func() float64 } // registerCover2 is invoked during "go test -cover" runs by the test harness // code in _testmain.go; it is used to record a 'tear down' function // (to be called when the test is complete) and the coverage mode. func registerCover2(mode string, tearDown func(coverprofile string, gocoverdir string) (string, error), snapcov func() float64) { cover2.mode = mode cover2.tearDown = tearDown cover2.snapshotcov = snapcov } // coverReport2 invokes a callback in _testmain.go that will // emit coverage data at the point where test execution is complete, // for "go test -cover" runs. func coverReport2() { if !goexperiment.CoverageRedesign { panic("unexpected") } if errmsg, err := cover2.tearDown(*coverProfile, *gocoverdir); err != nil { fmt.Fprintf(os.Stderr, "%s: %v\n", errmsg, err) os.Exit(2) } } // testGoCoverDir returns the value passed to the -test.gocoverdir // flag by the Go command, if goexperiment.CoverageRedesign is // in effect. func testGoCoverDir() string { return *gocoverdir } // coverage2 returns a rough "coverage percentage so far" // number to support the testing.Coverage() function. func coverage2() float64 { if cover2.mode == "" { return 0.0 } return cover2.snapshotcov() }