Skip to content

Commit fc3a860

Browse files
committed
tests: require float_math where needed
1 parent 4b12599 commit fc3a860

File tree

16 files changed

+42
-9
lines changed

16 files changed

+42
-9
lines changed

tests/core/thread_float/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
include ../Makefile.core_common
22

3+
FEATURES_REQUIRED += float_math
4+
35
USEMODULE += printf_float
46
USEMODULE += ztimer_usec
57

tests/core/thread_stack_alignment/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
include ../Makefile.core_common
22

3+
FEATURES_REQUIRED += float_math
4+
35
USEMODULE += printf_float
46

57
# On ESP* a custom sched_task_exit() is used that does not implement

tests/net/gnrc_sock_ip/Makefile.ci

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ BOARD_INSUFFICIENT_MEMORY := \
77
atmega328p-xplained-mini \
88
atmega8 \
99
msb-430 \
10+
msb-430h \
1011
nucleo-c031c6 \
1112
nucleo-f031k6 \
1213
nucleo-f042k6 \
1314
nucleo-l011k4 \
1415
nucleo-l031k6 \
15-
msb-430h \
1616
olimex-msp430-h1611 \
1717
samd10-xmini \
1818
stk3200 \

tests/sys/cpp11_mutex/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
include ../Makefile.sys_common
22

3+
# std::chrono uses floating point math
4+
FEATURES_REQUIRED += float_math
5+
36
USEMODULE += cpp11-compat
47
USEMODULE += libc_gettimeofday
58

tests/sys/cpp11_thread/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
include ../Makefile.sys_common
22

3+
# std::chrono uses floating point math
4+
FEATURES_REQUIRED += float_math
5+
36
USEMODULE += cpp11-compat
47
USEMODULE += ztimer64_usec
58
USEMODULE += timex

tests/sys/float/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
include ../Makefile.sys_common
22

3+
FEATURES_REQUIRED += float_math
4+
35
include $(RIOTBASE)/Makefile.include

tests/sys/fmt_print/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
include ../Makefile.sys_common
22

3+
# Needed for print_float
4+
FEATURES_OPTIONAL += float_math
5+
36
USEMODULE += fmt
47

58
include $(RIOTBASE)/Makefile.include

tests/sys/fmt_print/main.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <stdio.h>
2424

2525
#include "fmt.h"
26+
#include "modules.h"
2627

2728
int main(void)
2829
{
@@ -43,7 +44,12 @@ int main(void)
4344
print_str("\n");
4445
print_s64_dec(0x8000000000000000);
4546
print_str("\n");
46-
print_float(1.2345, 5);
47+
if (IS_USED(MODULE_FLOAT_MATH)) {
48+
print_float(1.2345, 5);
49+
}
50+
else {
51+
print_str("print_float() disabled, feature `float_math` not used.");
52+
}
4753
print_str("\n");
4854
print_bytes_hex("0123456789", 10);
4955
print_str("\n");

tests/sys/fmt_print/tests/01-run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def testfunc(child):
1414
child.expect_exact('123456789ABCDEF0')
1515
child.expect_exact('18446744073709551615')
1616
child.expect_exact('-9223372036854775808')
17-
child.expect_exact('1.23450')
17+
child.expect(r'(1.23450)|(print_float\(\) disabled, feature `float_math` not used.)')
1818
child.expect_exact('30313233343536373839')
1919
child.expect_exact('Test successful.')
2020

tests/sys/rng/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ include ../Makefile.sys_common
44
MAIN_THREAD_SIZE = THREAD_STACKSIZE_DEFAULT+THREAD_EXTRA_STACKSIZE_PRINTF+256
55
CFLAGS += -DTHREAD_STACKSIZE_MAIN=\($(MAIN_THREAD_SIZE)\)
66

7+
# Using floating point arithmetic, e.g. log2f(), for entropy estimation
8+
FEATURES_REQUIRED += float_math
9+
710
# override PRNG if desired (see sys/random for alternatives)
811
# USEMODULE += prng_minstd
912

0 commit comments

Comments
 (0)