tests/thirdparty: add klauspost/compress/s2 (#131)

Adds @klauspost's S2 implementation to the third party test suite.

The full klauspost/compress tests are slow but we only care about the S2 sub-package. Therefore this PR also adds the option to only run a subset of the package tests, controlled by a "test" parameter in the JSON configuration.

Closes #130
This commit is contained in:
Michael McLoughlin
2020-01-28 23:27:12 -05:00
committed by GitHub
parent e089a6c93c
commit d51141dc8f
5 changed files with 40 additions and 2 deletions

View File

@@ -14,6 +14,7 @@ type Package struct {
Version string `json:"version"` // git sha, tag or branch
Generate [][]string `json:"generate"` // generate commands to run
Dir string `json:"dir"` // working directory for generate commands
Test string `json:"test"` // test path relative to repo root (if empty defaults to ./...)
}
// Name returns the package name.
@@ -26,6 +27,14 @@ func (p Package) CloneURL() string {
return "https://" + p.ImportPath + ".git"
}
// TestPath returns the paths to run "go test" on, relative to the repository root.
func (p Package) TestPath() string {
if p.Test == "" {
return "./..."
}
return p.Test
}
// LoadPackages loads a list of package configurations from JSON format.
func LoadPackages(r io.Reader) ([]Package, error) {
var pkgs []Package