Skip to content

Commit 1116c18

Browse files
committed
Fixed the build tools test case failure,incorporated review comments
1 parent fc638db commit 1116c18

File tree

36 files changed

+240
-54
lines changed

36 files changed

+240
-54
lines changed

TESTS/configs/baremetal.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,25 @@
3636
],
3737
"target_overrides": {
3838
"*": {
39-
"target.default_lib": "small",
4039
"mbed-trace.fea-ipv6": false
40+
},
41+
"K64F": {
42+
"target.default_lib": "small"
43+
},
44+
"K66F": {
45+
"target.default_lib": "small"
46+
},
47+
"NUCLEO_F303RE": {
48+
"target.default_lib": "small"
49+
},
50+
"NUCLEO_F411RE": {
51+
"target.default_lib": "small"
52+
},
53+
"NUCLEO_F429ZI": {
54+
"target.default_lib": "small"
55+
},
56+
"DISCO_L475VG_IOT01A": {
57+
"target.default_lib": "small"
4158
}
4259
}
4360
}

TESTS/mbed_drivers/c_strings/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ Case cases[] = {
116116
Case("C strings: %u %d integer formatting", test_case_c_string_u_d, greentea_failure_handler),
117117
Case("C strings: %x %E integer formatting", test_case_c_string_x_X, greentea_failure_handler),
118118
#if !defined(__NEWLIB_NANO)
119+
//In build tools, GCC with Newlib-nano linker option "-u _printf_float" is not configured
120+
//to enable printf floating format. So disabling floating format test case.
119121
Case("C strings: %f %f float formatting", test_case_c_string_f_f, greentea_failure_handler),
120122
#ifndef MBED_MINIMAL_PRINTF
121123
Case("C strings: %e %E float formatting", test_case_c_string_e_E, greentea_failure_handler),

TESTS/mbed_platform/minimal-printf/compliance/main.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ static control_t test_printf_d(const size_t call_count)
5252
/*************************************************************************/
5353
/*************************************************************************/
5454
#if !defined(__NEWLIB_NANO)
55+
// The format specifier %hhd is not supported by Newlib-Nano
5556
result_minimal = mbed_printf("hhd: %hhd\r\n", SCHAR_MIN);
5657
result_file = mbed_fprintf(stderr, "hhd: %hhd\r\n", SCHAR_MIN);
5758
result_baseline = printf("hhd: %hhd\r\n", SCHAR_MIN);
@@ -102,6 +103,7 @@ static control_t test_printf_d(const size_t call_count)
102103
TEST_ASSERT_EQUAL_INT(result_baseline, result_file);
103104

104105
#if !defined(__NEWLIB_NANO)
106+
// The format specifier %lld is not supported by Newlib-Nano
105107
result_minimal = mbed_printf("lld: %lld\r\n", LLONG_MIN);
106108
result_file = mbed_fprintf(stderr, "lld: %lld\r\n", LLONG_MIN);
107109
result_baseline = printf("lld: %lld\r\n", LLONG_MIN);
@@ -175,6 +177,7 @@ static control_t test_printf_u(const size_t call_count)
175177
/*************************************************************************/
176178
/*************************************************************************/
177179
#if !defined(__NEWLIB_NANO)
180+
// The format specifier %hhu is not supported by Newlib-Nano
178181
result_minimal = mbed_printf("hhu: %hhu\r\n", 0);
179182
result_file = mbed_fprintf(stderr, "hhu: %hhu\r\n", 0);
180183
result_baseline = printf("hhu: %hhu\r\n", 0);
@@ -224,6 +227,7 @@ static control_t test_printf_u(const size_t call_count)
224227
TEST_ASSERT_EQUAL_INT(result_baseline, result_minimal);
225228
TEST_ASSERT_EQUAL_INT(result_baseline, result_file);
226229
#if !defined(__NEWLIB_NANO)
230+
// The format specifier %llu is not supported by Newlib-Nano
227231
result_minimal = mbed_printf("llu: %llu\r\n", 0ULL);
228232
result_file = mbed_fprintf(stderr, "llu: %llu\r\n", 0ULL);
229233
result_baseline = printf("llu: %llu\r\n", 0ULL);
@@ -297,6 +301,7 @@ static control_t test_printf_x(const size_t call_count)
297301
/*************************************************************************/
298302
/*************************************************************************/
299303
#if !defined(__NEWLIB_NANO)
304+
// The format specifier %hhX is not supported by Newlib-Nano
300305
result_minimal = mbed_printf("hhX: %hhX\r\n", 0);
301306
result_file = mbed_fprintf(stderr, "hhX: %hhX\r\n", 0);
302307
result_baseline = printf("hhX: %hhX\r\n", 0);
@@ -346,6 +351,7 @@ static control_t test_printf_x(const size_t call_count)
346351
TEST_ASSERT_EQUAL_INT(result_baseline, result_minimal);
347352
TEST_ASSERT_EQUAL_INT(result_baseline, result_file);
348353
#if !defined(__NEWLIB_NANO)
354+
// The format specifier %llX is not supported by Newlib-Nano
349355
result_minimal = mbed_printf("llX: %llX\r\n", 0ULL);
350356
result_file = mbed_fprintf(stderr, "llX: %llX\r\n", 0ULL);
351357
result_baseline = printf("llX: %llX\r\n", 0ULL);
@@ -445,6 +451,7 @@ static control_t test_snprintf_d(const size_t call_count)
445451
/*************************************************************************/
446452
/*************************************************************************/
447453
#if !defined(__NEWLIB_NANO)
454+
// The format specifier %hhd is not supported by Newlib-Nano
448455
result_minimal = mbed_snprintf(buffer_minimal, sizeof(buffer_minimal), "hhd: %hhd\r\n", SCHAR_MIN);
449456
result_baseline = snprintf(buffer_baseline, sizeof(buffer_baseline), "hhd: %hhd\r\n", SCHAR_MIN);
450457
TEST_ASSERT_EQUAL_STRING(buffer_baseline, buffer_minimal);
@@ -487,6 +494,7 @@ static control_t test_snprintf_d(const size_t call_count)
487494
TEST_ASSERT_EQUAL_INT(result_baseline, result_minimal);
488495

489496
#if !defined(__NEWLIB_NANO)
497+
// The format specifier %lld is not supported by Newlib-Nano
490498
result_minimal = mbed_snprintf(buffer_minimal, sizeof(buffer_minimal), "lld: %lld\r\n", LLONG_MIN);
491499
result_baseline = snprintf(buffer_baseline, sizeof(buffer_baseline), "lld: %lld\r\n", LLONG_MIN);
492500
TEST_ASSERT_EQUAL_STRING(buffer_baseline, buffer_minimal);
@@ -553,6 +561,7 @@ static control_t test_snprintf_u(const size_t call_count)
553561
/*************************************************************************/
554562
/*************************************************************************/
555563
#if !defined(__NEWLIB_NANO)
564+
// The format specifier %hhu is not supported by Newlib-Nano
556565
result_minimal = mbed_snprintf(buffer_minimal, sizeof(buffer_minimal), "hhu: %hhu\r\n", 0);
557566
result_baseline = snprintf(buffer_baseline, sizeof(buffer_baseline), "hhu: %hhu\r\n", 0);
558567
TEST_ASSERT_EQUAL_STRING(buffer_baseline, buffer_minimal);
@@ -594,6 +603,7 @@ static control_t test_snprintf_u(const size_t call_count)
594603
TEST_ASSERT_EQUAL_STRING(buffer_baseline, buffer_minimal);
595604
TEST_ASSERT_EQUAL_INT(result_baseline, result_minimal);
596605
#if !defined(__NEWLIB_NANO)
606+
// The format specifier %llu is not supported by Newlib-Nano
597607
result_minimal = mbed_snprintf(buffer_minimal, sizeof(buffer_minimal), "llu: %llu\r\n", 0ULL);
598608
result_baseline = snprintf(buffer_baseline, sizeof(buffer_baseline), "llu: %llu\r\n", 0ULL);
599609
TEST_ASSERT_EQUAL_STRING(buffer_baseline, buffer_minimal);
@@ -660,6 +670,7 @@ static control_t test_snprintf_x(const size_t call_count)
660670
/*************************************************************************/
661671
/*************************************************************************/
662672
#if !defined(__NEWLIB_NANO)
673+
// The format specifier %hhX is not supported by Newlib-Nano
663674
result_minimal = mbed_snprintf(buffer_minimal, sizeof(buffer_minimal), "hhX: %hhX\r\n", 0);
664675
result_baseline = snprintf(buffer_baseline, sizeof(buffer_baseline), "hhX: %hhX\r\n", 0);
665676
TEST_ASSERT_EQUAL_STRING(buffer_baseline, buffer_minimal);
@@ -700,6 +711,7 @@ static control_t test_snprintf_x(const size_t call_count)
700711
TEST_ASSERT_EQUAL_STRING(buffer_baseline, buffer_minimal);
701712
TEST_ASSERT_EQUAL_INT(result_baseline, result_minimal);
702713
#if !defined(__NEWLIB_NANO)
714+
// The format specifier %llX is not supported by Newlib-Nano
703715
result_minimal = mbed_snprintf(buffer_minimal, sizeof(buffer_minimal), "llX: %llX\r\n", 0ULL);
704716
result_baseline = snprintf(buffer_baseline, sizeof(buffer_baseline), "llX: %llX\r\n", 0ULL);
705717
TEST_ASSERT_EQUAL_STRING(buffer_baseline, buffer_minimal);
@@ -923,6 +935,7 @@ static control_t test_snprintf_buffer_overflow_ld(const size_t call_count)
923935
}
924936

