diff options
author | Petr Hosek <phosek@google.com> | 2023-07-07 21:04:43 +0000 |
---|---|---|
committer | Petr Hosek <phosek@google.com> | 2023-07-08 05:15:44 +0000 |
commit | fb149e4beb04d0e2661c84189635d103263a8fd4 (patch) | |
tree | 3e7bd24819fd8348159681e323b6518d85081989 /libc | |
parent | 661d91a0fd4ad80ecc49ebb9e0fff01b4de2ce1c (diff) | |
download | llvm-fb149e4beb04d0e2661c84189635d103263a8fd4.zip llvm-fb149e4beb04d0e2661c84189635d103263a8fd4.tar.gz llvm-fb149e4beb04d0e2661c84189635d103263a8fd4.tar.bz2 |
[libc] Use the new style includes for tests
This is a follow up to D154529 covering tests.
Differential Revision: https://reviews.llvm.org/D154746
Diffstat (limited to 'libc')
-rw-r--r-- | libc/test/src/signal/kill_test.cpp | 2 | ||||
-rw-r--r-- | libc/test/src/signal/raise_test.cpp | 3 | ||||
-rw-r--r-- | libc/test/src/signal/sigaddset_test.cpp | 2 | ||||
-rw-r--r-- | libc/test/src/signal/sigdelset_test.cpp | 2 | ||||
-rw-r--r-- | libc/test/src/signal/sigfillset_test.cpp | 2 | ||||
-rw-r--r-- | libc/test/src/signal/signal_test.cpp | 3 | ||||
-rw-r--r-- | libc/test/src/signal/sigprocmask_test.cpp | 3 | ||||
-rw-r--r-- | libc/test/src/stdlib/_Exit_test.cpp | 3 | ||||
-rw-r--r-- | libc/test/src/stdlib/abort_test.cpp | 5 |
9 files changed, 15 insertions, 10 deletions
diff --git a/libc/test/src/signal/kill_test.cpp b/libc/test/src/signal/kill_test.cpp index 9c53f8e..b0c0969 100644 --- a/libc/test/src/signal/kill_test.cpp +++ b/libc/test/src/signal/kill_test.cpp @@ -8,12 +8,12 @@ #include "src/signal/kill.h" -#include "include/sys/syscall.h" // For syscall numbers. #include "src/__support/OSUtil/syscall.h" // For internal syscall function. #include "test/UnitTest/ErrnoSetterMatcher.h" #include "test/UnitTest/Test.h" #include <signal.h> +#include <sys/syscall.h> // For syscall numbers. using __llvm_libc::testing::ErrnoSetterMatcher::Succeeds; diff --git a/libc/test/src/signal/raise_test.cpp b/libc/test/src/signal/raise_test.cpp index 12c2a26..080541f 100644 --- a/libc/test/src/signal/raise_test.cpp +++ b/libc/test/src/signal/raise_test.cpp @@ -6,11 +6,12 @@ // //===----------------------------------------------------------------------===// -#include "include/signal.h" #include "src/signal/raise.h" #include "test/UnitTest/Test.h" +#include <signal.h> + TEST(LlvmLibcSignalTest, Raise) { // SIGCONT is ingored unless stopped, so we can use it to check the return // value of raise without needing to block. diff --git a/libc/test/src/signal/sigaddset_test.cpp b/libc/test/src/signal/sigaddset_test.cpp index ea5c8c1..dbc0a61 100644 --- a/libc/test/src/signal/sigaddset_test.cpp +++ b/libc/test/src/signal/sigaddset_test.cpp @@ -6,13 +6,13 @@ // //===----------------------------------------------------------------------===// -#include "include/signal.h" #include "src/signal/sigaddset.h" #include "test/UnitTest/ErrnoSetterMatcher.h" #include "test/UnitTest/Test.h" #include <errno.h> +#include <signal.h> // This tests invalid inputs and ensures errno is properly set. TEST(LlvmLibcSignalTest, SigaddsetInvalid) { diff --git a/libc/test/src/signal/sigdelset_test.cpp b/libc/test/src/signal/sigdelset_test.cpp index dfaa84d..80f2459 100644 --- a/libc/test/src/signal/sigdelset_test.cpp +++ b/libc/test/src/signal/sigdelset_test.cpp @@ -6,7 +6,6 @@ // //===----------------------------------------------------------------------===// -#include "include/signal.h" #include "src/signal/raise.h" #include "src/signal/sigdelset.h" #include "src/signal/sigfillset.h" @@ -16,6 +15,7 @@ #include "test/UnitTest/Test.h" #include <errno.h> +#include <signal.h> TEST(LlvmLibcSigdelset, Invalid) { using __llvm_libc::testing::ErrnoSetterMatcher::Fails; diff --git a/libc/test/src/signal/sigfillset_test.cpp b/libc/test/src/signal/sigfillset_test.cpp index 6b0e172..52f1e27 100644 --- a/libc/test/src/signal/sigfillset_test.cpp +++ b/libc/test/src/signal/sigfillset_test.cpp @@ -6,7 +6,6 @@ // //===----------------------------------------------------------------------===// -#include "include/signal.h" #include "src/signal/raise.h" #include "src/signal/sigfillset.h" #include "src/signal/sigprocmask.h" @@ -15,6 +14,7 @@ #include "test/UnitTest/Test.h" #include <errno.h> +#include <signal.h> TEST(LlvmLibcSigfillset, Invalid) { using __llvm_libc::testing::ErrnoSetterMatcher::Fails; diff --git a/libc/test/src/signal/signal_test.cpp b/libc/test/src/signal/signal_test.cpp index 9635e27..999933c 100644 --- a/libc/test/src/signal/signal_test.cpp +++ b/libc/test/src/signal/signal_test.cpp @@ -6,7 +6,6 @@ // //===----------------------------------------------------------------------===// -#include "include/signal.h" #include "src/errno/libc_errno.h" #include "src/signal/raise.h" #include "src/signal/signal.h" @@ -14,6 +13,8 @@ #include "test/UnitTest/ErrnoSetterMatcher.h" #include "test/UnitTest/Test.h" +#include <signal.h> + using __llvm_libc::testing::ErrnoSetterMatcher::Fails; using __llvm_libc::testing::ErrnoSetterMatcher::Succeeds; diff --git a/libc/test/src/signal/sigprocmask_test.cpp b/libc/test/src/signal/sigprocmask_test.cpp index 488f1c5..3c33464 100644 --- a/libc/test/src/signal/sigprocmask_test.cpp +++ b/libc/test/src/signal/sigprocmask_test.cpp @@ -6,7 +6,6 @@ // //===----------------------------------------------------------------------===// -#include "include/signal.h" #include "src/errno/libc_errno.h" #include "src/signal/raise.h" #include "src/signal/sigaddset.h" @@ -16,6 +15,8 @@ #include "test/UnitTest/ErrnoSetterMatcher.h" #include "test/UnitTest/Test.h" +#include <signal.h> + class LlvmLibcSignalTest : public __llvm_libc::testing::Test { sigset_t oldSet; diff --git a/libc/test/src/stdlib/_Exit_test.cpp b/libc/test/src/stdlib/_Exit_test.cpp index e4a55bc..af5cd23 100644 --- a/libc/test/src/stdlib/_Exit_test.cpp +++ b/libc/test/src/stdlib/_Exit_test.cpp @@ -6,11 +6,12 @@ // //===----------------------------------------------------------------------===// -#include "include/stdlib.h" #include "src/stdlib/_Exit.h" #include "src/stdlib/exit.h" #include "test/UnitTest/Test.h" +#include <stdlib.h> + TEST(LlvmLibcStdlib, _Exit) { EXPECT_EXITS([] { __llvm_libc::_Exit(1); }, 1); EXPECT_EXITS([] { __llvm_libc::_Exit(65); }, 65); diff --git a/libc/test/src/stdlib/abort_test.cpp b/libc/test/src/stdlib/abort_test.cpp index cd3a2a1..6e6f1ae 100644 --- a/libc/test/src/stdlib/abort_test.cpp +++ b/libc/test/src/stdlib/abort_test.cpp @@ -6,11 +6,12 @@ // //===----------------------------------------------------------------------===// -#include "include/signal.h" -#include "include/stdlib.h" #include "src/stdlib/abort.h" #include "test/UnitTest/Test.h" +#include <signal.h> +#include <stdlib.h> + TEST(LlvmLibcStdlib, abort) { // -1 matches against any signal, which is necessary for now until // __llvm_libc::abort() unblocks SIGABRT. |