summaryrefslogtreecommitdiff
path: root/n/avr/modules
diff options
context:
space:
mode:
authorschodet2005-11-05 22:15:31 +0000
committerschodet2005-11-05 22:15:31 +0000
commit3f27c3e3fbedc75e6a04258aa7e375c9c632ea3d (patch)
tree719be03df9a0abc484ff221926c3ad3fdb65f035 /n/avr/modules
parenta5224bc3fa2f01e658b925d4e442865d1de13e06 (diff)
Ajout du test automatique sur host et simu.
Diffstat (limited to 'n/avr/modules')
-rw-r--r--n/avr/modules/math/fixed/test/Makefile28
-rw-r--r--n/avr/modules/math/fixed/test/avrconfig.h1
2 files changed, 19 insertions, 10 deletions
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. */