yaml - Ceedling 具有多个源文件扩展名
问题描述
我正在尝试为我现有的嵌入式项目设置单元测试。不幸的是,该项目对源文件“.c”和“.C”有混合扩展名。由于版本控制历史,我不能只将所有文件重命名为“.c”
我尝试相应地编辑 yaml 文件,但它似乎只支持一个或另一个扩展名。
普通的
...
:extension:
:executable: .out
:source: .c
...
不是工作方式,但需要
...
:extension:
:executable: .out
:source: .c ; .C
...
LED.C 未编译。所以链接器失败了。
Test 'test_LED.c'
-----------------
Generating runner for test_LED.c...
Compiling test_LED_runner.c...
Compiling test_LED.c...
Linking test_LED.out...
build/test/out/c/test_LED.o: In function `test_LED_NeedToImplement':
C:\Users\de7d7b\Workspaces\C_\myProject/test/test_LED.c:14: undefined reference to `LED_turnOn'
collect2.exe: error: ld returned 1 exit status
解决方案
由于源扩展仅用作单个配置字符串而不是数组,因此从 0.29.1 开始,目前 Ceedling 似乎无法做到这一点。我强烈建议为它打开一个功能请求。
同时,您至少可以通过为每个文件创建符号链接来解决部分问题。这很烦人,但可以让您在不重命名所有文件的情况下使用 ceedling。例如,如果您要测试的文件在 src 中:
ln -s LED.C src/LED.c
推荐阅读
- typescript - Firebase 函数 - 将 async/await 与 once() 函数一起使用
- php - d3.js json 通过 ajax 响应使用 d3.json()
- numpy - 将 python numpy 复杂表达式简化为实部和虚部
- python-3.x - Python3 - 使用多个条件修改超类方法
- javascript - 根据数据库提供的名称导入和渲染 React 组件?
- html - 基于宽度百分比的 css 或 jquery 进度条上的多种颜色
- mongodb - 缓存计划查询是否由副本集的所有成员共享
- docker - 为部署映像使用自签名 SSL 证书
- vba - 2个坐标二维数组之间的距离
- javascript - 如何使用 jquery 从数组中选择元素并添加类?