tests: add memory leak test

Also ...

tcctest.c:
- exclude stuff that gcc doesn't compile on windows.

libtcc.c/tccpp.c:
- use unsigned for memory sizes to avoid printf format warnings
- use "file:line: message" to make IDE error parsers happy.

tccgen.c: fix typo
This commit is contained in:
grischka
2016-12-18 22:05:42 +01:00
parent f7fc4f02cf
commit a1c12b9fb9
7 changed files with 54 additions and 37 deletions

View File

@ -5,7 +5,7 @@
TOP = ..
include $(TOP)/Makefile
VPATH = $(TOPSRC)/tests $(TOPSRC) $(TOP)
CFLAGS = -I$(TOPSRC) -I$(TOP)
CFLAGS := $(filter-out -W% -g% -O%,$(CFLAGS)) -I$(TOPSRC)
# what tests to run
TESTS = \
@ -13,6 +13,7 @@ TESTS = \
hello-run \
libtest \
test3 \
memtest \
dlltest \
abitest \
vla_test-run \
@ -145,6 +146,12 @@ ifndef CONFIG_WIN32
endif
@rm tcc2$(EXESUF) libtcc2$(DLLSUF)
memtest:
@echo ------------ $@ ------------
$(CC) $(CFLAGS) $(NATIVE_DEFINES) -DONE_SOURCE -DMEM_DEBUG=2 ../tcc.c $(LIBS) -o memtest-tcc$(EXESUF)
./memtest-tcc$(EXESUF) $(TCCFLAGS) $(NATIVE_DEFINES) -DONE_SOURCE ../tcc.c $(LIBS)
./memtest-tcc$(EXESUF) $(TCCFLAGS) $(NATIVE_DEFINES) -DONE_SOURCE -run ../tcc.c $(TCCFLAGS) tcctest.c
# memory and bound check auto test
BOUNDS_OK = 1 4 8 10 14