[libc-commits] [libc] fb149e4 - [libc] Use the new style includes for tests

Petr Hosek via libc-commits libc-commits at lists.llvm.org
Fri Jul 7 22:16:00 PDT 2023


Author: Petr Hosek
Date: 2023-07-08T05:15:44Z
New Revision: fb149e4beb04d0e2661c84189635d103263a8fd4

URL: https://github.com/llvm/llvm-project/commit/fb149e4beb04d0e2661c84189635d103263a8fd4
DIFF: https://github.com/llvm/llvm-project/commit/fb149e4beb04d0e2661c84189635d103263a8fd4.diff

LOG: [libc] Use the new style includes for tests

This is a follow up to D154529 covering tests.

Differential Revision: https://reviews.llvm.org/D154746

Added: 
    

Modified: 
    libc/test/src/signal/kill_test.cpp
    libc/test/src/signal/raise_test.cpp
    libc/test/src/signal/sigaddset_test.cpp
    libc/test/src/signal/sigdelset_test.cpp
    libc/test/src/signal/sigfillset_test.cpp
    libc/test/src/signal/signal_test.cpp
    libc/test/src/signal/sigprocmask_test.cpp
    libc/test/src/stdlib/_Exit_test.cpp
    libc/test/src/stdlib/abort_test.cpp

Removed: 
    


################################################################################
diff  --git a/libc/test/src/signal/kill_test.cpp b/libc/test/src/signal/kill_test.cpp
index 9c53f8e3827036..b0c096977f3c9c 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 12c2a269627a17..080541ff2445a0 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 ea5c8c160697c8..dbc0a617f4208e 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 dfaa84d16268f1..80f2459e223a61 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 6b0e172136f3a4..52f1e27aa32903 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 9635e271602490..999933c2f8a424 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 488f1c58ba79f3..3c334642ce0d38 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 e4a55bc29b35d0..af5cd23743f6ea 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 cd3a2a14c1e8b8..6e6f1aeeb91e14 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.


        


More information about the libc-commits mailing list