goplus / llgo

A Go compiler based on LLVM in order to better integrate Go with the C ecosystem including Python
Apache License 2.0
365 stars 26 forks source link

llcppsymg: refine gosymbol to support method name #872

Open tsingbx opened 1 week ago

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.69%. Comparing base (e93d579) to head (91aa995). Report is 9 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #872 +/- ## ======================================= Coverage 95.69% 95.69% ======================================= Files 22 22 Lines 6249 6249 ======================================= Hits 5980 5980 Misses 242 242 Partials 27 27 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

luoliwoshang commented 1 week ago

对于更新的内容,增加对应的测试用例在 llcppsymg/_cmptest 下吧

tsingbx commented 3 days ago

对于更新的内容,增加对应的测试用例在 llcppsymg/_cmptest 下吧

done

luoliwoshang commented 3 days ago

对于更新的内容,增加对应的测试用例在 llcppsymg/_cmptest 下吧

done

有个测试没过,这里再check一下吧

_xtool/llcppsymg/_cmptest on  remotes/tsingbx/llcppsymg/struct_methodname:llcppsymg/struct_methodname [$?] 
❯ llgo cmptest ./...                                      
# github.com/goplus/llgo/chore/_xtool/llcppsymg/_cmptest/args_test
# github.com/goplus/llgo/chore/_xtool/llcppsymg/_cmptest/clangutils_test
# github.com/goplus/llgo/chore/_xtool/llcppsymg/_cmptest/config_test
# github.com/goplus/llgo/chore/_xtool/llcppsymg/_cmptest/names_test
# github.com/goplus/llgo/chore/_xtool/llcppsymg/_cmptest/parse_test
# github.com/goplus/llgo/chore/_xtool/llcppsymg/_cmptest/symbol_test
# github.com/goplus/llgo/chore/_xtool/llcppsymg/_cmptest/symg_test
=> Result of llgo.expect
#stdout
=== Test Case: inireader ===
[{
                "mangle":       "_ZN9INIReaderC1EPKc",
                "c++":  "INIReader::INIReader(const char *)",
                "go":   "(*Reader).Init"
        }, {
                "mangle":       "_ZN9INIReaderC1EPKcl",
                "c++":  "INIReader::INIReader(const char *, long)",
                "go":   "(*Reader).Init__1"
        }, {
                "mangle":       "_ZN9INIReaderD1Ev",
                "c++":  "INIReader::~INIReader()",
                "go":   "(*Reader).Dispose"
        }, {
                "mangle":       "_ZNK9INIReader10ParseErrorEv",
                "c++":  "INIReader::ParseError()",
                "go":   "(*Reader).ModifyedParseError"
        }, {
                "mangle":       "_ZNK9INIReader3GetEPKcS1_S1_",
                "c++":  "INIReader::Get(const char *, const char *, const char *)",
                "go":   "(*Reader).Get"
        }]
=== Test Case: lua ===
[{
                "mangle":       "lua_error",
                "c++":  "lua_error(lua_State *)",
                "go":   "(*State).Error"
        }, {
                "mangle":       "lua_next",
                "c++":  "lua_next(lua_State *, int)",
                "go":   "(*State).Next"
        }, {
                "mangle":       "lua_concat",
                "c++":  "lua_concat(lua_State *, int)",
                "go":   "(*State).Concat"
        }, {
                "mangle":       "lua_stringtonumber",
                "c++":  "lua_stringtonumber(lua_State *, const char *)",
                "go":   "(*State).Stringtonumber"
        }]

#stderr

#exit 0

=> Expected llgo.expect
#stdout
=== Test Case: inireader ===
[{
                "mangle":       "_ZN9INIReaderC1EPKc",
                "c++":  "INIReader::INIReader(const char *)",
                "go":   "(*Reader).Init"
        }, {
                "mangle":       "_ZN9INIReaderC1EPKcl",
                "c++":  "INIReader::INIReader(const char *, long)",
                "go":   "(*Reader).Init__1"
        }, {
                "mangle":       "_ZN9INIReaderD1Ev",
                "c++":  "INIReader::~INIReader()",
                "go":   "(*Reader).Dispose"
        }, {
                "mangle":       "_ZNK9INIReader10ParseErrorEv",
                "c++":  "INIReader::ParseError()",
                "go":   "(*Reader).ModifyedParseError"
        }, {
                "mangle":       "_ZNK9INIReader3GetEPKcS1_S1_",
                "c++":  "INIReader::Get(const char *, const char *, const char *)",
                "go":   "(*Reader).Get"
        }]
=== Test Case: lua ===
[{
                "mangle":       "lua_error",
                "c++":  "lua_error(lua_State *)",
                "go":   "Error"
        }, {
                "mangle":       "lua_next",
                "c++":  "lua_next(lua_State *, int)",
                "go":   "Next"
        }, {
                "mangle":       "lua_concat",
                "c++":  "lua_concat(lua_State *, int)",
                "go":   "Concat"
        }, {
                "mangle":       "lua_stringtonumber",
                "c++":  "lua_stringtonumber(lua_State *, const char *)",
                "go":   "Stringtonumber"
        }]

