Unit test adds a test package Cutest: Similar to JNuit tools, but no interface. http://cutest.sourceForge.NET Write the Makefile Test the memory function, a bit problem: To reference other folders .o file. You need to declare the following: vPath = ../api:../test vPath The environment variable of Makefile, followed by reference two similar directories. # ********************* ************ CC = GCC # build = ../build
Vpath = ../api :APi#vpath% .h API: ../ API direct specified all .h file query path #vpath% .c API: ../ API # vpath% .O ../api#api_dir = . ../API
Object = alltest.o cutest.o strutil.o memoryManagement.o
Alltest: $ (Object) $ (cc) -o allTest $ (Object)
$ (Object): cutest.h ../api/memoryManagement.h
Clean: -rm * .o
# ************************************************************************************************