summaryrefslogtreecommitdiff
path: root/libc/test/UnitTest/LibcTestMain.cpp
AgeCommit message (Collapse)Author
2024-08-12[libc] Fix warning on 'extern "C" int main' in test suite (#102973)Joseph Huber
Summary: According to the C++ standard, The main function shall not be declared with a linkage-specification. after some changes in https://github.com/llvm/llvm-project/pull/101853 this started emitting warnings when building / testing the C library. This source file is shared with the overlay tests as well as the full build tests. The full build tests are compiled with `-ffreestanding`, as are all the startup / integration files. The standard says freestanding environment are all implementation defined, so this is valid in those cases. This patch simply prevents adding the linkage when we are compiling unit tests, which are hosted. This is a continuation on https://github.com/llvm/llvm-project/pull/102825.
2024-08-11Revert "libc: Remove `extern "C"` from main declarations" (#102827)Schrodinger ZHU Yifan
Reverts llvm/llvm-project#102825
2024-08-11libc: Remove `extern "C"` from main declarations (#102825)David Blaikie
This is invalid in C++, and clang recently started warning on it as of #101853
2024-05-30[libc] android atest compat (#93852)Nick Desaulniers (paternity leave)
These changes slighly modify the output of the unittests so that they better match GTest, so that utilities that parse the expected output from GTest (such as Android's unit test harness) can read the output from our unit tests. This allows our unit tests to be run on Android devices. Add very primitive command line parsing to: - support --gtest_color=no to disable printing terminal colors. - recognize --gtest_print_time and print the test time in milliseconds. - most of our unit tests run on the order of microseconds, so its useful to preserve the existing behavior. But upsteram GTest ONLY prints time tests in milliseconds, and Android's atest expects to be able to parse exactly that. Atest always passes --gtest_print_time. The word `took` is removed as that also differs from upstream GTest, tripping up parsers. - ignore other --gtest_* flags Do so so that atest can parse the output correctly. Print the test number count before each run, so that atest can parse this value correctly. Link: https://android-review.googlesource.com/c/platform/external/llvm-libc/+/3107252 Link: https://google.github.io/googletest/advanced.html#colored-terminal-output Link: https://google.github.io/googletest/advanced.html#suppressing-the-elapsed-time
2023-09-26[libc] Mass replace enclosing namespace (#67032)Guillaume Chatelet
This is step 4 of https://discourse.llvm.org/t/rfc-customizable-namespace-to-allow-testing-the-libc-when-the-system-libc-is-also-llvms-libc/73079
2023-04-24[libc] Add rule named `add_libc_hermetic_test` which adds a hermetic test.Siva Chandra Reddy
A convenience wrapper name `add_libc_test` is also added which adds both a unit test and a hermetic test. The ctype tests have been switched over to use add_libc_test. Reviewed By: jhuber6 Differential Revision: https://reviews.llvm.org/D148756
2023-02-07[libc][NFC] Move UnitTest and IntegrationTest to the 'test' directory.Siva Chandra Reddy
This part of the effort to make all test related pieces into the `test` directory. This helps is excluding test related pieces in a straight forward manner if LLVM_INCLUDE_TESTS is OFF. Future patches will also move the MPFR wrapper and testutils into the 'test' directory.