Skip to content

tools/nolibc: add testcases for vfprintf

Willy Tarreau lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4tools/nolibc: add libc-test binarytools/testing/selftests/nolibc/.gitignore tools/testing/selftests/nolibc/Makefile+7 -00 replies
2/4tools/nolibc: add wrapper for memfd_createtools/include/nolibc/sys.h+23 -00 replies
3/4tools/nolibc: implement fd-based FILE streamstools/include/nolibc/stdio.h+68 -270 replies
4/4tools/nolibc: add testcases for vfprintftools/testing/selftests/nolibc/nolibc-test.c+86 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] tools/nolibc: add testcases for vfprintf

Hello Paul,

Thomas added new tests for vfprintf(), which is a good idea because it was a new implementation, we use it a lot in the tests so we'd rather make sure it works! This required to implement support for memfd_create() that is used to collect the output into a buffer, as well as to complete a little bit the minimalistic FILE emulation with fileno(), fdopen(), fflush() and fclose(). The result is neat and works equally on glibc and nolibc. We just had to cheat on the pointer test because for NULL nolibc prints "0x0" while glibc prints "(nil)" so we check 0x1 instead to avoid this special case.

Finally Thomas added a new target to the makefile to ease building the test against the default libc. This should help detect incompatibilities when new features are added.

I've tested it locally with my libc and against all supported architectures (userland tests only), and all tests passed.

This can be added to your dev tree for 6.5 on top of the previous series.

Thanks!
Willy

Thomas Weißschuh (4):
tools/nolibc: add libc-test binary
tools/nolibc: add wrapper for memfd_create
tools/nolibc: implement fd-based FILE streams
tools/nolibc: add testcases for vfprintf

 tools/include/nolibc/stdio.h                 | 95 ++++++++++++++------
 tools/include/nolibc/sys.h                   | 23 +++++
 tools/testing/selftests/nolibc/.gitignore    |  1 +
 tools/testing/selftests/nolibc/Makefile      |  6 ++
 tools/testing/selftests/nolibc/nolibc-test.c | 86 ++++++++++++++++++
 5 files changed, 184 insertions(+), 27 deletions(-)
Signature · 1 line
2.17.5