llcppsigfetch:marco tokens & refine test

This commit is contained in:
luoliwoshang
2024-08-20 10:08:25 +08:00
parent f0e92343cb
commit bf8aa502f9
6 changed files with 104 additions and 210 deletions

View File

@@ -0,0 +1,28 @@
package cvttest
import (
"github.com/goplus/llgo/c"
"github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse"
)
func RunTest(testName string, testCases []string) {
for i, content := range testCases {
converter, err := parse.NewConverter(&parse.Config{
File: content,
Temp: true,
})
if err != nil {
panic(err)
}
_, err = converter.Convert()
if err != nil {
panic(err)
}
json := converter.MarshalASTFiles()
c.Printf(c.Str("%s Case %d:\n%s\n\n"), c.AllocaCStr(testName), c.Int(i+1), json.Print())
converter.Dispose()
}
}