forked from rogpeppe/go-internal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testscript: add support for Go master aka 1.18
Fuzzing support brought a new parameter to MainStart, as well as more methods on testDeps. Use build tags to support those without breaking 1.16 nor 1.17. While at it, bump CI to test the two latest Go versions. Fixes rogpeppe#144.
- Loading branch information
Showing
5 changed files
with
63 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
//go:build go1.18 | ||
|
||
package testscript | ||
|
||
import ( | ||
"reflect" | ||
"testing" | ||
"time" | ||
) | ||
|
||
func mainStart() *testing.M { | ||
return testing.MainStart(nopTestDeps{}, nil, nil, nil, nil) | ||
} | ||
|
||
// Note: corpusEntry is an anonymous struct type used by some method stubs. | ||
type corpusEntry = struct { | ||
Parent string | ||
Name string | ||
Data []byte | ||
Values []interface{} | ||
Generation int | ||
IsSeed bool | ||
} | ||
|
||
// Note: CoordinateFuzzing was added in Go 1.18. | ||
func (nopTestDeps) CoordinateFuzzing(time.Duration, int64, time.Duration, int64, int, []corpusEntry, []reflect.Type, string, string) error { | ||
return nil | ||
} | ||
|
||
// Note: RunFuzzWorker was added in Go 1.18. | ||
func (nopTestDeps) RunFuzzWorker(func(corpusEntry) error) error { | ||
return nil | ||
} | ||
|
||
// Note: ReadCorpus was added in Go 1.18. | ||
func (nopTestDeps) ReadCorpus(string, []reflect.Type) ([]corpusEntry, error) { | ||
return nil, nil | ||
} | ||
|
||
// Note: CheckCorpus was added in Go 1.18. | ||
func (nopTestDeps) CheckCorpus([]interface{}, []reflect.Type) error { | ||
return nil | ||
} | ||
|
||
// Note: ResetCoverage was added in Go 1.18. | ||
func (nopTestDeps) ResetCoverage() {} | ||
|
||
// Note: SnapshotCoverage was added in Go 1.18. | ||
func (nopTestDeps) SnapshotCoverage() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//go:build !go1.18 | ||
|
||
package testscript | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func mainStart() *testing.M { | ||
return testing.MainStart(nopTestDeps{}, nil, nil, nil) | ||
} |