rt-thread icon indicating copy to clipboard operation
rt-thread copied to clipboard

[utest] 单元测试框架不够完善

Open wdfk-prog opened this issue 1 year ago • 3 comments

  • 单元测试提供的宏太少了,对比其Unity测试框架来说的话
  • 对于断言失败也没有退出机制,还得自行手动退出

https://github.com/ThrowTheSwitch/Unity/blob/25ca536caf5c085c453917fe139b3303b8a36e9d/src/unity.h#L102-L691

wdfk-prog avatar Apr 27 '24 02:04 wdfk-prog

欢迎PR新的特性

BernardXiong avatar Apr 27 '24 10:04 BernardXiong

欢迎PR新的特性

  • 直接copy别人的代码修改合适吗...
  • 或许应该把unity的直接拉进来,再进行修改更好

wdfk-prog avatar Apr 28 '24 00:04 wdfk-prog

另外 assert 不支持运行时表达式结果打印。比如 assert_equal(a, b),如果出错大部分框架都会展示 a, b 的运行时结果。类似

assert failed: a == b,
    a is $RUNTIME_VALUE_A
    b is $RUNTIME_VALUE_B

polarvid avatar May 06 '24 03:05 polarvid