403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/go/src/cmd/go/testdata/script/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/go/src/cmd/go/testdata/script/cover_statements.txt
[short] skip

# Workaround for issue 64014 -- for the portion of this test that
# verifies that caching works correctly, the cache should theoretically
# always behave reliably/deterministically, however if other tests are
# concurrently accessing the cache while this test is running, it can
# lead to cache lookup failures, which manifest as test failures here.
# To avoid such flakes, use a separate isolated GOCACHE for this test.
env GOCACHE=$WORK/cache

# Initial run with simple coverage.
go test -cover ./pkg1 ./pkg2 ./pkg3 ./pkg4
[!GOEXPERIMENT:coverageredesign] stdout 'pkg1	\[no test files\]'
[GOEXPERIMENT:coverageredesign] stdout 'pkg1		coverage: 0.0% of statements'
stdout 'pkg2	\S+	coverage: 0.0% of statements \[no tests to run\]'
stdout 'pkg3	\S+	coverage: 100.0% of statements'
stdout 'pkg4	\S+	coverage: \[no statements\]'

# Second run to make sure that caching works properly.
go test -x -cover ./pkg1 ./pkg2 ./pkg3 ./pkg4
[!GOEXPERIMENT:coverageredesign] stdout 'pkg1	\[no test files\]'
[GOEXPERIMENT:coverageredesign] stdout 'pkg1		coverage: 0.0% of statements'
stdout 'pkg2	\S+	coverage: 0.0% of statements \[no tests to run\]'
stdout 'pkg3	\S+	coverage: 100.0% of statements'
stdout 'pkg4	\S+	coverage: \[no statements\]'
[GOEXPERIMENT:coverageredesign] ! stderr 'link(\.exe"?)? -'
! stderr 'compile(\.exe"?)? -'
! stderr 'cover(\.exe"?)? -'
[GOEXPERIMENT:coverageredesign] stderr 'covdata(\.exe"?)? percent'

# Now add in -coverprofile.
go test -cover -coverprofile=cov.dat ./pkg1 ./pkg2 ./pkg3 ./pkg4
[!GOEXPERIMENT:coverageredesign] stdout 'pkg1	\[no test files\]'
[GOEXPERIMENT:coverageredesign] stdout 'pkg1		coverage: 0.0% of statements'
stdout 'pkg2	\S+	coverage: 0.0% of statements \[no tests to run\]'
stdout 'pkg3	\S+	coverage: 100.0% of statements'
stdout 'pkg4	\S+	coverage: \[no statements\]'

# Validate
go tool cover -func=cov.dat
[GOEXPERIMENT:coverageredesign] stdout 'pkg1/a.go:5:\s+F\s+0.0%'

-- go.mod --
module m

go 1.16
-- pkg1/a.go --
package pkg1

import "fmt"

func F() {
	fmt.Println("pkg1")
}
-- pkg2/a.go --
package pkg2

import "fmt"

func F() {
	fmt.Println("pkg2")
}
-- pkg2/a_test.go --
package pkg2
-- pkg3/a.go --
package pkg3

import "fmt"

func F() {
	fmt.Println("pkg3")
}
-- pkg3/a_test.go --
package pkg3

import "testing"

func TestF(t *testing.T) {
	F()
}
-- pkg4/a.go --
package pkg4

type T struct {
	X bool
}
-- pkg4/a_test.go --
package pkg4

import (
	"testing"
)

func TestT(t *testing.T) {
	_ = T{}
}

Youez - 2016 - github.com/yon3zu
LinuXploit