925937
#if !defined(__NEWLIB_NANO)
938+
// The format specifier %lld is not supported by Newlib-Nano
926939
static control_t test_snprintf_buffer_overflow_lld(const size_t call_count)
927940
{
928941
return test_snprintf_buffer_overflow_generic<long long, sizeof("lld: -1099511627776")>("lld: %lld", -1099511627776LL);
@@ -940,6 +953,7 @@ static control_t test_snprintf_buffer_overflow_lu(const size_t call_count)
940953
}
941954

942955
#if !defined(__NEWLIB_NANO)
956+
// The format specifier %llu is not supported by Newlib-Nano
943957
static control_t test_snprintf_buffer_overflow_llu(const size_t call_count)
944958
{
945959
return test_snprintf_buffer_overflow_generic<unsigned long long, sizeof("llu: 1099511627776")>("llu: %llu", 1099511627776ULL);
@@ -957,6 +971,7 @@ static control_t test_snprintf_buffer_overflow_lx(const size_t call_count)
957971
}
958972

959973
#if !defined(__NEWLIB_NANO)
974+
// The format specifier %llx is not supported by Newlib-Nano
960975
static control_t test_snprintf_buffer_overflow_llx(const size_t call_count)
961976
{
962977
return test_snprintf_buffer_overflow_generic<unsigned long long, sizeof("llx: 0x10000000000")>("llx: 0x%llx", 0x10000000000ULL);
@@ -990,6 +1005,7 @@ Case cases[] = {
9901005
Case("snprintf buffer overflow %x", test_snprintf_buffer_overflow_x),
9911006
Case("snprintf buffer overflow %lx", test_snprintf_buffer_overflow_lx),
9921007
#if !defined(__NEWLIB_NANO)
1008+
// The format specifiers %lld,%llu,%llx are not supported by Newlib-Nano
9931009
Case("snprintf buffer overflow %lld", test_snprintf_buffer_overflow_lld),
9941010
Case("snprintf buffer overflow %llu", test_snprintf_buffer_overflow_llu),
9951011
Case("snprintf buffer overflow %llx", test_snprintf_buffer_overflow_llx),

targets/targets.json

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2136,12 +2136,7 @@
21362136
"init-us-ticker-at-boot": true
21372137
},
21382138
"OUTPUT_EXT": "hex",
2139-
"bootloader_supported": true,
2140-
"supported_c_libs": {
2141-
"arm": ["std", "small"],
2142-
"gcc_arm": ["std", "small"],
2143-
"iar": ["std"]
2144-
}
2139+
"bootloader_supported": true
21452140
},
21462141
"LPC55S69_S": {
21472142
"inherits": ["SPE_Target", "LPC55S69"],
@@ -3569,12 +3564,7 @@
35693564
],
35703565
"release_versions": ["2", "5"],
35713566
"bootloader_supported": true,
3572-
"device_name": "STM32L073RZ",
3573-
"supported_c_libs": {
3574-
"arm": ["std", "small"],
3575-
"gcc_arm": ["std", "small"],
3576-
"iar": ["std"]
3577-
}
3567+
"device_name": "STM32L073RZ"
35783568
},
35793569
"NUCLEO_L152RE": {
35803570
"inherits": ["FAMILY_STM32"],

tools/test/config/app_override_libs/targets.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"extra_labels": [],
55
"features": [],
66
"default_lib": "std",
7-
"supported_toolchains": ["GCC_ARM"]
7+
"supported_toolchains": ["GCC_ARM"],
8+
"supported_c_libs": {
9+
"arm": ["std"],
10+
"gcc_arm": ["std", "small"],
11+
"iar": ["std"]
12+
}
813
}
914
}

