Ceedling Cache禁用

时间:2017-07-31 13:31:44

标签: c unit-testing tdd

我尝试使用不同的预处理器宏定义进行两次不同的单元测试。

这可以通过定义不同的预处理器指令来实现:

:defines:
  # in order to add common defines:
  #  1) remove the trailing [] from the :common: section
  #  2) add entries to the :common: section (e.g. :test: has TEST defined)
  :commmon: &common_defines
    - UNITY_INT_WIDTH=16
    - CMOCK_MEM_INDEX_TYPE=uint16_t
    - CMOCK_MEM_ALIGN=1
    - CMOCK_MEM_SIZE=4096
  :test:
    - *common_defines
    - TEST
  :test_preprocess:
    - *common_defines
    - TEST
  :test_option0:
    - *common_defines
    # Option 0 config.
    - CONFIG_OPTION_STUFF=OPTION0
  :test_option1:
    - *common_defines
    # Option 1 config.
    - CONFIG_OPTION_STUFF=OPTION1

正在处理选项的缓存头文件仅适用于option0,与第一次处理的测试一样。

有没有办法禁用特定测试或整个项目的缓存?

EDITED

我找到了根据我的需求破解Ceedling的方法。它可以在github repo中找到。任何评论或改进都是非常受欢迎的。

0 个答案:

没有答案