1 | //===-- SupportTest.cpp ---------------------------------------------------===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #include "lldb/Host/posix/Support.h" |
10 | #include "lldb/Host/aix/Support.h" |
11 | #include "llvm/Support/Threading.h" |
12 | #include "gtest/gtest.h" |
13 | |
14 | using namespace lldb_private; |
15 | |
16 | #ifndef __APPLE__ |
17 | TEST(Support, getProcFile_Pid) { |
18 | auto BufferOrError = getProcFile(pid: getpid(), file: "status" ); |
19 | ASSERT_TRUE(BufferOrError); |
20 | ASSERT_TRUE(*BufferOrError); |
21 | } |
22 | #endif // #ifndef __APPLE__ |
23 | |
24 | #if defined(_AIX) && defined(LLVM_ENABLE_THREADING) |
25 | TEST(Support, getProcFile_Tid) { |
26 | auto BufferOrError = getProcFile(getpid(), llvm::get_threadid(), "lwpstatus" ); |
27 | ASSERT_TRUE(BufferOrError); |
28 | ASSERT_TRUE(*BufferOrError); |
29 | } |
30 | #endif // #ifdef _AIX && LLVM_ENABLE_THREADING |
31 | |