导入代码目录

导入单元测试代码目录

(1)使用GUI,导入代码

点击菜单 编码助手->导入代码
avatar

(2)手动编辑 config.cfg,导入代码

配置项目路径,和单元测试代码保存路径 (注意:windows和linux的路径格式不同)
编辑config.cfg

名称

功能

source_code

配置代码路径

test_code

配置单元测试代码保存路径

配置举例

例子1(demo)

对c_demo代码进行测试

[PATH]
#To set the source code path of a project
source_code =c_demo
#To set the test code path, if not set, test_code will be autoly created.
test_code =  

例子2

[PATH]
#To set the source code path of a project
source_code =/mnt/d/mycode
#To set the test code path, if not set, test_code will be autoly created.
test_code =  /mnt/d/mycode/unittest

(3)使用命令行配置,导入代码

{config}
导入代码目录 参数有 : -s arg 指定 source_code 目录 -t arg 指定 test_code 目录

命令行举例

例子1(demo)

对c_demo代码进行测试

ctestcode config -s c_demo 

例子2 第一次创建单元测试

代码目录在/mnt/d/mycode
第一次配置,没有测试代码.默认会建立一个testcode文件夹,用于保存测试代码 /mnt/d/mycode/ctestcode

ctestcode config -s /mnt/d/mycode -t /mnt/d/mycode/unittest

例子3 指定已有的单元测试

代码目录在/mnt/d/mycode
测试代码目录在/mnt/d/mycode/unittest

ctestcode config -s /mnt/d/mycode -t /mnt/d/mycode/unittest

(4)ctestcode单元测试项目 目录结构

项目主目录
├──testcode 1
│   ├── 项目子目录镜像 2
│   └── config.ut 3
└── 项目子目录 4


1

ctestcode 创建的 单元测试项目目录,这个目录也可以创建在项目目录外面。

2

项目子目录镜像是根据项目子目录自动创建的,里面存放着单元测试文件

3

项目单元测试配置文件

4

项目子目录