cUnit,我如何对.h和.o文件进行测试

cUnit,我如何对.h和.o文件进行测试,c,unit-testing,cunit,C,Unit Testing,Cunit,我想对我的.h文件和.o文件进行cUnit测试 我做了如下工作: # build an executable named myprog from myprog.c CC=gcc all: $(CC) -g -Wall -Werror=vla -pedantic -std=c11 -o tp1 tcv.o tp1.c -lcunit -lm clean: $(RM) tp1 在我的.c文件中,我放了#include“tcv.h” 这是正确的方法吗?嗯,可能是正确

我想对我的.h文件和.o文件进行cUnit测试

我做了如下工作:

# build an executable named myprog from myprog.c
CC=gcc

all:
        $(CC) -g -Wall -Werror=vla -pedantic -std=c11 -o tp1 tcv.o tp1.c -lcunit -lm
clean:
        $(RM) tp1
在我的.c文件中,我放了
#include“tcv.h”


这是正确的方法吗?

嗯,可能是正确的。你遇到了什么问题?如果它编译并运行,一切都很好(顺便说一句,你发布的消息来源就是一个很好的例子,说明了为什么评论比写的更快出错,特别是如果他们只是在写评论时重复评论。)