有沒有辦法將我的項目切換到使用耙子作爲其構建系統?我有一個使用Make作爲其構建系統的大型項目,並希望爲單元測試添加CMock功能(我已經成功使用Unity),但是沒有發現關於將CMock與Makefiles集成的信息(相反,它似乎是世界上的如果他們希望CMock能夠使用他們的項目,就可以使用Ruby的耙子作爲他們的構建系統)。如何整合CMock單元測試框架與製作
我已經能夠運行CMock示例測試,其中包括一個(看似未完成的?)'make'示例。
我已經修改了測試代碼中的「make_example」於以下內容:
#include "mock_foo.h"
#include "unity.h"
void setUp(void) {}
void tearDown(void) {}
void test_main_should_initialize_foo(void) {
foo_init_Ignore();
TEST_IGNORE_MESSAGE("TODO: Implement main!");
}
然而
,運行從與Makefile文件的文件夾「讓」的時候,似乎UNITY_LINE_TYPE是不確定的(如東西從我的依賴鏈丟失):
make
mkdir -p ./build
mkdir -p ./build/obj
ruby ../../scripts/create_makefile.rb --silent
cc -o build/test/obj/test_main.o -c test/test_main.c -DTEST -I ./src -I /home/user/Documents/gitrepos/cmock/vendor/unity/src -I /home/user/Documents/gitrepos/cmock/src -I ./build/test/mocks
In file included from test/test_main.c:1:0:
./build/test/mocks/mock_foo.h:27:27: error: unknown type name ‘UNITY_LINE_TYPE’
void foo_init_CMockExpect(UNITY_LINE_TYPE cmock_line);
^
build/test/MakefileTestSupport:29: recipe for target 'build/test/obj/test_main.o' failed
make: *** [build/test/obj/test_main.o] Error 1
有沒有人使用Makefiles和CMock成功實現了一個項目?