test: add support builtin testing and improve runtime feedback#102
Open
yuKing123-king wants to merge 1 commit into
Open
test: add support builtin testing and improve runtime feedback#102yuKing123-king wants to merge 1 commit into
yuKing123-king wants to merge 1 commit into
Conversation
yuKing123-king
force-pushed
the
test/add-mock-trace-exec-BUILTIN
branch
from
July 21, 2026 02:37
e4ead48 to
129eca4
Compare
xu-lang
reviewed
Jul 21, 2026
| #include "com.h" | ||
|
|
||
| #ifdef BUILTIN | ||
| #define BUILTIN_LOCAL static |
Contributor
Author
There was a problem hiding this comment.
- 对的,有重名冲突,当多个工具各自编译成 .o 后,两个目标文件都会导出同一个全局符号。test的Makefile会把它们链接在一起,然后合成最终可执行文件时,会导致报错。
- 例如这种辅助函数:void Usage(const char *arg0)或者long_opt2short_opt(const option lopts[]),在当前项目中多个工具源码中都是同样命名,所以加这个的目的是,在 BUILTIN 模式下,把这些只希望在当前源文件使用的辅助函数或全局变量,变成“仅当前源文件可见”的内部符号,以防止冲突。BUILTIN模式只给测试模式用,非 BUILTIN只给正常工具运行用
Signed-off-by: Wang Yu <[email protected]>
yuKing123-king
force-pushed
the
test/add-mock-trace-exec-BUILTIN
branch
from
July 21, 2026 07:52
129eca4 to
86353b9
Compare
Contributor
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
对本次trace-exec工具修改的内容