From 844800365a5c6a296ff378e4ad704a470c0b1f90 Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Thu, 11 Mar 2021 15:21:19 +0100 Subject: [PATCH] tests: lib: cbprintf: Added configuration without _Generic Extended test to validate case when _Generic keyword is not used. Signed-off-by: Krzysztof Chruscinski --- tests/lib/cbprintf_package/src/main.c | 1 + tests/lib/cbprintf_package/testcase.yaml | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/tests/lib/cbprintf_package/src/main.c b/tests/lib/cbprintf_package/src/main.c index 7af886b3fe4..c72cec97896 100644 --- a/tests/lib/cbprintf_package/src/main.c +++ b/tests/lib/cbprintf_package/src/main.c @@ -124,6 +124,7 @@ void test_main(void) printk("alignof: int=%zu long=%zu ptr=%zu long long=%zu double=%zu long double=%zu\n", __alignof__(int), __alignof__(long), __alignof__(void *), __alignof__(long long), __alignof__(double), __alignof__(long double)); + printk("%s C11 _Generic\n", Z_C_GENERIC ? "With" : "Without"); ztest_test_suite(cbprintf_package, ztest_unit_test(test_cbprintf_package) diff --git a/tests/lib/cbprintf_package/testcase.yaml b/tests/lib/cbprintf_package/testcase.yaml index c6733a15a6f..abe5fc53884 100644 --- a/tests/lib/cbprintf_package/testcase.yaml +++ b/tests/lib/cbprintf_package/testcase.yaml @@ -10,6 +10,18 @@ tests: extra_configs: - CONFIG_CBPRINTF_COMPLETE=y + libraries.cbprintf_package_no_generic: + tags: cbprintf + integration_platforms: + - native_posix + platform_allow: > + qemu_arc_em qemu_arc_hs qemu_cortex_a53 qemu_cortex_m0 qemu_cortex_m3 + qemu_cortex_r5 qemu_leon3 qemu_nios2 qemu_riscv32 qemu_riscv64 qemu_x86 + qemu_x86_64 qemu_xtensa + extra_configs: + - CONFIG_CBPRINTF_COMPLETE=y + - CONFIG_COMPILER_OPT="-DZ_C_GENERIC=0" + libraries.cbprintf_package_fp: tags: cbprintf integration_platforms: