Skip to content

Commit

Permalink
[libc][NFC] Move RandUtils.h to test/src/math.
Browse files Browse the repository at this point in the history
It is currently used only by math tests so moving it to test/src/math
keeps it closer to where it is used.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D148497
  • Loading branch information
Siva Chandra Reddy committed Apr 17, 2023
1 parent ee34137 commit e2f5495
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libc/test/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function(add_fp_unittest name)
endif()

if(MATH_UNITTEST_NEED_MPFR)
list(APPEND MATH_UNITTEST_LINK_LIBRARIES libcMPFRWrapper -lmpfr -lgmp)
list(APPEND MATH_UNITTEST_LINK_LIBRARIES libcMPFRWrapper libc_math_test_utils -lmpfr -lgmp)
endif()
list(APPEND MATH_UNITTEST_LINK_LIBRARIES LibcFPTestHelpers)

Expand Down
6 changes: 6 additions & 0 deletions libc/test/src/math/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
add_libc_testsuite(libc_math_unittests)

add_library(
libc_math_test_utils
RandUtils.cpp
RandUtils.h
)

add_fp_unittest(
cosf_test
NEED_MPFR
Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/math/FmaTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include "src/__support/FPUtil/FPBits.h"
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
#include "test/src/math/RandUtils.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
#include "utils/testutils/RandUtils.h"

namespace mpfr = __llvm_libc::testing::mpfr;

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions libc/utils/testutils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ endif()

add_library(
libc_test_utils
RandUtils.cpp
RandUtils.h
StreamWrapper.cpp
StreamWrapper.h
${EFFile}
Expand Down

0 comments on commit e2f5495

Please sign in to comment.