1 //===-- TestBase.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 //===----------------------------------------------------------------------===//
12 using namespace llgs_tests
;
15 std::string
TestBase::getLogFileName() {
16 const auto *test_info
=
17 ::testing::UnitTest::GetInstance()->current_test_info();
20 const char *Dir
= getenv("LOG_FILE_DIRECTORY");
24 if (!llvm::sys::fs::is_directory(Dir
)) {
25 GTEST_LOG_(WARNING
) << "Cannot access log directory: " << Dir
;
29 SmallString
<64> DirStr(Dir
);
30 sys::path::append(DirStr
, std::string("server-") +
31 test_info
->test_case_name() + "-" +
32 test_info
->name() + ".log");
33 return std::string(DirStr
.str());