#stderr

#exit 0
2024/11/27 15:57:16 checkEqual: unexpected llgo.expect
tsingbx commented 3 days ago

对于更新的内容,增加对应的测试用例在 llcppsymg/_cmptest 下吧

done

有个测试没过,这里再check一下吧

_xtool/llcppsymg/_cmptest on  remotes/tsingbx/llcppsymg/struct_methodname:llcppsymg/struct_methodname [$?] 
❯ llgo cmptest ./...                                      
# github.com/goplus/llgo/chore/_xtool/llcppsymg/_cmptest/args_test
# github.com/goplus/llgo/chore/_xtool/llcppsymg/_cmptest/clangutils_test
# github.com/goplus/llgo/chore/_xtool/llcppsymg/_cmptest/config_test
# github.com/goplus/llgo/chore/_xtool/llcppsymg/_cmptest/names_test
# github.com/goplus/llgo/chore/_xtool/llcppsymg/_cmptest/parse_test
# github.com/goplus/llgo/chore/_xtool/llcppsymg/_cmptest/symbol_test
# github.com/goplus/llgo/chore/_xtool/llcppsymg/_cmptest/symg_test
=> Result of llgo.expect
#stdout
=== Test Case: inireader ===
[{
                "mangle":       "_ZN9INIReaderC1EPKc",
                "c++":  "INIReader::INIReader(const char *)",
                "go":   "(*Reader).Init"
        }, {
                "mangle":       "_ZN9INIReaderC1EPKcl",
                "c++":  "INIReader::INIReader(const char *, long)",
                "go":   "(*Reader).Init__1"
        }, {
                "mangle":       "_ZN9INIReaderD1Ev",
                "c++":  "INIReader::~INIReader()",
                "go":   "(*Reader).Dispose"
        }, {
                "mangle":       "_ZNK9INIReader10ParseErrorEv",
                "c++":  "INIReader::ParseError()",
                "go":   "(*Reader).ModifyedParseError"
        }, {
                "mangle":       "_ZNK9INIReader3GetEPKcS1_S1_",
                "c++":  "INIReader::Get(const char *, const char *, const char *)",
                "go":   "(*Reader).Get"
        }]
=== Test Case: lua ===
[{
                "mangle":       "lua_error",
                "c++":  "lua_error(lua_State *)",
                "go":   "(*State).Error"
        }, {
                "mangle":       "lua_next",
                "c++":  "lua_next(lua_State *, int)",
                "go":   "(*State).Next"
        }, {
                "mangle":       "lua_concat",
                "c++":  "lua_concat(lua_State *, int)",
                "go":   "(*State).Concat"
        }, {
                "mangle":       "lua_stringtonumber",
                "c++":  "lua_stringtonumber(lua_State *, const char *)",
                "go":   "(*State).Stringtonumber"
        }]

#stderr

#exit 0

=> Expected llgo.expect
#stdout
=== Test Case: inireader ===
[{
                "mangle":       "_ZN9INIReaderC1EPKc",
                "c++":  "INIReader::INIReader(const char *)",
                "go":   "(*Reader).Init"
        }, {
                "mangle":       "_ZN9INIReaderC1EPKcl",
                "c++":  "INIReader::INIReader(const char *, long)",
                "go":   "(*Reader).Init__1"
        }, {
                "mangle":       "_ZN9INIReaderD1Ev",
                "c++":  "INIReader::~INIReader()",
                "go":   "(*Reader).Dispose"
        }, {
                "mangle":       "_ZNK9INIReader10ParseErrorEv",
                "c++":  "INIReader::ParseError()",
                "go":   "(*Reader).ModifyedParseError"
        }, {
                "mangle":       "_ZNK9INIReader3GetEPKcS1_S1_",
                "c++":  "INIReader::Get(const char *, const char *, const char *)",
                "go":   "(*Reader).Get"
        }]
=== Test Case: lua ===
[{
                "mangle":       "lua_error",
                "c++":  "lua_error(lua_State *)",
                "go":   "Error"
        }, {
                "mangle":       "lua_next",
                "c++":  "lua_next(lua_State *, int)",
                "go":   "Next"
        }, {
                "mangle":       "lua_concat",
                "c++":  "lua_concat(lua_State *, int)",
                "go":   "Concat"
        }, {
                "mangle":       "lua_stringtonumber",
                "c++":  "lua_stringtonumber(lua_State *, const char *)",
                "go":   "Stringtonumber"
        }]

#stderr

#exit 0
2024/11/27 15:57:16 checkEqual: unexpected llgo.expect

done