17e437f8fSPavel Labath //===-- SupportTest.cpp -----------------------------------------*- C++ -*-===//
27e437f8fSPavel Labath //
3*2946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*2946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
5*2946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
67e437f8fSPavel Labath //
77e437f8fSPavel Labath //===----------------------------------------------------------------------===//
87e437f8fSPavel Labath 
97e437f8fSPavel Labath #include "lldb/Host/linux/Support.h"
107e437f8fSPavel Labath #include "llvm/Support/Threading.h"
117e437f8fSPavel Labath #include "gtest/gtest.h"
127e437f8fSPavel Labath 
137e437f8fSPavel Labath using namespace lldb_private;
147e437f8fSPavel Labath 
157e437f8fSPavel Labath TEST(Support, getProcFile_Pid) {
167e437f8fSPavel Labath   auto BufferOrError = getProcFile(getpid(), "maps");
177e437f8fSPavel Labath   ASSERT_TRUE(BufferOrError);
187e437f8fSPavel Labath   ASSERT_TRUE(*BufferOrError);
197e437f8fSPavel Labath }
207e437f8fSPavel Labath 
217e437f8fSPavel Labath TEST(Support, getProcFile_Tid) {
227e437f8fSPavel Labath   auto BufferOrError = getProcFile(getpid(), llvm::get_threadid(), "comm");
237e437f8fSPavel Labath   ASSERT_TRUE(BufferOrError);
247e437f8fSPavel Labath   ASSERT_TRUE(*BufferOrError);
257e437f8fSPavel Labath }
26