build: avoid compiling platformtest test list generator
This also fixes a deprecation warning.
This commit is contained in:
@@ -21,7 +21,6 @@ func check(err error) {
|
||||
}
|
||||
|
||||
type platformtestFuncDeclFinder struct {
|
||||
pkg *packages.Package
|
||||
testFuncs []*ast.FuncDecl
|
||||
}
|
||||
|
||||
@@ -78,7 +77,7 @@ func main() {
|
||||
|
||||
pkgs, err := packages.Load(
|
||||
&packages.Config{
|
||||
Mode: packages.LoadFiles,
|
||||
Mode: packages.NeedFiles,
|
||||
Tests: false,
|
||||
},
|
||||
os.Args[1],
|
||||
@@ -97,9 +96,7 @@ func main() {
|
||||
s := token.NewFileSet()
|
||||
a, err := parser.ParseFile(s, f, nil, parser.AllErrors)
|
||||
check(err)
|
||||
finder := &platformtestFuncDeclFinder{
|
||||
pkg: p,
|
||||
}
|
||||
finder := &platformtestFuncDeclFinder{}
|
||||
ast.Walk(finder, a)
|
||||
tests = append(tests, finder.testFuncs...)
|
||||
}
|
||||
|
||||
@@ -13,4 +13,4 @@ func (c Case) String() string {
|
||||
return runtime.FuncForPC(reflect.ValueOf(c).Pointer()).Name()
|
||||
}
|
||||
|
||||
//go:generate ../../artifacts/generate-platform-test-list github.com/zrepl/zrepl/platformtest/tests
|
||||
//go:generate go run ./gen github.com/zrepl/zrepl/platformtest/tests
|
||||
|
||||
Reference in New Issue
Block a user