Skip to content

[200_19] 改进测试输出格式#413

Merged
da-liii merged 3 commits intomainfrom
jinser/test-all-summary
Feb 13, 2026
Merged

[200_19] 改进测试输出格式#413
da-liii merged 3 commits intomainfrom
jinser/test-all-summary

Conversation

@jetjinser
Copy link
Collaborator

[200_19] 改进测试输出格式

任务相关的代码文件

  • tests/test_all.scm

如何测试

bin/goldfish tests/test_all.scm

观察到最后有 summary 描述测试例成功与失败。

2026-02-13 更新路径测试用例和改进测试输出格式

What

  1. 修改了路径测试用例中的文件路径:
    • /bin/ls 改为 /usr/bin/env
    • /bin/sh 改为 /usr/bin/env
  2. 改进了测试输出格式,添加了彩色输出功能:
    • 使用 ANSI 转义序列实现彩色输出
    • 为每个测试用例显示清晰的通过/失败状态
    • 添加了测试摘要信息

Why

  1. 使用 /usr/bin/env 作为测试文件更加可靠,因为它在大多数系统上都存在
  2. 改进测试输出格式使测试结果更易于阅读和理解
  3. 彩色输出有助于快速识别哪些测试通过或失败

How

  1. path-test.scm 中更新了具体的文件路径测试用例
  2. test_all.scm 中添加了颜色定义和测试结果格式化功能
  3. 使用 os-call 执行测试并收集退出码
  4. 遍历测试结果,为每个测试显示彩色状态

@da-liii da-liii merged commit 8f7dcd6 into main Feb 13, 2026
3 of 5 checks passed
@da-liii da-liii deleted the jinser/test-all-summary branch February 13, 2026 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants