From 4ca3a49a5d7569103b43a56b967eb6529ab83453 Mon Sep 17 00:00:00 2001
From: Hinnerk van Bruinehsen <h.v.bruinehsen@fu-berlin.de>
Date: Tue, 15 Jul 2014 12:11:04 +0200
Subject: [PATCH] tests: blacklist failing test on arduino-mega2560

---
 .travis.yml                               | 1 +
 examples/ccn-lite-client/Makefile         | 3 ++-
 examples/ccn-lite-relay/Makefile          | 4 +++-
 examples/riot_and_cpp/Makefile            | 3 ++-
 examples/rpl_udp/Makefile                 | 3 ++-
 sys/pipe/pipe_dynamic.c                   | 4 ++++
 tests/bloom/Makefile                      | 4 ++++
 tests/coap/Makefile                       | 4 +++-
 tests/libfixmath_unittests/Makefile       | 4 ++++
 tests/net_if/Makefile                     | 3 +--
 tests/pnet/Makefile                       | 3 ++-
 tests/posix_sleep/Makefile                | 4 ++++
 tests/pthread/Makefile                    | 3 +++
 tests/pthread_barrier/Makefile            | 3 +++
 tests/pthread_cleanup/Makefile            | 3 +++
 tests/pthread_condition_variable/Makefile | 3 +++
 tests/pthread_cooperation/Makefile        | 3 +++
 tests/pthread_rwlock/Makefile             | 3 +++
 tests/vtimer_msg_diff/Makefile            | 4 ++++
 19 files changed, 54 insertions(+), 8 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 98f1e8857d..988ea32178 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,6 +22,7 @@ install:
     - sudo apt-get install pcregrep libpcre3
     - sudo apt-get install qemu-system-x86 python3
     - sudo apt-get install g++-multilib
+    - sudo apt-get install gcc-avr binutils-avr avr-libc
     - git config --global user.email "travis@example.com"
     - git config --global user.name "Travis CI"
 
diff --git a/examples/ccn-lite-client/Makefile b/examples/ccn-lite-client/Makefile
index 9c0a82bfe3..38b24eb873 100644
--- a/examples/ccn-lite-client/Makefile
+++ b/examples/ccn-lite-client/Makefile
@@ -29,7 +29,7 @@ QUIET ?= 1
 
 BOARD_INSUFFICIENT_RAM := chronos msb-430h telosb wsn430-v1_3b wsn430-v1_4 z1 redbee-econotag
 BOARD_BLACKLIST := arduino-due mbed_lpc1768 msb-430 pttu udoo qemu-i386 \
-                   stm32f0discovery stm32f3discovery stm32f4discovery pca10000 pca10005
+                   stm32f0discovery stm32f3discovery stm32f4discovery pca10000 pca10005 arduino-mega2560
 # mbed_lpc1768:     see https://github.com/RIOT-OS/RIOT/issues/675
 # msb-430:          see https://github.com/RIOT-OS/RIOT/issues/658
 # pttu:             see https://github.com/RIOT-OS/RIOT/issues/659
@@ -39,6 +39,7 @@ BOARD_BLACKLIST := arduino-due mbed_lpc1768 msb-430 pttu udoo qemu-i386 \
 # stm32f4discovery: no transceiver, yet
 # pca10000:         no transceiver, yet
 # pca10005:         no transceiver, yet
+# arduino-mega2560: no transceiver, yet
 
 # Modules to include:
 
diff --git a/examples/ccn-lite-relay/Makefile b/examples/ccn-lite-relay/Makefile
index 6e08fb232f..c60bc1b743 100644
--- a/examples/ccn-lite-relay/Makefile
+++ b/examples/ccn-lite-relay/Makefile
@@ -30,7 +30,7 @@ QUIET ?= 1
 BOARD_INSUFFICIENT_RAM := chronos msb-430h telosb wsn430-v1_3b wsn430-v1_4 z1 redbee-econotag
 BOARD_BLACKLIST := arduino-due mbed_lpc1768 msb-430 pttu udoo qemu-i386 \
                    stm32f0discovery stm32f3discovery stm32f4discovery \
-                   pca10000 pca10005
+                   pca10000 pca10005 arduino-mega2560
 # mbed_lpc1768:     see https://github.com/RIOT-OS/RIOT/issues/675
 # msb-430:          see https://github.com/RIOT-OS/RIOT/issues/658
 # pttu:             see https://github.com/RIOT-OS/RIOT/issues/659
@@ -39,6 +39,8 @@ BOARD_BLACKLIST := arduino-due mbed_lpc1768 msb-430 pttu udoo qemu-i386 \
 # stm32f3discovery: no transceiver, yet
 # stm32f4discovery: no transceiver, yet
 # pca10000/5:       no transceiver, yet
+# arduino-mega2560: no transceiver, yet
+
 # Modules to include:
 
 USEMODULE += posix
diff --git a/examples/riot_and_cpp/Makefile b/examples/riot_and_cpp/Makefile
index 73e1e49476..7653f9ac96 100644
--- a/examples/riot_and_cpp/Makefile
+++ b/examples/riot_and_cpp/Makefile
@@ -30,7 +30,7 @@ QUIET ?= 1
 # Blacklist boards
 BOARD_BLACKLIST := arduino-due avsextrem chronos mbed_lpc1768 msb-430h msba2 redbee-econotag \
                    telosb wsn430-v1_3b wsn430-v1_4 msb-430 pttu udoo qemu-i386 z1 stm32f0discovery \
-                   stm32f3discovery stm32f4discovery pca10000 pca10005 iot-lab_M3
+                   stm32f3discovery stm32f4discovery pca10000 pca10005 iot-lab_M3 arduino-mega2560
 
 # This example only works with native for now.
 # msb430-based boards: msp430-g++ is not provided in mspgcc.
@@ -42,6 +42,7 @@ BOARD_BLACKLIST := arduino-due avsextrem chronos mbed_lpc1768 msb-430h msba2 red
 # pca10000:         g++ does not support some used flags (e.g. -mthumb...)
 # pca10005:         g++ does not support some used flags (e.g. -mthumb...)
 # iot-lab_M3: g++ does not support some used flags (e.g. -mthumb...)
+# arduino-mega2560: cstdio header missing from avr-libc
 # others: untested.
 
 # If you want to add some extra flags when compile c++ files, add these flags
diff --git a/examples/rpl_udp/Makefile b/examples/rpl_udp/Makefile
index 5e7748ba38..2ced43fe78 100644
--- a/examples/rpl_udp/Makefile
+++ b/examples/rpl_udp/Makefile
@@ -36,7 +36,7 @@ endif
 
 BOARD_INSUFFICIENT_RAM := chronos msb-430h redbee-econotag telosb wsn430-v1_3b wsn430-v1_4 z1
 BOARD_BLACKLIST := arduino-due mbed_lpc1768 msb-430 pttu udoo qemu-i386 stm32f0discovery \
-                   stm32f3discovery stm32f4discovery pca10000 pca10005
+                   stm32f3discovery stm32f4discovery pca10000 pca10005 arduino-mega2560
 # mbed_lpc1768:     see https://github.com/RIOT-OS/RIOT/issues/675
 # msb-430:          see https://github.com/RIOT-OS/RIOT/issues/658
 # pttu:             see https://github.com/RIOT-OS/RIOT/issues/659
@@ -46,6 +46,7 @@ BOARD_BLACKLIST := arduino-due mbed_lpc1768 msb-430 pttu udoo qemu-i386 stm32f0d
 # stm32f4discovery: no transceiver, yet
 # pca10000:         no transceiver, yet
 # pca10005:         no transceiver, yet
+# arduino-mega2560: time.h missing from avr-libc
 
 # Modules to include:
 
diff --git a/sys/pipe/pipe_dynamic.c b/sys/pipe/pipe_dynamic.c
index 1cb098382b..42152c442b 100644
--- a/sys/pipe/pipe_dynamic.c
+++ b/sys/pipe/pipe_dynamic.c
@@ -25,7 +25,11 @@
  * @}
  */
 
+#if defined(MCU_ATMEGA2560)
+#include <stdlib.h>
+#else
 #include <malloc.h>
+#endif
 
 #include "pipe.h"
 
diff --git a/tests/bloom/Makefile b/tests/bloom/Makefile
index 778afff9cf..f4171d5771 100644
--- a/tests/bloom/Makefile
+++ b/tests/bloom/Makefile
@@ -5,6 +5,10 @@ BOARD_INSUFFICIENT_RAM := chronos mbed_lpc1768 msb-430 msb-430h redbee-econotag
                           telosb wsn430-v1_3b wsn430-v1_4 z1 stm32f0discovery \
                           stm32f3discovery pca10000 pca10005
 
