build: avoid compiling platformtest test list generator

This also fixes a deprecation warning.
This commit is contained in:
Christian Schwarz
2024-09-08 15:12:31 +00:00
parent 740ab4b1b2
commit 0ab92d4861
4 changed files with 5 additions and 13 deletions
+2 -5
View File
@@ -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...)
}
+1 -1
View File
@@ -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