From 3f27c3e3fbedc75e6a04258aa7e375c9c632ea3d Mon Sep 17 00:00:00 2001 From: schodet Date: Sat, 5 Nov 2005 22:15:31 +0000 Subject: Ajout du test automatique sur host et simu. --- n/avr/modules/math/fixed/test/Makefile | 28 ++++++++++++++++++---------- n/avr/modules/math/fixed/test/avrconfig.h | 1 + 2 files changed, 19 insertions(+), 10 deletions(-) (limited to 'n/avr/modules') diff --git a/n/avr/modules/math/fixed/test/Makefile b/n/avr/modules/math/fixed/test/Makefile index c690212..f35e939 100644 --- a/n/avr/modules/math/fixed/test/Makefile +++ b/n/avr/modules/math/fixed/test/Makefile @@ -16,17 +16,25 @@ HOST_LIBS = -lm include $(BASE)/make/Makefile.gen -EXTRA_CLEAN_FILES += test_fixed.mul test_fixed.div test_fixed.cos \ - test_fixed.sqrt +# Automatic tests. -test_fixed.mul: test_fixed.host - echo '!m' | ./$< > $@ +TEST_FILES = test.mul test.div test.cos test.sqrt +TEST_FILES := $(TEST_FILES:%=%.host) $(TEST_FILES:%=%.simu) +code_mul = m +code_div = d +code_cos = c +code_sqrt = s +code = $(code_$(1:test.%.$(2)=%)) -test_fixed.div: test_fixed.host - echo '!d' | ./$< > $@ +clean.test: + rm -f $(TEST_FILES) -test_fixed.cos: test_fixed.host - echo '!c' | ./$< > $@ +SIMULAVR = simulavr -d $(AVR_MCU) -W 0x22,- -R 0x20,- -T uart0_exit -test_fixed.sqrt: test_fixed.host - echo '!s' | ./$< > $@ +.PRECIOUS: $(TEST_FILES) + +test.%.host: test_fixed.host + echo '!$(call code,$@,host)' | ./$< > $@ + +test.%.simu: test_fixed.avr.simu.elf + echo '!$(call code,$@,simu)\r' | $(SIMULAVR) -f $< > $@ diff --git a/n/avr/modules/math/fixed/test/avrconfig.h b/n/avr/modules/math/fixed/test/avrconfig.h index 12cae01..763c918 100644 --- a/n/avr/modules/math/fixed/test/avrconfig.h +++ b/n/avr/modules/math/fixed/test/avrconfig.h @@ -71,6 +71,7 @@ #define AC_UART1_SEND_BUFFER_SIZE 32 #define AC_UART1_RECV_BUFFER_SIZE 32 #define AC_UART1_SEND_BUFFER_FULL WAIT +#define AC_UART1_HOST_DRIVER STDIO /* proto - Protocol module. */ /** Maximum argument size. */ -- cgit v1.2.3