Skip to content

Add minimal printf #11051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 56 commits into from
Aug 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
0284019
Initial commit
Oct 15, 2017
9a21fe5
Minimal printf
Oct 15, 2017
45afbf6
Update README.md
Oct 15, 2017
15e566f
Add mbed initialization
Oct 15, 2017
63d33c6
Fix compile warnings
Oct 15, 2017
a70a533
Update README.md
Oct 15, 2017
4fd19a0
Support for floating points (disabled by default)
Oct 16, 2017
2206ae5
Add variable list versions of printf and snprintf
Oct 16, 2017
3be1165
Add support for width specifiers
Oct 26, 2017
3da2057
Add test case
Oct 26, 2017
8ec1d47
Fixed bug in getting absolute value
Oct 26, 2017
809c7ec
Merge pull request #4 from ARMmbed/width
Oct 26, 2017
ab700c0
Fix file permissions
Oct 26, 2017
dddce56
Update README.md
Oct 26, 2017
cad10ad
Add compile profiles
Oct 27, 2017
48d35c4
Merge pull request #5 from ARMmbed/add_profiles
Oct 27, 2017
2e988a3
Add "-g" to 'release' and 'develop' profiles
Oct 30, 2017
d805e84
Merge pull request #6 from ARMmbed/add_debug_info
Oct 30, 2017
75845c3
Remove references to ssize_t in the code
Nov 2, 2017
8a2d3a0
Merge pull request #7 from ARMmbed/remove_ssize_t
Nov 2, 2017
de7024f
Add missing include stdbool.h
Nov 12, 2017
a5f0716
[BUGFIX][IOTUC-18] Library fixes
Mar 22, 2018
2a01a54
Address code review issues
Mar 23, 2018
66d5739
Merge pull request #10 from ARMmbed/fixes
bogdanm Apr 16, 2018
fbbffd6
Disabled tests that aren't relevant on mbed targets
bogdanm Apr 25, 2018
362dd3f
Bugfixes for the implementation and the compliance test
bogdanm Apr 25, 2018
c6cac23
Implementation fixes
bogdanm Apr 26, 2018
541455d
TEST_ASSERT_EQUAL_STRING always tests against the base version
bogdanm May 1, 2018
1b20647
Merge pull request #11 from ARMmbed/fix_mbed_tests
bogdanm May 1, 2018
cbdb3fe
Optional SWO output instead of UART
May 7, 2018
3e3b133
Merge pull request #12 from ARMmbed/feature-swo
LiyouZhou May 22, 2018
71966b6
remove warning: comparison of an unsigned value (#13)
Dec 17, 2018
0ee94bc
Add consistent casts and widths to constants
Mar 27, 2019
5480969
Merge pull request #14 from marcuschangarm/fix-tests
marcuschangarm Mar 27, 2019
8701e0f
Fix file endings
Apr 1, 2019
df84714
Merge pull request #15 from marcuschangarm/fix-file-endings
marcuschangarm Apr 1, 2019
b641111
Add Jenkins file
Apr 2, 2019
bb92fd1
Merge pull request #17 from ARMmbed/jenkins
marcuschangarm Apr 9, 2019
92089f6
Optimize Arm Compiler
Mar 29, 2019
3a76cba
Merge pull request #18 from marcuschangarm/optimize-arm
marcuschangarm Apr 9, 2019
aa89156
Update Mbed OS compile profiles to include Arm Compiler 6
Apr 11, 2019
7a7a299
Merge pull request #19 from marcuschangarm/update-profiles
marcuschangarm Apr 12, 2019
705d428
Improve conformity
Mar 27, 2019
dc630f8
Merge pull request #20 from marcuschangarm/conform
marcuschangarm Apr 17, 2019
9c157de
Remove wrapper file in CI
Apr 17, 2019
f8feff2
Merge pull request #22 from marcuschangarm/fix-ci
marcuschangarm Apr 17, 2019
c975429
Change CI from using HTTP to HTTPS for connecting to RaaS
Apr 30, 2019
fe6bdca
Merge pull request #23 from marcuschangarm/https
marcuschangarm Apr 30, 2019
96b5c1d
Fixed floating point support (#24)
evedon Jul 2, 2019
d835073
Add support for fprintf and vfprintf (#21)
marcuschangarm Jul 4, 2019
1624de2
Fixed compilation error (#25)
evedon Jul 5, 2019
4018753
Merge branch 'master-minimal-printf' into minimal-printf
evedon Jul 15, 2019
65ab346
Integrated minimal-printf in mbed-os
evedon Jul 5, 2019
050a338
Addressed review comments, in particular:
evedon Jul 19, 2019
896500b
Fixed greentea header include path
evedon Aug 1, 2019
d6b197a
Removed no-builtin-printf for uARM
evedon Aug 5, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions TESTS/mbed_drivers/c_strings/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static char buffer[256] = {0};
#define CLEAN_BUFFER memset(::buffer, 0x00, sizeof(::buffer))
#define NEGATIVE_INTEGERS -32768,-3214,-999,-100,-1,0,-1,-4231,-999,-4123,-32760,-99999
#define POSITIVE_INTEGERS 32768,3214,999,100,1,0,1,4231,999,4123,32760,99999
#define FLOATS 0.002,0.92430,15.91320,791.77368,6208.2,25719.4952,426815.982588,6429271.046,42468024.93,212006462.910
#define FLOATS 0.002,0.92430,15.91320,791.77368,6208.2,25719.4952,426815.982588,6429271.046,42468024.93,212006462.910,6579.048

using namespace utest::v1;

Expand All @@ -47,7 +47,7 @@ void test_case_c_string_u_d()
TEST_ASSERT_EQUAL_STRING("32768 3214 999 100 1 0 1 4231 999 4123 32760 99999", buffer);
}

void test_case_c_string_x_E()
void test_case_c_string_x_X()
{
CLEAN_BUFFER;
sprintf(buffer, "%x %X %x %X %x %X %x %X %x %X %x %X", POSITIVE_INTEGERS);
Expand All @@ -57,22 +57,22 @@ void test_case_c_string_x_E()
void test_case_c_string_f_f()
{
CLEAN_BUFFER;
sprintf(buffer, "%f %f %f %f %f %f %f %f %f %f", FLOATS);
TEST_ASSERT_EQUAL_STRING("0.002000 0.924300 15.913200 791.773680 6208.200000 25719.495200 426815.982588 6429271.046000 42468024.930000 212006462.910000", buffer);
sprintf(buffer, "%f %f %f %f %f %f %f %f %f %f %f", FLOATS);
TEST_ASSERT_EQUAL_STRING("0.002000 0.924300 15.913200 791.773680 6208.200000 25719.495200 426815.982588 6429271.046000 42468024.930000 212006462.910000 6579.048000", buffer);
}

void test_case_c_string_g_g()
{
CLEAN_BUFFER;
sprintf(buffer, "%g %g %g %g %g %g %g %g %g %g", FLOATS);
TEST_ASSERT_EQUAL_STRING("0.002 0.9243 15.9132 791.774 6208.2 25719.5 426816 6.42927e+06 4.2468e+07 2.12006e+08", buffer);
sprintf(buffer, "%g %g %g %g %g %g %g %g %g %g %g", FLOATS);
TEST_ASSERT_EQUAL_STRING("0.002 0.9243 15.9132 791.774 6208.2 25719.5 426816 6.42927e+06 4.2468e+07 2.12006e+08 6579.05", buffer);
}

void test_case_c_string_e_E()
{
CLEAN_BUFFER;
sprintf(buffer, "%e %E %e %E %e %E %e %E %e %E", FLOATS);
TEST_ASSERT_EQUAL_STRING("2.000000e-03 9.243000E-01 1.591320e+01 7.917737E+02 6.208200e+03 2.571950E+04 4.268160e+05 6.429271E+06 4.246802e+07 2.120065E+08", buffer);
sprintf(buffer, "%e %E %e %E %e %E %e %E %e %E %e", FLOATS);
TEST_ASSERT_EQUAL_STRING("2.000000e-03 9.243000E-01 1.591320e+01 7.917737E+02 6.208200e+03 2.571950E+04 4.268160e+05 6.429271E+06 4.246802e+07 2.120065E+08 6.579048e+03", buffer);
}

void test_case_c_string_strtok()
Expand Down Expand Up @@ -112,10 +112,12 @@ Case cases[] = {
Case("C strings: strpbrk", test_case_c_string_strpbrk, greentea_failure_handler),
Case("C strings: %i %d integer formatting", test_case_c_string_i_d, greentea_failure_handler),
Case("C strings: %u %d integer formatting", test_case_c_string_u_d, greentea_failure_handler),
Case("C strings: %x %E integer formatting", test_case_c_string_x_E, greentea_failure_handler),
Case("C strings: %x %E integer formatting", test_case_c_string_x_X, greentea_failure_handler),
Case("C strings: %f %f float formatting", test_case_c_string_f_f, greentea_failure_handler),
#ifndef MBED_MINIMAL_PRINTF
Case("C strings: %e %E float formatting", test_case_c_string_e_E, greentea_failure_handler),
Case("C strings: %g %g float formatting", test_case_c_string_g_g, greentea_failure_handler),
#endif
};

utest::v1::status_t greentea_test_setup(const size_t number_of_cases)
Expand Down
11 changes: 11 additions & 0 deletions TESTS/mbed_platform/minimal-printf/compliance/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Description

This document describes how to run minimal-printf tests.

## Running tests

You can use the following command to run tests:

`mbed test -m K64F -t GCC_ARM -n *printf* -v -c`

Do not use --profile minimal-printf so minimal-printf is not compared with itself.
Loading