[libc] Move FPExceptMatcher out of TestHelpers.h
authorSiva Chandra Reddy <sivachandra@google.com>
Fri, 30 Jul 2021 05:22:20 +0000 (05:22 +0000)
committerSiva Chandra Reddy <sivachandra@google.com>
Fri, 30 Jul 2021 23:44:29 +0000 (23:44 +0000)
commit3d758e68a766545db0cc92d177d309f0616a67f4
treecbab19ae2a7453362f5b4f7850080667915a83a3
parentf08229f49e0cc92d8687661e85be3ba31b964e69
[libc] Move FPExceptMatcher out of TestHelpers.h

TestHelpers.h pulls few pieces from LLVM libc's unittest framework
which aren't available on platforms like Fuchsia which use their own
unittest framework. So, by moving FPExceptMatcher to a different file
we can exclude LLVM libc specific pieces in a cleaner way.

In a later pass, it might make more sense to rename TestHelpers.h also
to FPMatcher.h. That way, we can make macros like EXPECT_FP_EQ to be
equivalent to EXPECT_EQ on platforms like Fuchsia.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D107129
libc/test/src/fenv/enabled_exceptions_test.cpp
libc/test/src/fenv/feholdexcept_test.cpp
libc/utils/FPUtil/CMakeLists.txt
libc/utils/FPUtil/FPExceptMatcher.cpp [new file with mode: 0644]
libc/utils/FPUtil/FPExceptMatcher.h [new file with mode: 0644]
libc/utils/FPUtil/TestHelpers.cpp
libc/utils/FPUtil/TestHelpers.h