llcppsigfetch:test config
This commit is contained in:
@@ -12,11 +12,17 @@ import (
|
||||
|
||||
func RunTest(testName string, testCases []string) {
|
||||
for i, content := range testCases {
|
||||
converter, err := parse.NewConverter(&clangutils.Config{
|
||||
c.Printf(c.Str("%s Case %d:\n"), c.AllocaCStr(testName), c.Int(i+1))
|
||||
RunTestWithConfig(&clangutils.Config{
|
||||
File: content,
|
||||
Temp: true,
|
||||
IsCpp: true,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func RunTestWithConfig(config *clangutils.Config) {
|
||||
converter, err := parse.NewConverter(config)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -28,13 +34,12 @@ func RunTest(testName string, testCases []string) {
|
||||
|
||||
result := converter.MarshalASTFiles()
|
||||
str := result.Print()
|
||||
c.Printf(c.Str("%s Case %d:\n%s\n\n"), c.AllocaCStr(testName), c.Int(i+1), str)
|
||||
c.Printf(c.Str("%s\n\n"), str)
|
||||
|
||||
cjson.FreeCStr(str)
|
||||
result.Delete()
|
||||
converter.Dispose()
|
||||
}
|
||||
}
|
||||
|
||||
type GetTypeOptions struct {
|
||||
TypeCode string // e.g. "char*", "char**"
|
||||
|
||||
Reference in New Issue
Block a user