Tag: check framework

构建用于检查测试C框架的库

我开始使用check框架来测试C应用程序。 为了更好地理解,我在check包中看了一下这个例子。 它工作正常,但我不需要automake工具 – 我想用我自己的Makefile编译它(因为我想要正确理解检查,我需要将我的最终应用程序用作操作系统的包)。 也许我可以在那里使用自动生成的Makefile,但是现在,这将是我必须学习的下一个新事物,我已经限制了准备unit testing的时间。 (然后,当然,我想学习和理解生成Makfile的工具,使用configure等) 使用我的Makefile构建应用程序时出现问题,我没有链接该对象以进行检查function: /tmp/ccm7cniy.o: In function `test_money_create’: check_money.c:(.text+0x1e): undefined reference to `tcase_fn_start’ check_money.c:(.text+0x79): undefined reference to `_fail_unless’ check_money.c:(.text+0xcc): undefined reference to `_fail_unless’ 我发现,在示例应用程序中是带有obj的gcc。 文件check_money-check_money.o ,由gcc创建: gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT check_money-check_money.o -MD -MP -MF .deps/check_money-check_money.Tpo -c -o check_money-check_money.o `test -f’check_money.c’ || echo ‘./’`check_money.c 这是我的问题:它使用依赖关系check_money-check_money.Tpo 。 该文件是由./configure命令生成的,我没有使用。 如何创建自己的.o文件以便检查成功构建? […]