1*7e437f8fSPavel Labath //===-- SupportTest.cpp -----------------------------------------*- C++ -*-===// 2*7e437f8fSPavel Labath // 3*7e437f8fSPavel Labath // The LLVM Compiler Infrastructure 4*7e437f8fSPavel Labath // 5*7e437f8fSPavel Labath // This file is distributed under the University of Illinois Open Source 6*7e437f8fSPavel Labath // License. See LICENSE.TXT for details. 7*7e437f8fSPavel Labath // 8*7e437f8fSPavel Labath //===----------------------------------------------------------------------===// 9*7e437f8fSPavel Labath 10*7e437f8fSPavel Labath #include "lldb/Host/linux/Support.h" 11*7e437f8fSPavel Labath #include "llvm/Support/Threading.h" 12*7e437f8fSPavel Labath #include "gtest/gtest.h" 13*7e437f8fSPavel Labath 14*7e437f8fSPavel Labath using namespace lldb_private; 15*7e437f8fSPavel Labath 16*7e437f8fSPavel Labath TEST(Support, getProcFile_Pid) { 17*7e437f8fSPavel Labath auto BufferOrError = getProcFile(getpid(), "maps"); 18*7e437f8fSPavel Labath ASSERT_TRUE(BufferOrError); 19*7e437f8fSPavel Labath ASSERT_TRUE(*BufferOrError); 20*7e437f8fSPavel Labath } 21*7e437f8fSPavel Labath 22*7e437f8fSPavel Labath TEST(Support, getProcFile_Tid) { 23*7e437f8fSPavel Labath auto BufferOrError = getProcFile(getpid(), llvm::get_threadid(), "comm"); 24*7e437f8fSPavel Labath ASSERT_TRUE(BufferOrError); 25*7e437f8fSPavel Labath ASSERT_TRUE(*BufferOrError); 26*7e437f8fSPavel Labath } 27