mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-15 05:20:06 +08:00
tests: cleanup
tests: - add "hello" to test first basic compilation to file/memory - add "more" test (tests2 suite) - remove some tests tests2: - move into tests dir - Convert some files from DOS to unix LF - remove 2>&1 redirection win32: - tccrun.c: modify exception filter to exit correctly (needed for btest) - tcctest.c: exclude weak_test() (feature does not exist on win32)
This commit is contained in:
parent
60cf64612c
commit
d5f4df09ff
2
Makefile
2
Makefile
@ -350,12 +350,10 @@ tcc-doc.info: tcc-doc.texi
|
|||||||
export LIBTCC1
|
export LIBTCC1
|
||||||
|
|
||||||
%est:
|
%est:
|
||||||
$(MAKE) -C tests2 $@
|
|
||||||
$(MAKE) -C tests $@
|
$(MAKE) -C tests $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -vf $(PROGS) tcc_p$(EXESUF) tcc.pod *~ *.o *.a *.so* *.out *.exe libtcc_test$(EXESUF)
|
rm -vf $(PROGS) tcc_p$(EXESUF) tcc.pod *~ *.o *.a *.so* *.out *.exe libtcc_test$(EXESUF)
|
||||||
$(MAKE) -C tests2 $@
|
|
||||||
$(MAKE) -C tests $@
|
$(MAKE) -C tests $@
|
||||||
ifneq ($(LIBTCC1),)
|
ifneq ($(LIBTCC1),)
|
||||||
$(MAKE) -C lib $@
|
$(MAKE) -C lib $@
|
||||||
|
2
configure
vendored
2
configure
vendored
@ -500,7 +500,7 @@ echo "SRC_PATH=$source_path" >>config.mak
|
|||||||
|
|
||||||
# build tree in object directory if source path is different from current one
|
# build tree in object directory if source path is different from current one
|
||||||
if test "$source_path_used" = "yes" ; then
|
if test "$source_path_used" = "yes" ; then
|
||||||
FILES="Makefile lib/Makefile tests/Makefile tests2/Makefile"
|
FILES="Makefile lib/Makefile tests/Makefile tests/tests2/Makefile"
|
||||||
for f in $FILES ; do
|
for f in $FILES ; do
|
||||||
dir=`fn_dirname "$f"`
|
dir=`fn_dirname "$f"`
|
||||||
test -d "$dir" || mkdir -p "$dir"
|
test -d "$dir" || mkdir -p "$dir"
|
||||||
|
3
tccrun.c
3
tccrun.c
@ -615,8 +615,7 @@ static long __stdcall cpu_exception_handler(EXCEPTION_POINTERS *ex_info)
|
|||||||
rt_error(uc, "exception caught");
|
rt_error(uc, "exception caught");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
exit(-1);
|
return EXCEPTION_EXECUTE_HANDLER;
|
||||||
return EXCEPTION_CONTINUE_SEARCH;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Generate a stack backtrace when a CPU exception occurs. */
|
/* Generate a stack backtrace when a CPU exception occurs. */
|
||||||
|
114
tests/Makefile
114
tests/Makefile
@ -7,73 +7,61 @@ include $(TOP)/Makefile
|
|||||||
VPATH = $(top_srcdir)/tests
|
VPATH = $(top_srcdir)/tests
|
||||||
|
|
||||||
# what tests to run
|
# what tests to run
|
||||||
TESTS = libtest \
|
TESTS = \
|
||||||
test1 \
|
hello \
|
||||||
test2 \
|
libtest \
|
||||||
test3 \
|
test3 \
|
||||||
speedtest \
|
moretests
|
||||||
btest \
|
|
||||||
test1b\
|
|
||||||
test2b\
|
|
||||||
test3b\
|
|
||||||
weaktest
|
|
||||||
|
|
||||||
# test4 # this test does not seem to work on any platform
|
# test4 -- problem with -static
|
||||||
# asmtest # this test does not seem to work on any platform
|
# asmtest -- minor differences with gcc
|
||||||
|
# btest -- works on i386 (including win32)
|
||||||
|
# test3 -- win32 does not know how to printf long doubles
|
||||||
|
|
||||||
# bounds-checking is supported only on i386
|
# bounds-checking is supported only on i386
|
||||||
ifneq ($(ARCH),i386)
|
ifneq ($(ARCH),i386)
|
||||||
TESTS := $(filter-out btest,$(TESTS))
|
TESTS := $(filter-out btest,$(TESTS))
|
||||||
TESTS := $(filter-out test1b,$(TESTS))
|
|
||||||
TESTS := $(filter-out test2b,$(TESTS))
|
|
||||||
TESTS := $(filter-out test3b,$(TESTS))
|
|
||||||
endif
|
endif
|
||||||
|
ifdef CONFIG_WIN32
|
||||||
# these should work too
|
TESTS := $(filter-out test3,$(TESTS))
|
||||||
# TESTS += test1 test2 speedtest btest weaktest
|
|
||||||
|
|
||||||
# some tests do not pass on all platforms, remove them for now
|
|
||||||
ifeq ($(TARGETOS),Linux)
|
|
||||||
TESTS := $(filter-out weaktest,$(TESTS))
|
|
||||||
endif
|
endif
|
||||||
ifeq ($(TARGETOS),Darwin)
|
ifeq ($(TARGETOS),Darwin)
|
||||||
TESTS := $(filter-out test1,$(TESTS))
|
TESTS := $(filter-out test3 btest,$(TESTS))
|
||||||
TESTS := $(filter-out test2,$(TESTS))
|
|
||||||
TESTS := $(filter-out test3,$(TESTS))
|
|
||||||
TESTS := $(filter-out btest,$(TESTS))
|
|
||||||
TESTS := $(filter-out weaktest,$(TESTS))
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef DISABLE_STATIC
|
ifdef DISABLE_STATIC
|
||||||
export LD_LIBRARY_PATH:=$(CURDIR)/..
|
export LD_LIBRARY_PATH:=$(CURDIR)/..
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(TARGETOS),Darwin)
|
ifeq ($(TARGETOS),Darwin)
|
||||||
CFLAGS+=-Wl,-flat_namespace,-undefined,warning
|
CFLAGS+=-Wl,-flat_namespace,-undefined,warning
|
||||||
export MACOSX_DEPLOYMENT_TARGET:=10.2
|
export MACOSX_DEPLOYMENT_TARGET:=10.2
|
||||||
NATIVE_DEFINES+=-D_ANSI_SOURCE
|
NATIVE_DEFINES+=-D_ANSI_SOURCE
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# run local version of tcc with local libraries and includes
|
# run local version of tcc with local libraries and includes
|
||||||
TCC = ../tcc -B.. $(NATIVE_DEFINES)
|
TCCFLAGS = -B$(TOP)
|
||||||
ifdef CONFIG_WIN32
|
ifdef CONFIG_WIN32
|
||||||
TCC := $(TCC) -I $(top_srcdir)/win32/include -L$(top_build)
|
TCCFLAGS = -B$(top_srcdir)/win32 -I$(top_srcdir)/include -L$(TOP)
|
||||||
endif
|
endif
|
||||||
RUN_TCC = $(NATIVE_DEFINES) -run -DONE_SOURCE ../tcc.c -B..
|
|
||||||
DISAS=objdump -d
|
|
||||||
|
|
||||||
all test : $(TESTS)
|
TCC = $(TOP)/tcc $(TCCFLAGS)
|
||||||
|
RUN_TCC = $(NATIVE_DEFINES) -DONE_SOURCE -run $(TOP)/tcc.c $(TCCFLAGS)
|
||||||
|
|
||||||
# make sure that tcc exists
|
DISAS = objdump -d
|
||||||
test1 test2 test3 test4 btest speedtest asmtest weaktest : ../tcc
|
|
||||||
../%:
|
|
||||||
$(MAKE) -C .. $*
|
|
||||||
|
|
||||||
# libtcc test
|
# libtcc test
|
||||||
ifdef LIBTCC1
|
ifdef LIBTCC1
|
||||||
LIBTCC1:=$(TOP)/$(LIBTCC1)
|
LIBTCC1:=$(TOP)/$(LIBTCC1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
all test : $(TESTS)
|
||||||
|
|
||||||
|
hello: ../examples/ex1.c
|
||||||
|
@echo ------------ $@ ------------
|
||||||
|
$(TCC) $< -o $@$(EXESUF) && ./$@$(EXESUF)
|
||||||
|
$(TCC) -run $<
|
||||||
|
|
||||||
libtest: libtcc_test$(EXESUF) $(LIBTCC1)
|
libtest: libtcc_test$(EXESUF) $(LIBTCC1)
|
||||||
@echo ------------ $@ ------------
|
@echo ------------ $@ ------------
|
||||||
./libtcc_test$(EXESUF) lib_path=..
|
./libtcc_test$(EXESUF) lib_path=..
|
||||||
@ -81,6 +69,10 @@ libtest: libtcc_test$(EXESUF) $(LIBTCC1)
|
|||||||
libtcc_test$(EXESUF): libtcc_test.c $(top_builddir)/$(LIBTCC)
|
libtcc_test$(EXESUF): libtcc_test.c $(top_builddir)/$(LIBTCC)
|
||||||
$(CC) -o $@ $^ $(CPPFLAGS) $(CFLAGS) $(NATIVE_DEFINES) $(LIBS) $(LINK_LIBTCC) $(LDFLAGS)
|
$(CC) -o $@ $^ $(CPPFLAGS) $(CFLAGS) $(NATIVE_DEFINES) $(LIBS) $(LINK_LIBTCC) $(LDFLAGS)
|
||||||
|
|
||||||
|
moretests:
|
||||||
|
@echo ------------ $@ ------------
|
||||||
|
$(MAKE) -C tests2
|
||||||
|
|
||||||
# test.ref - generate using gcc
|
# test.ref - generate using gcc
|
||||||
# copy only tcclib.h so GCC's stddef and stdarg will be used
|
# copy only tcclib.h so GCC's stddef and stdarg will be used
|
||||||
test.ref: tcctest.c
|
test.ref: tcctest.c
|
||||||
@ -94,59 +86,44 @@ test1: test.ref
|
|||||||
$(TCC) -run tcctest.c > test.out1
|
$(TCC) -run tcctest.c > test.out1
|
||||||
@if diff -u test.ref test.out1 ; then echo "Auto Test OK"; fi
|
@if diff -u test.ref test.out1 ; then echo "Auto Test OK"; fi
|
||||||
|
|
||||||
test1b: test.ref
|
|
||||||
@echo ------------ $@ ------------
|
|
||||||
$(TCC) -b -run tcctest.c > test.out1b
|
|
||||||
@if diff -u test.ref test.out1b ; then echo "Auto Test OK"; fi
|
|
||||||
|
|
||||||
# iterated test2 (compile tcc then compile tcctest.c !)
|
# iterated test2 (compile tcc then compile tcctest.c !)
|
||||||
test2: test.ref
|
test2: test.ref
|
||||||
@echo ------------ $@ ------------
|
@echo ------------ $@ ------------
|
||||||
$(TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out2
|
$(TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out2
|
||||||
@if diff -u test.ref test.out2 ; then echo "Auto Test2 OK"; fi
|
@if diff -u test.ref test.out2 ; then echo "Auto Test2 OK"; fi
|
||||||
|
|
||||||
test2b: test.ref ../bcheck.o
|
|
||||||
@echo ------------ $@ ------------
|
|
||||||
$(TCC) -b $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out2b
|
|
||||||
@if diff -u test.ref test.out2b ; then echo "Auto Test2b OK"; fi
|
|
||||||
|
|
||||||
# iterated test3 (compile tcc then compile tcc then compile tcctest.c !)
|
# iterated test3 (compile tcc then compile tcc then compile tcctest.c !)
|
||||||
test3: test.ref
|
test3: test.ref
|
||||||
@echo ------------ $@ ------------
|
@echo ------------ $@ ------------
|
||||||
$(TCC) $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out3
|
$(TCC) $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out3
|
||||||
@if diff -u test.ref test.out3 ; then echo "Auto Test3 OK"; fi
|
@if diff -u test.ref test.out3 ; then echo "Auto Test3 OK"; fi
|
||||||
|
|
||||||
test3b: test.ref
|
|
||||||
@echo ------------ $@ ------------
|
|
||||||
$(TCC) -b $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out3b
|
|
||||||
@if diff -u test.ref test.out3b ; then echo "Auto Test3 OK"; fi
|
|
||||||
|
|
||||||
# binary output test
|
# binary output test
|
||||||
test4: test.ref
|
test4: test.ref
|
||||||
@echo ------------ $@ ------------
|
@echo ------------ $@ ------------
|
||||||
# dynamic output
|
|
||||||
$(TCC) -o tcctest1 tcctest.c
|
|
||||||
./tcctest1 > test1.out
|
|
||||||
@if diff -u test.ref test1.out ; then echo "Dynamic Auto Test OK"; fi
|
|
||||||
# object + link output
|
# object + link output
|
||||||
$(TCC) -c -o tcctest3.o tcctest.c
|
$(TCC) -c -o tcctest3.o tcctest.c
|
||||||
$(TCC) -o tcctest3 tcctest3.o
|
$(TCC) -o tcctest3 tcctest3.o
|
||||||
./tcctest3 > test3.out
|
./tcctest3 > test3.out
|
||||||
@if diff -u test.ref test3.out ; then echo "Object Auto Test OK"; fi
|
@if diff -u test.ref test3.out ; then echo "Object Auto Test OK"; fi
|
||||||
# static output
|
# dynamic output
|
||||||
$(TCC) -static -o tcctest2 tcctest.c
|
$(TCC) -o tcctest1 tcctest.c
|
||||||
./tcctest2 > test2.out
|
./tcctest1 > test1.out
|
||||||
@if diff -u test.ref test2.out ; then echo "Static Auto Test OK"; fi
|
@if diff -u test.ref test1.out ; then echo "Dynamic Auto Test OK"; fi
|
||||||
# dynamic output + bound check
|
# dynamic output + bound check
|
||||||
$(TCC) -b -o tcctest4 tcctest.c
|
$(TCC) -b -o tcctest4 tcctest.c
|
||||||
./tcctest4 > test4.out
|
./tcctest4 > test4.out
|
||||||
@if diff -u test.ref test4.out ; then echo "BCheck Auto Test OK"; fi
|
@if diff -u test.ref test4.out ; then echo "BCheck Auto Test OK"; fi
|
||||||
|
# static output
|
||||||
|
$(TCC) -static -o tcctest2 tcctest.c
|
||||||
|
./tcctest2 > test2.out
|
||||||
|
@if diff -u test.ref test2.out ; then echo "Static Auto Test OK"; fi
|
||||||
|
|
||||||
# memory and bound check auto test
|
# memory and bound check auto test
|
||||||
BOUNDS_OK = 1 4 8 10 14
|
BOUNDS_OK = 1 4 8 10 14
|
||||||
BOUNDS_FAIL= 2 5 7 9 11 12 13 15
|
BOUNDS_FAIL= 2 5 7 9 11 12 13 15
|
||||||
|
|
||||||
btest: boundtest.c ../bcheck.o
|
btest: boundtest.c
|
||||||
@echo ------------ $@ ------------
|
@echo ------------ $@ ------------
|
||||||
@for i in $(BOUNDS_OK); do \
|
@for i in $(BOUNDS_OK); do \
|
||||||
echo ; echo --- boundtest $$i ---; \
|
echo ; echo --- boundtest $$i ---; \
|
||||||
@ -212,5 +189,6 @@ cache: tcc_g
|
|||||||
|
|
||||||
# clean
|
# clean
|
||||||
clean:
|
clean:
|
||||||
rm -vf *~ *.o *.a *.bin *.i *.ref *.out *.out? *.out?b *.gcc \
|
$(MAKE) -C tests2 $@
|
||||||
tcctest[1234] ex? libtcc_test$(EXESUF) tcc_g tcclib.h
|
rm -vf *~ *.o *.a *.bin *.i *.ref *.out *.out? *.out?b *.gcc *.exe \
|
||||||
|
hello libtcc_test tcctest[1234] ex? tcc_g tcclib.h
|
||||||
|
@ -594,7 +594,9 @@ int main(int argc, char **argv)
|
|||||||
local_label_test();
|
local_label_test();
|
||||||
asm_test();
|
asm_test();
|
||||||
builtin_test();
|
builtin_test();
|
||||||
|
#ifndef _WIN32
|
||||||
weak_test();
|
weak_test();
|
||||||
|
#endif
|
||||||
global_data_test();
|
global_data_test();
|
||||||
cmp_comparison_test();
|
cmp_comparison_test();
|
||||||
math_cmp_test();
|
math_cmp_test();
|
||||||
@ -2464,7 +2466,7 @@ void builtin_test(void)
|
|||||||
printf("res = %d\n", __builtin_constant_p(constant_p_var));
|
printf("res = %d\n", __builtin_constant_p(constant_p_var));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
extern int __attribute__((weak)) weak_f1(void);
|
extern int __attribute__((weak)) weak_f1(void);
|
||||||
extern int __attribute__((weak)) weak_f2(void);
|
extern int __attribute__((weak)) weak_f2(void);
|
||||||
extern int weak_f3(void);
|
extern int weak_f3(void);
|
||||||
@ -2520,6 +2522,7 @@ int __attribute__((weak)) weak_f2() { return 222; }
|
|||||||
int __attribute__((weak)) weak_f3() { return 333; }
|
int __attribute__((weak)) weak_f3() { return 333; }
|
||||||
int __attribute__((weak)) weak_v2 = 222;
|
int __attribute__((weak)) weak_v2 = 222;
|
||||||
int __attribute__((weak)) weak_v3 = 333;
|
int __attribute__((weak)) weak_v3 = 333;
|
||||||
|
#endif
|
||||||
|
|
||||||
void const_func(const int a)
|
void const_func(const int a)
|
||||||
{
|
{
|
||||||
|
@ -1,103 +1,98 @@
|
|||||||
TOP = ..
|
TOP = ../..
|
||||||
include $(TOP)/Makefile
|
include $(TOP)/Makefile
|
||||||
VPATH = $(top_srcdir)/tests2
|
VPATH = $(top_srcdir)/tests/tests2
|
||||||
|
|
||||||
|
TCCFLAGS = -B$(TOP)
|
||||||
|
ifdef CONFIG_WIN32
|
||||||
|
TCCFLAGS = -B$(top_srcdir)/win32 -I$(top_srcdir)/include -L$(TOP)
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(TARGETOS),Darwin)
|
ifeq ($(TARGETOS),Darwin)
|
||||||
CFLAGS+=-Wl,-flat_namespace,-undefined,warning
|
CFLAGS += -Wl,-flat_namespace,-undefined,warning
|
||||||
TCCFLAGS=-D_ANSI_SOURCE
|
TCCFLAGS += -D_ANSI_SOURCE
|
||||||
export MACOSX_DEPLOYMENT_TARGET:=10.2
|
export MACOSX_DEPLOYMENT_TARGET:=10.2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef CONFIG_WIN32
|
TCC_RUN = $(TOP)/tcc $(TCCFLAGS) -run
|
||||||
TCCFLAGS=-I $(TOP)/win32/include -L$(TOP)
|
|
||||||
endif
|
|
||||||
|
|
||||||
TESTS= 00_assignment.test \
|
TESTS = \
|
||||||
01_comment.test \
|
00_assignment.test \
|
||||||
02_printf.test \
|
01_comment.test \
|
||||||
03_struct.test \
|
02_printf.test \
|
||||||
04_for.test \
|
03_struct.test \
|
||||||
05_array.test \
|
04_for.test \
|
||||||
06_case.test \
|
05_array.test \
|
||||||
07_function.test \
|
06_case.test \
|
||||||
08_while.test \
|
07_function.test \
|
||||||
09_do_while.test \
|
08_while.test \
|
||||||
10_pointer.test \
|
09_do_while.test \
|
||||||
11_precedence.test \
|
10_pointer.test \
|
||||||
12_hashdefine.test \
|
11_precedence.test \
|
||||||
13_integer_literals.test \
|
12_hashdefine.test \
|
||||||
14_if.test \
|
13_integer_literals.test \
|
||||||
15_recursion.test \
|
14_if.test \
|
||||||
16_nesting.test \
|
15_recursion.test \
|
||||||
17_enum.test \
|
16_nesting.test \
|
||||||
18_include.test \
|
17_enum.test \
|
||||||
19_pointer_arithmetic.test \
|
18_include.test \
|
||||||
20_pointer_comparison.test \
|
19_pointer_arithmetic.test \
|
||||||
21_char_array.test \
|
20_pointer_comparison.test \
|
||||||
22_floating_point.test \
|
21_char_array.test \
|
||||||
23_type_coercion.test \
|
22_floating_point.test \
|
||||||
24_math_library.test \
|
23_type_coercion.test \
|
||||||
25_quicksort.test \
|
24_math_library.test \
|
||||||
26_character_constants.test \
|
25_quicksort.test \
|
||||||
27_sizeof.test \
|
26_character_constants.test \
|
||||||
28_strings.test \
|
27_sizeof.test \
|
||||||
29_array_address.test \
|
28_strings.test \
|
||||||
31_args.test \
|
29_array_address.test \
|
||||||
32_led.test \
|
31_args.test \
|
||||||
33_ternary_op.test \
|
32_led.test \
|
||||||
35_sizeof.test \
|
33_ternary_op.test \
|
||||||
36_array_initialisers.test \
|
35_sizeof.test \
|
||||||
37_sprintf.test \
|
36_array_initialisers.test \
|
||||||
38_multiple_array_index.test \
|
37_sprintf.test \
|
||||||
39_typedef.test \
|
38_multiple_array_index.test \
|
||||||
40_stdio.test \
|
39_typedef.test \
|
||||||
41_hashif.test \
|
40_stdio.test \
|
||||||
42_function_pointer.test \
|
41_hashif.test \
|
||||||
43_void_param.test \
|
42_function_pointer.test \
|
||||||
44_scoped_declarations.test \
|
43_void_param.test \
|
||||||
45_empty_for.test \
|
44_scoped_declarations.test \
|
||||||
47_switch_return.test \
|
45_empty_for.test \
|
||||||
48_nested_break.test \
|
47_switch_return.test \
|
||||||
49_bracket_evaluation.test \
|
48_nested_break.test \
|
||||||
50_logical_second_arg.test \
|
49_bracket_evaluation.test \
|
||||||
51_static.test \
|
50_logical_second_arg.test \
|
||||||
52_unnamed_enum.test \
|
51_static.test \
|
||||||
54_goto.test \
|
52_unnamed_enum.test \
|
||||||
55_lshift_type.test
|
54_goto.test \
|
||||||
|
55_lshift_type.test
|
||||||
|
|
||||||
# 30_hanoi.test \ # seg fault in the code, gcc as well
|
# 30_hanoi.test -- seg fault in the code, gcc as well
|
||||||
# 34_array_assignment.test \ # array assignment is not in C standard
|
# 34_array_assignment.test -- array assignment is not in C standard
|
||||||
# 46_grep.test \ # does not compile even with gcc
|
# 46_grep.test -- does not compile even with gcc
|
||||||
|
|
||||||
# some tests do not pass on all platforms, remove them for now
|
# some tests do not pass on all platforms, remove them for now
|
||||||
ifeq ($(TARGETOS),Darwin)
|
ifeq ($(TARGETOS),Darwin)
|
||||||
TESTS := $(filter-out 40_stdio.test,$(TESTS))
|
TESTS := $(filter-out 40_stdio.test,$(TESTS))
|
||||||
endif
|
endif
|
||||||
ifdef CONFIG_WIN32
|
ifdef CONFIG_WIN32
|
||||||
TESTS := $(filter-out 24_math_library.test,$(TESTS))
|
TESTS := $(filter-out 24_math_library.test 28_strings.test,$(TESTS))
|
||||||
TESTS := $(filter-out 28_strings.test,$(TESTS))
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
%.test: %.c %.expect
|
%.test: %.c %.expect
|
||||||
@echo Test: $*...
|
@echo Test: $*...
|
||||||
@if [ "x`echo $* | grep args`" != "x" ]; \
|
@if [ "x`echo $* | grep args`" != "x" ]; \
|
||||||
then \
|
then $(TCC_RUN) $< - arg1 arg2 arg3 arg4 >$*.output; \
|
||||||
../tcc -B.. $(TCCFLAGS) -run $< - arg1 arg2 arg3 arg4 2>&1 >$*.output; \
|
else $(TCC_RUN) $< >$*.output; \
|
||||||
else \
|
|
||||||
../tcc -B.. $(TCCFLAGS) -run $< 2>&1 >$*.output; \
|
|
||||||
fi
|
fi
|
||||||
@if diff -bu $(<:.c=.expect) $*.output ; \
|
@if diff -bu $(<:.c=.expect) $*.output ; \
|
||||||
then \
|
then rm -f $*.output; \
|
||||||
rm -f $*.output \
|
else exit 1; \
|
||||||
else \
|
|
||||||
echo "ERROR: test $*"; \
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
all: test
|
all test: $(TESTS)
|
||||||
|
|
||||||
test: $(TESTS)
|
|
||||||
|
|
||||||
# vim: set expandtab ts=4 sw=4 sts=4 tw=80 :
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -vf fred.txt
|
rm -vf fred.txt *.output
|
||||||
|
Loading…
Reference in New Issue
Block a user