1 //===-- SupportTest.cpp ---------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 #include "lldb/Host/linux/Support.h"
10 #include "llvm/Support/Threading.h"
11 #include "gtest/gtest.h"
13 using namespace lldb_private
;
15 TEST(Support
, getProcFile_Pid
) {
16 auto BufferOrError
= getProcFile(getpid(), "maps");
17 ASSERT_TRUE(BufferOrError
);
18 ASSERT_TRUE(*BufferOrError
);
21 #ifdef LLVM_ENABLE_THREADING
22 TEST(Support
, getProcFile_Tid
) {
23 auto BufferOrError
= getProcFile(getpid(), llvm::get_threadid(), "comm");
24 ASSERT_TRUE(BufferOrError
);
25 ASSERT_TRUE(*BufferOrError
);
27 #endif /*ifdef LLVM_ENABLE_THREADING */