+BOARD_BLACKLIST := arduino-mega2560
+# arduino-mega2560: Errors in assembly, e.g:
+#                   Error: value of 105617 too large for field of 2 bytes at 20018
+
 USEMODULE += hashes
 USEMODULE += bloom
 
diff --git a/tests/coap/Makefile b/tests/coap/Makefile
index 2a9db4eefa..1c802eb3fe 100644
--- a/tests/coap/Makefile
+++ b/tests/coap/Makefile
@@ -3,7 +3,9 @@ include ../Makefile.tests_common
 
 BOARD_BLACKLIST := arduino-due chronos mbed_lpc1768 msb-430 msb-430h qemu-i386 stm32f0discovery \
                    stm32f3discovery stm32f4discovery telosb wsn430-v1_3b wsn430-v1_4 udoo z1 \
-                   pca10000 pca10005
+                   pca10000 pca10005 arduino-mega2560
+#arduino-mega2560: missing header sys/types.h
+
 BOARD_INSUFFICIENT_RAM := redbee-econotag
 #MSP boards: no assert.h
 #rest: no radio
diff --git a/tests/libfixmath_unittests/Makefile b/tests/libfixmath_unittests/Makefile
index 162d11afa1..0036aa796a 100644
--- a/tests/libfixmath_unittests/Makefile
+++ b/tests/libfixmath_unittests/Makefile
@@ -1,6 +1,10 @@
 APPLICATION = libfixmath_unittests
 include ../Makefile.tests_common
 
+BOARD_BLACKLIST := arduino-mega2560
+# arduino-mega2560: builds locally but breaks travis (possibly because of
+# differences in the toolchain)
+
 # The MSP boards don't feature round(), exp(), and log(), which are used in the unittests
 BOARD_INSUFFICIENT_RAM := chronos msb-430 msb-430h telosb wsn430-v1_3b wsn430-v1_4 z1
 
diff --git a/tests/net_if/Makefile b/tests/net_if/Makefile
index a8f08913f8..9c2ba2f042 100644
--- a/tests/net_if/Makefile
+++ b/tests/net_if/Makefile
@@ -1,8 +1,7 @@
 APPLICATION = net_if
 
 BOARD_BLACKLIST = mbed_lpc1768 arduino-due udoo qemu-i386 stm32f0discovery stm32f3discovery \
-                  stm32f4discovery pca10000 pca10005
-                  
+                  stm32f4discovery pca10000 pca10005 arduino-mega2560
 # qemu-i386:        no transceiver, yet
 # stm32f0discovery: no transceiver, yet
 # stm32f3discovery: no transceiver, yet
diff --git a/tests/pnet/Makefile b/tests/pnet/Makefile
index c05f9af6a6..939f738844 100644
--- a/tests/pnet/Makefile
+++ b/tests/pnet/Makefile
@@ -3,7 +3,7 @@ include ../Makefile.tests_common
 
 BOARD_INSUFFICIENT_RAM := chronos msb-430h redbee-econotag telosb wsn430-v1_3b wsn430-v1_4 z1
 BOARD_BLACKLIST := arduino-due mbed_lpc1768 msb-430 udoo qemu-i386 stm32f0discovery \
-                   stm32f3discovery stm32f4discovery pca10000 pca10005
+                   stm32f3discovery stm32f4discovery pca10000 pca10005 arduino-mega2560
 # mbed_lpc1768:     see https://github.com/RIOT-OS/RIOT/issues/675
 # msb-430:          see https://github.com/RIOT-OS/RIOT/issues/658
 # qemu-i386:        no transceiver, yet
@@ -12,6 +12,7 @@ BOARD_BLACKLIST := arduino-due mbed_lpc1768 msb-430 udoo qemu-i386 stm32f0discov
 # stm32f4discovery: no transceiver, yet
 # pca10000:         no transceiver, yet
 # pca10005:         no transceiver, yet
+# arduino-mega2560:  unknown type name ‘radio_packet_length_t’
 
 USEMODULE += posix
 USEMODULE += pnet
diff --git a/tests/posix_sleep/Makefile b/tests/posix_sleep/Makefile
index 24f6fe6320..32fefc14e5 100644
--- a/tests/posix_sleep/Makefile
+++ b/tests/posix_sleep/Makefile
@@ -1,6 +1,10 @@
 APPLICATION = posix_sleep
 include ../Makefile.tests_common
 
