diff --git a/.gitignore b/.gitignore index f70e55765..8ba0f6c91 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,9 @@ # Test binary, built with `go test -c` *.test +# make build-tests artifacts +tests/**/eden.*.test* + # Output of the go coverage tool, specifically when used with LiteIDE *.out diff --git a/tests/escript/go-internal/testscript/testing_1.18.go b/tests/escript/go-internal/testscript/testing_1.18.go index f9d9a4a07..539aad24f 100644 --- a/tests/escript/go-internal/testscript/testing_1.18.go +++ b/tests/escript/go-internal/testscript/testing_1.18.go @@ -1,5 +1,5 @@ -//go:build go1.18 -// +build go1.18 +//go:build go1.18 && !go1.23 +// +build go1.18,!go1.23 package testscript diff --git a/tests/escript/go-internal/testscript/testing_1.23.go b/tests/escript/go-internal/testscript/testing_1.23.go new file mode 100644 index 000000000..374c9c797 --- /dev/null +++ b/tests/escript/go-internal/testscript/testing_1.23.go @@ -0,0 +1,81 @@ +//go:build go1.23 +// +build go1.23 + +package testscript + +import ( + "io" + "reflect" + "testing" + "time" +) + +type nopTestDeps struct{} + +// corpusEntry is an alias to the same type as internal/fuzz.CorpusEntry. +// We use a type alias because we don't want to export this type, and we can't +// import internal/fuzz from testing. +type corpusEntry = struct { + Parent string + Path string + Data []byte + Values []interface{} + Generation int + IsSeed bool +} + +func (d nopTestDeps) CoordinateFuzzing(_ time.Duration, _ int64, _ time.Duration, _ int64, _ int, _ []corpusEntry, _ []reflect.Type, _ string, _ string) error { + return nil +} + +func (d nopTestDeps) RunFuzzWorker(_ func(corpusEntry) error) error { + return nil +} + +func (d nopTestDeps) ReadCorpus(_ string, _ []reflect.Type) ([]corpusEntry, error) { + return nil, nil +} + +func (d nopTestDeps) CheckCorpus(_ []interface{}, _ []reflect.Type) error { + return nil +} + +func (d nopTestDeps) ResetCoverage() { + return +} + +func (d nopTestDeps) SnapshotCoverage() { + return +} + +func (d nopTestDeps) InitRuntimeCoverage() (mode string, tearDown func(coverprofile string, gocoverdir string) (string, error), snapcov func() float64) { + return +} + +func (nopTestDeps) SetPanicOnExit0(_ bool) {} + +func (nopTestDeps) MatchString(_, _ string) (result bool, err error) { + return false, nil +} + +func (nopTestDeps) StartCPUProfile(_ io.Writer) error { + return nil +} + +func (nopTestDeps) StopCPUProfile() {} + +func (nopTestDeps) WriteProfileTo(_ string, _ io.Writer, _ int) error { + return nil +} +func (nopTestDeps) ImportPath() string { + return "" +} +func (nopTestDeps) StartTestLog(_ io.Writer) {} + +func (nopTestDeps) StopTestLog() error { + return nil +} + +func getTestingMain() *testing.M { + return testing.MainStart(nopTestDeps{}, nil, nil, nil, nil) +}