I have downloaded the cmocka example files and followed all the instructions. All test files were succesfully generated and I can run them, but no output appears in the console. I have tried to alter the CMOCKA_MESSAGE_OUTPUT
environmental variable, tried to write my own tests and compile them, tried to recompile and reinstall cmocka several times - nothing made the tests output anything. I work on Windows 7 32-bit, so I figured to try also cygwin, but cygwin just throws that it cannot find public libraries, so I abandoned this fork of my research - after all cmocka should also normally work in windows cmd. Does anyone know how to make the tests output anything to the console?
EDIT
I'm adding my make info in case there was some problem with compilation/linking, although I don't see any (it doesn't produce any error and outputs correctly the tests.exe file):
# Makefile
OBJ_DIR = obj
HDR = $(wildcard *.h)
SRC = $(HDR:.h=.c)
OBJ = $(HDR:%.h=$(OBJ_DIR)\\%.o)
CC = gcc
CFLAGS = -I"C:\Program Files\cmocka\include" -I"C:\Program Files\cmocka\lib" -I"C:\Program Files\cmocka\bin" -llibcmocka -lcmocka
.PHONY: all clean
all: tests.exe
$(OBJ_DIR)\\%.o: %.c %.h
$(CC) $< -c -o $@ $(CFLAGS)
$(OBJ_DIR)\tests.o: tests.c
$(CC) $< -c -o $@ $(CFLAGS)
tests.exe: $(OBJ) $(OBJ_DIR)\tests.o
$(CC) $^ -o tests.exe $(CFLAGS)
clean:
del $(OBJ) $(OBJ_DIR)\tests.o tests.exe
note1: the numerous paths in cflags are put out of desperation - at first I had been using only the first one.
note2: when I try to run this script in Netbeans or cygwin I change del
to rm -f
and switch slashes. The output is like described above: the make is done without any errors and outputs the tests.exe
, but once executed, it throws error about not being able to find public libraries.