+BOARD_BLACKLIST := arduino-mega2560
+# arduino-mega2560: warning: iteration 2u invokes undefined behavior
+# [-Waggressive-loop-optimizations]
+
 USEMODULE += posix
 
 DISABLE_MODULE += auto_init
diff --git a/tests/pthread/Makefile b/tests/pthread/Makefile
index e6252668c7..f94b94daf7 100644
--- a/tests/pthread/Makefile
+++ b/tests/pthread/Makefile
@@ -1,6 +1,9 @@
 APPLICATION = pthread
 include ../Makefile.tests_common
 
+BOARD_BLACKLIST := arduino-mega2560
+# arduino-mega2560: unknown type name: clockid_t
+
 USEMODULE += posix
 USEMODULE += pthread
 
diff --git a/tests/pthread_barrier/Makefile b/tests/pthread_barrier/Makefile
index e07891520c..e92aeba2a9 100644
--- a/tests/pthread_barrier/Makefile
+++ b/tests/pthread_barrier/Makefile
@@ -2,6 +2,9 @@
 APPLICATION = pthread_barrier
 include ../Makefile.tests_common
 
+BOARD_BLACKLIST := arduino-mega2560
+# arduino-mega2560: unknown type name: clockid_t
+
 # exclude boards with insufficient RAM
 BOARD_INSUFFICIENT_RAM :=  stm32f0discovery
 
diff --git a/tests/pthread_cleanup/Makefile b/tests/pthread_cleanup/Makefile
index bbd94385d0..01a07da0ef 100644
--- a/tests/pthread_cleanup/Makefile
+++ b/tests/pthread_cleanup/Makefile
@@ -1,6 +1,9 @@
 APPLICATION = pthread_cleanup
 include ../Makefile.tests_common
 
+BOARD_BLACKLIST := arduino-mega2560
+# arduino-mega2560: unknown type name: clockid_t
+
 USEMODULE += pthread
 
 include $(RIOTBASE)/Makefile.include
diff --git a/tests/pthread_condition_variable/Makefile b/tests/pthread_condition_variable/Makefile
index 6e53949643..0629990c57 100644
--- a/tests/pthread_condition_variable/Makefile
+++ b/tests/pthread_condition_variable/Makefile
@@ -1,6 +1,9 @@
 APPLICATION = condition_variable
 include ../Makefile.tests_common
 
+BOARD_BLACKLIST := arduino-mega2560
+# arduino-mega2560: unknown type name: clockid_t
+
 BOARD_INSUFFICIENT_RAM := stm32f0discovery
 
 USEMODULE += posix
diff --git a/tests/pthread_cooperation/Makefile b/tests/pthread_cooperation/Makefile
index 75665e6a48..996c3fa30e 100644
--- a/tests/pthread_cooperation/Makefile
+++ b/tests/pthread_cooperation/Makefile
@@ -1,6 +1,9 @@
 APPLICATION = pthread_cooperation
 include ../Makefile.tests_common
 
+BOARD_BLACKLIST := arduino-mega2560
+# arduino-mega2560: unknown type name: clockid_t
+
 USEMODULE += posix
 USEMODULE += pthread
 
diff --git a/tests/pthread_rwlock/Makefile b/tests/pthread_rwlock/Makefile
index e5f503a062..2d4a2b678a 100644
--- a/tests/pthread_rwlock/Makefile
+++ b/tests/pthread_rwlock/Makefile
@@ -1,6 +1,9 @@
 APPLICATION = pthread_rwlock
 include ../Makefile.tests_common
 
+BOARD_BLACKLIST := arduino-mega2560
+# arduino-mega2560: unknown type name: clockid_t
+
 USEMODULE += pthread
 USEMODULE += vtimer
 USEMODULE += random
diff --git a/tests/vtimer_msg_diff/Makefile b/tests/vtimer_msg_diff/Makefile
index 8df2c2e5c6..fbdae6b891 100644
--- a/tests/vtimer_msg_diff/Makefile
+++ b/tests/vtimer_msg_diff/Makefile
@@ -1,6 +1,10 @@
 APPLICATION = vtimer_msg_diff
 include ../Makefile.tests_common
 
+BOARD_BLACKLIST := arduino-mega2560
+# arduino-mega2560: missing define for PRId64, avr-libc's printf function
+# possibly not compatible at all
+
 BOARD_INSUFFICIENT_RAM := mbed_lpc1768 stm32f0discovery pca10000 pca10005
 
 USEMODULE += vtimer
-- 
GitLab