forked from OSchip/llvm-project
[libc][NFC] Move test related pieces from FPUtil to util/UnitTest.
Reviewed By: michaelrj Differential Revision: https://reviews.llvm.org/D112673
This commit is contained in:
parent
d31b2dc235
commit
6c3f53c7ba
|
@ -35,19 +35,3 @@ add_header_library(
|
|||
libc.src.__support.common
|
||||
libc.src.__support.CPP.standalone_cpp
|
||||
)
|
||||
|
||||
add_library(
|
||||
LibcFPTestHelpers
|
||||
FPExceptMatcher.cpp
|
||||
FPExceptMatcher.h
|
||||
TestHelpers.cpp
|
||||
TestHelpers.h
|
||||
)
|
||||
target_include_directories(LibcFPTestHelpers PUBLIC ${LIBC_SOURCE_DIR})
|
||||
target_link_libraries(LibcFPTestHelpers LibcUnitTest)
|
||||
add_dependencies(
|
||||
LibcFPTestHelpers
|
||||
LibcUnitTest
|
||||
libc.src.__support.CPP.standalone_cpp
|
||||
libc.src.__support.FPUtil.fputil
|
||||
)
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "src/fenv/fetestexcept.h"
|
||||
|
||||
#include "src/__support/FPUtil/FEnvUtils.h"
|
||||
#include "src/__support/FPUtil/FPExceptMatcher.h"
|
||||
#include "utils/UnitTest/FPExceptMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
#include <fenv.h>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "src/fenv/feholdexcept.h"
|
||||
|
||||
#include "src/__support/FPUtil/FEnvUtils.h"
|
||||
#include "src/__support/FPUtil/FPExceptMatcher.h"
|
||||
#include "utils/UnitTest/FPExceptMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
#include <fenv.h>
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
#include <math.h>
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
#include <math.h>
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
#include <math.h>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include "src/__support/FPUtil/BasicOperations.h"
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
#include <math.h>
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
#include <math.h>
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
#include <math.h>
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
#include <math.h>
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
#define LLVM_LIBC_TEST_SRC_MATH_FMATEST_H
|
||||
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
#include "utils/testutils/RandUtils.h"
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "src/__support/FPUtil/BasicOperations.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
#include <math.h>
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
#include "src/__support/FPUtil/Hypot.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
#include <math.h>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
#include "src/__support/FPUtil/NormalFloat.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
#include <limits.h>
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "src/__support/FPUtil/ManipulationFunctions.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
#include <math.h>
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
#include "src/__support/FPUtil/BasicOperations.h"
|
||||
#include "src/__support/FPUtil/NearestIntegerOperations.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
#include <math.h>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "src/__support/CPP/TypeTraits.h"
|
||||
#include "src/__support/FPUtil/BasicOperations.h"
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
#include <math.h>
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
|
||||
#include "src/__support/FPUtil/FEnvUtils.h"
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
#include <fenv.h>
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
|
||||
#include "src/__support/FPUtil/BasicOperations.h"
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
#include <math.h>
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
#include <math.h>
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
#include <math.h>
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
#include <math.h>
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "src/math/cos.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
#include <math.h>
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
|
||||
#include "src/__support/CPP/Array.h"
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "src/math/cosf.h"
|
||||
#include "test/src/math/sdcomp26094.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
#include <math.h>
|
||||
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "src/math/exp2f.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
#include <math.h>
|
||||
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "src/math/expf.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
#include <math.h>
|
||||
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "src/math/expm1f.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
#include <math.h>
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
#include "FDimTest.h"
|
||||
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "src/math/fdim.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
#include <math.h>
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
#include "FDimTest.h"
|
||||
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "src/math/fdimf.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
#include <math.h>
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
#include "FDimTest.h"
|
||||
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "src/math/fdiml.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
#include <math.h>
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
#include "src/__support/FPUtil/ManipulationFunctions.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "src/math/ilogb.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
#include <math.h>
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
#include "src/__support/FPUtil/ManipulationFunctions.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "src/math/ilogbf.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
#include <math.h>
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
#include "src/__support/FPUtil/ManipulationFunctions.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "src/math/ilogbl.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
#include <math.h>
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "src/math/generic/dp_trig.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
#include <math.h>
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "src/math/sin.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
#include <math.h>
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
|
||||
#include "src/__support/CPP/Array.h"
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "src/math/sincosf.h"
|
||||
#include "test/src/math/sdcomp26094.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
#include <math.h>
|
||||
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
|
||||
#include "src/__support/CPP/Array.h"
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "src/math/sinf.h"
|
||||
#include "test/src/math/sdcomp26094.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
#include <math.h>
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "src/math/tan.h"
|
||||
#include "utils/MPFRWrapper/MPFRUtils.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
#include <math.h>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include "src/__support/CPP/StringView.h"
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
#include "src/__support/FPUtil/TestHelpers.h"
|
||||
#include "utils/UnitTest/FPMatcher.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <memory>
|
||||
|
|
|
@ -17,3 +17,18 @@ target_include_directories(LibcUnitTestMain PUBLIC ${LIBC_SOURCE_DIR})
|
|||
add_dependencies(LibcUnitTestMain LibcUnitTest libc.src.__support.CPP.standalone_cpp)
|
||||
target_link_libraries(LibcUnitTestMain PUBLIC LibcUnitTest libc_test_utils)
|
||||
|
||||
add_library(
|
||||
LibcFPTestHelpers
|
||||
FPExceptMatcher.cpp
|
||||
FPExceptMatcher.h
|
||||
FPMatcher.cpp
|
||||
FPMatcher.h
|
||||
)
|
||||
target_include_directories(LibcFPTestHelpers PUBLIC ${LIBC_SOURCE_DIR})
|
||||
target_link_libraries(LibcFPTestHelpers LibcUnitTest)
|
||||
add_dependencies(
|
||||
LibcFPTestHelpers
|
||||
LibcUnitTest
|
||||
libc.src.__support.CPP.standalone_cpp
|
||||
libc.src.__support.FPUtil.fputil
|
||||
)
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_LIBC_SRC_SUPPORT_FPUTIL_FP_EXCEPT_MATCHER_H
|
||||
#define LLVM_LIBC_SRC_SUPPORT_FPUTIL_FP_EXCEPT_MATCHER_H
|
||||
#ifndef LLVM_LIBC_UTILS_UNITTEST_FPEXCEPTMATCHER_H
|
||||
#define LLVM_LIBC_UTILS_UNITTEST_FPEXCEPTMATCHER_H
|
||||
|
||||
#ifndef LLVM_LIBC_TEST_USE_FUCHSIA
|
||||
|
||||
|
@ -64,4 +64,4 @@ public:
|
|||
#define ASSERT_RAISES_FP_EXCEPT(func) ASSERT_DEATH(func, WITH_SIGNAL(SIGFPE))
|
||||
#endif // LLVM_LIBC_TEST_USE_FUCHSIA
|
||||
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_FPUTIL_FP_EXCEPT_MATCHER_H
|
||||
#endif // LLVM_LIBC_UTILS_UNITTEST_FPEXCEPTMATCHER_H
|
|
@ -6,9 +6,9 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "TestHelpers.h"
|
||||
#include "FPMatcher.h"
|
||||
|
||||
#include "FPBits.h"
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
|
||||
#include <string>
|
||||
|
|
@ -6,10 +6,10 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_LIBC_SRC_SUPPORT_FPUTIL_TEST_HELPERS_H
|
||||
#define LLVM_LIBC_SRC_SUPPORT_FPUTIL_TEST_HELPERS_H
|
||||
#ifndef LLVM_LIBC_UTILS_UNITTEST_FPMATCHER_H
|
||||
#define LLVM_LIBC_UTILS_UNITTEST_FPMATCHER_H
|
||||
|
||||
#include "FPBits.h"
|
||||
#include "src/__support/FPUtil/FPBits.h"
|
||||
|
||||
#include "utils/UnitTest/Test.h"
|
||||
|
||||
|
@ -98,4 +98,4 @@ FPMatcher<T, C> getMatcher(T expectedValue) {
|
|||
__llvm_libc::fputil::testing::getMatcher<__llvm_libc::testing::Cond_NE>( \
|
||||
expected))
|
||||
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_FPUTIL_TEST_HELPERS_H
|
||||
#endif // LLVM_LIBC_UTILS_UNITTEST_FPMATCHER_H
|
Loading…
Reference in New Issue