tools/test/config/compound_inheritance/targets.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"supported_toolchains": ["GCC_ARM"],
44
"extra_labels": [],
55
"default_lib": "std",
6+
"supported_c_libs": {
7+
"arm": ["std"],
8+
"gcc_arm": ["std", "small"],
9+
"iar": ["std"]
10+
},
611
"core": "Cortex-M0",
712
"config": {
813
"base1_1": "v_base1_1_b1",

tools/test/config/double_define/targets.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"supported_toolchains": ["GCC_ARM"],
44
"extra_labels": [],
55
"default_lib": "std",
6+
"supported_c_libs": {
7+
"arm": ["std"],
8+
"gcc_arm": ["std", "small"],
9+
"iar": ["std"]
10+
},
611
"core": "Cortex-M0",
712
"config": {
813
"base1_1": "v_base1_1_b1",
@@ -14,6 +19,11 @@
1419
"supported_toolchains": ["GCC_ARM"],
1520
"extra_labels": [],
1621
"default_lib": "std",
22+
"supported_c_libs": {
23+
"arm": ["std"],
24+
"gcc_arm": ["std", "small"],
25+
"iar": ["std"]
26+
},
1727
"core": "Cortex-M0",
1828
"config": {
1929
"base2_1": "v_base2_1_b2",

tools/test/config/feature_compesition/targets.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"core": "Cortex-M0",
55
"extra_labels": [],
66
"features": [],
7-
"default_lib": "std"
7+
"default_lib": "std",
8+
"supported_c_libs": {
9+
"arm": ["std"],
10+
"gcc_arm": ["std", "small"],
11+
"iar": ["std"]
12+
}
813
}
914
}

tools/test/config/feature_recursive_add/targets.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"core": "Cortex-M0",
55
"extra_labels": [],
66
"features": [],
7-
"default_lib": "std"
7+
"default_lib": "std",
8+
"supported_c_libs": {
9+
"arm": ["std"],
10+
"gcc_arm": ["std", "small"],
11+
"iar": ["std"]
12+
}
813
}
914
}

