Building and Executing

Below is a makefile for automated build of counter.c tests. The full example can be found in /examples folder.


CC = gcc
LIBS = ../lib
RM = rm
TARGET = samples
OBJS = AllTests.o counter.o counterTest.o 

all: $(TARGET)

	$(CC) -o $@ $(OBJS) -L$(LIBS) -lembUnit

	$(CC) $(CFLAGS) -I$(INCLUDES) -c $<

	-$(RM) $(TARGET) $(OBJS)

.PHONY: clean all    

Build your tests with make. Execute the created executable to run the tests. The standard test runner gives you the results in following format (results are not from earlier example):

shutterTest.testBuffer (shuttertest.c 168) exp 0 was 1

run 4 failures 1