Commit Graph

17 Commits

Author SHA1 Message Date
Guillaume Chatelet
bdb07c98c4 Revert D152630 "[libc] Enable custom logging in LibcTest"
Failing buildbot https://lab.llvm.org/buildbot/#/builders/73/builds/49707
This reverts commit 9a7b4c9348.
2023-06-14 10:31:49 +00:00
Guillaume Chatelet
9a7b4c9348 [libc] Enable custom logging in LibcTest
This patch mimics the behavior of Google Test and allow users to log custom messages after all flavors of ASSERT_ / EXPECT_.

Reviewed By: sivachandra, lntue

Differential Revision: https://reviews.llvm.org/D152630
2023-06-14 10:26:18 +00:00
Tue Ly
1557256ab0 [libc] Add Int<> type and fix (U)Int<128> compatibility issues.
Add Int<> and Int128 types to replace the usage of __int128_t in math
functions.  Clean up to make sure that (U)Int128 and __(u)int128_t are
interchangeable in the code base.

Reviewed By: sivachandra, mikhail.ramalho

Differential Revision: https://reviews.llvm.org/D152459
2023-06-13 09:40:48 -04:00
Guillaume Chatelet
8e44b849da [libc][NFC] Introduce a Location object for consistent failure logging
This is just an implementation detail.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D152532
2023-06-10 06:58:15 +00:00
Guillaume Chatelet
fd2c74c8ed [libc][NFC] Simplify LibcTest and trim down string allocations
This is a bit of cleanup before working on logging via stream operator (i.e., `EXPECT_XXX() << ...`).

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D152503
2023-06-09 09:36:18 +00:00
Guillaume Chatelet
04e066df5e [libc] Display unit test runtime for hosted environments
With more tests added to LLVM libc each week we want to keep track of unittest's runtime, especially for low end build bots.

Top offender can be tracked with a bit of scripting (spoiler alert, mem function sweep tests are in the top ones)
```
ninja check-libc | grep "ms)" | awk '{print $(NF-1),$0}' | sort -nr | cut -f2- -d' '
```

Unfortunately this doesn't work for hermetic tests since `clock` is unavailable.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D151097
2023-05-23 09:23:12 +00:00
Siva Chandra Reddy
b095aa3f9a [libc] Use the new wide integer to hex string facility in LibcTest.
The old code, which has regressed over many cleanups, has been replaced
with the new wide integer to hex string facility.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D150901
2023-05-18 20:48:21 +00:00
Joseph Huber
9698265e44 [libc] Add comparison specialization for cpp:string type
We compare this type in the string_test. It had no specialization here
so it could cause linker errors. This patch simply extends the interface
to support it.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D150904
2023-05-18 15:24:00 -05:00
Siva Chandra Reddy
1e8960c7a5 [libc] Add rule named add_libc_hermetic_test which adds a hermetic test.
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-04-24 22:43:59 +00:00
Siva Chandra Reddy
e3645eadb8 [libc][NFC] Move ExecuteFunction test util to test/UnitTest.
Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D148611
2023-04-18 16:17:42 +00:00
Siva Chandra Reddy
dcf296b541 [libc][NFC] Remove the StreamWrapper class and use the new test logger.
Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D148452
2023-04-17 15:48:18 +00:00
Guillaume Chatelet
f5dcab0d89 [re-reland][libc] Adds string and TestLogger classes, use them in LibcTest
This is an implementation of https://discourse.llvm.org/t/rfc-running-libc-unit-tests-as-integration-tests/69461.

Differential Revision: https://reviews.llvm.org/D147231
2023-04-03 13:10:30 +00:00
Guillaume Chatelet
5a55dfb80c Revert D147231 "[reland][libc] Adds string and TestLogger classes, use them in LibcTest"
Build bot detected a memory leak.
This reverts commit b82d04ea4b.
2023-04-03 07:47:15 +00:00
Guillaume Chatelet
b82d04ea4b [reland][libc] Adds string and TestLogger classes, use them in LibcTest
This is an implementation of https://discourse.llvm.org/t/rfc-running-libc-unit-tests-as-integration-tests/69461.

Differential Revision: https://reviews.llvm.org/D147231
2023-04-03 07:35:37 +00:00
Guillaume Chatelet
ebb41f7e3d Revert D147231 "[libc] Adds string and TestLogger classes, use them in LibcTest"
Does not build with gcc.
This reverts commit fc5ae0a7a4.
2023-04-02 16:02:00 +00:00
Guillaume Chatelet
fc5ae0a7a4 [libc] Adds string and TestLogger classes, use them in LibcTest
This is an implementation of https://discourse.llvm.org/t/rfc-running-libc-unit-tests-as-integration-tests/69461.

Differential Revision: https://reviews.llvm.org/D147231
2023-04-02 15:33:23 +00:00
Siva Chandra Reddy
af1315c28f [libc][NFC] Move UnitTest and IntegrationTest to the 'test' directory.
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.
2023-02-07 19:45:51 +00:00