tools/test/config/feature_recursive_complex/targets.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"core": "Cortex-M0",
55
"extra_labels": [],
66
"features": [],
7-
"default_lib": "std"
7+
"default_lib": "std",
8+
"supported_c_libs": {
9+
"arm": ["std"],
10+
"gcc_arm": ["std", "small"],
11+
"iar": ["std"]
12+
}
813
}
914
}

tools/test/config/feature_remove/targets.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"core": "Cortex-M0",
55
"extra_labels": [],
66
"features": ["BOOTLOADER"],
7-
"default_lib": "std"
7+
"default_lib": "std",
8+
"supported_c_libs": {
9+
"arm": ["std"],
10+
"gcc_arm": ["std", "small"],
11+
"iar": ["std"]
12+
}
813
}
914
}

tools/test/config/lib_requires_missing_lib/targets.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"core": "Cortex-M0",
55
"extra_labels": [],
66
"features": [],
7-
"default_lib": "std"
7+
"default_lib": "std",
8+
"supported_c_libs": {
9+
"arm": ["std"],
10+
"gcc_arm": ["std", "small"],
11+
"iar": ["std"]
12+
}
813
}
914
}

tools/test/config/macro_inheritance/targets.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"core": "Cortex-M0",
55
"extra_labels": [],
66
"features": [],
7-
"default_lib": "std"
7+
"default_lib": "std",
8+
"supported_c_libs": {
9+
"arm": ["std"],
10+
"gcc_arm": ["std", "small"],
11+
"iar": ["std"]
12+
}
813
}
914
}

