llvm-c166/libc/test/UnitTest
Volodymyr Turanskyy 5ec690c35d
[libc] Enable bare-metal hermetic tests on Arm (#207361)
This provides missing components required to run LLVM libc hermetic
tests, for example, with QEMU:
- Redirect of output, time and exit to semihosting.
- Linker script.
- Extra LIBC_MATH_ASSUME_ROUND_NEAREST_ONLY setting for
LIBC_CONF_MATH_OPTIMIZATIONS to make hardfp tests pass.
2026-08-26 15:30:09 +01:00
..
ArmBaremetalTestUtils.cpp [libc] Enable bare-metal hermetic tests on Arm (#207361) 2026-08-26 15:30:09 +01:00
BazelFilePath.cpp
CmakeFilePath.cpp
CMakeLists.txt [libc] Enable bare-metal hermetic tests on Arm (#207361) 2026-08-26 15:30:09 +01:00
ConstraintHandlerCheckingTest.h
ErrnoCheckingTest.h
ErrnoSetterMatcher.h
ExecuteFunction.h
ExecuteFunctionUnix.cpp Reapply "[libc] Port process utilities to hermetic mode and enable some tests" (#211484) 2026-07-24 08:53:10 +02:00
FEnvSafeTest.cpp [libc] Add missing functions in FEnvImpl.h under LIBC_MATH_USE_SYSTEM_FENV config. (#211303) 2026-07-22 14:44:54 -04:00
FEnvSafeTest.h
FPExceptMatcher.cpp [libc][test] Condition out tests that can't work on bare metal (#215830) 2026-08-17 13:06:50 +01:00
FPExceptMatcher.h
FPMatcher.h [libc][math] Integer-only, statically rounded implementation of expf (#209406) 2026-08-23 11:34:41 -04:00
GTest.h
HermeticTestUtils.cpp [libc][test] Avoid getauxval dependency for bare-metal AArch64 (#215509) 2026-08-13 09:51:41 +01:00
LibcCTest.cpp [libc] Add a C unit test framework wrapper and convert existing tests (#213657) 2026-08-04 08:11:20 +02:00
LibcCTest.h [libc] Add a C unit test framework wrapper and convert existing tests (#213657) 2026-08-04 08:11:20 +02:00
LibcDeathTestExecutors.cpp [libc] Move test macro implementations out of the Test class (#212783) 2026-07-30 15:46:44 +02:00
LibcTest.cpp [libc] Add support for wchar_t in StringConverter. (#211867) 2026-08-19 10:07:25 -04:00
LibcTest.h [libc][test] Condition out tests that can't work on bare metal (#215830) 2026-08-17 13:06:50 +01:00
LibcTestMain.cpp
llvm-libc-baremetal.ld [libc] Enable bare-metal hermetic tests on Arm (#207361) 2026-08-26 15:30:09 +01:00
MemoryMatcher.cpp
MemoryMatcher.h
PrintfMatcher.cpp [libc] Migrate printf_core from stdio/ to __support/. (#208303) 2026-07-21 14:35:24 -07:00
PrintfMatcher.h [libc] Migrate printf_core from stdio/ to __support/. (#208303) 2026-07-21 14:35:24 -07:00
README.md
RoundingModeUtils.cpp [libc][math] Integer-only, statically rounded implementation of expf (#209406) 2026-08-23 11:34:41 -04:00
RoundingModeUtils.h [libc][math] Integer-only, statically rounded implementation of expf (#209406) 2026-08-23 11:34:41 -04:00
ScanfMatcher.cpp
ScanfMatcher.h
SIMDMatcher.h
StringUtils.h
Test.h [libc] Remove APPEND_LIBC_TEST (#215869) 2026-08-12 21:26:19 +02:00
TestLogger.cpp
TestLogger.h
ZxTest.h

The LLVM libc unit test framework

This directory contains a lightweight implementation of a gtest like unit test framework for LLVM libc.

Why not gtest?

While gtest is great, featureful and time tested, it uses the C and C++ standard libraries. Hence, using it to test LLVM libc (which is also an implementation of the C standard libraries) causes various kinds of mixup/conflict problems.

How is it different from gtest?

LLVM libc's unit test framework is much less featureful as compared to gtest. But, what is available strives to be exactly like gtest.

Will it be made as featureful as gtest in future?

It is not clear if LLVM libc needs/will need every feature of gtest. We only intend to extend it on an as needed basis. Hence, it might never be as featureful as gtest.