tools/test/config/override_labels_libs/targets.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"supported_toolchains": ["GCC_ARM"],
44
"extra_labels": [],
55
"default_lib": "std",
6+
"supported_c_libs": {
7+
"arm": ["std"],
8+
"gcc_arm": ["std", "small"],
9+
"iar": ["std"]
10+
},
611
"core": "Cortex-M0"
712
},
813
"b1": {

tools/test/config/override_labels_libs_more/targets.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"supported_toolchains": ["GCC_ARM"],
44
"extra_labels": [],
55
"default_lib": "std",
6+
"supported_c_libs": {
7+
"arm": ["std"],
8+
"gcc_arm": ["std", "small"],
9+
"iar": ["std"]
10+
},
611
"core": "Cortex-M0"
712
},
813
"b1": {

tools/test/config/override_labels_targets/targets.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"supported_toolchains": ["GCC_ARM"],
44
"extra_labels": [],
55
"default_lib": "std",
6+
"supported_c_libs": {
7+
"arm": ["std"],
8+
"gcc_arm": ["std", "small"],
9+
"iar": ["std"]
10+
},
611
"core": "Cortex-M0",
712
"config": {
813
"par1": "v_par1_base",

tools/test/config/override_precidence/targets.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
"par1": "v_par1_base",
99
"par2": "v_par2_base",
1010
"par3": "v_par3_base"
11+
},
12+
"supported_c_libs": {
13+
"arm": ["std"],
14+
"gcc_arm": ["std", "small"],
15+
"iar": ["std"]
1116
}
1217
},
1318
"b1": {

tools/test/config/override_undefined/targets.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"supported_toolchains": ["GCC_ARM"],
44
"extra_labels": [],
55
"default_lib": "std",
6+
"supported_c_libs": {
7+
"arm": ["std"],
8+
"gcc_arm": ["std", "small"],
9+
"iar": ["std"]
10+
},
611
"core": "Cortex-M0",
712
"config": {
813
"base1_1": "v_base1_1_b1",

tools/test/config/override_undefined_libs/targets.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"supported_toolchains": ["GCC_ARM"],
44
"extra_labels": [],
55
"default_lib": "std",
6+
"supported_c_libs": {
7+
"arm": ["std"],
8+
"gcc_arm": ["std", "small"],
9+
"iar": ["std"]
10+
},
611
"core": "Cortex-M0"
712
},
813
"left_intermediate": {

0 commit comments

Comments
 (0)