MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / GetAbsolutePathToOutputFile

Method GetAbsolutePathToOutputFile

source/test/gtest/src/gtest.cc:658–685  ·  view source on GitHub ↗

Returns the name of the requested output file, or the default if none was explicitly specified.

Source from the content-addressed store, hash-verified

656// Returns the name of the requested output file, or the default if none
657// was explicitly specified.
658std::string UnitTestOptions::GetAbsolutePathToOutputFile() {
659 std::string s = GTEST_FLAG_GET(output);
660 const char* const gtest_output_flag = s.c_str();
661
662 std::string format = GetOutputFormat();
663 if (format.empty()) format = std::string(kDefaultOutputFormat);
664
665 const char* const colon = strchr(gtest_output_flag, ':');
666 if (colon == nullptr)
667 return internal::FilePath::MakeFileName(
668 internal::FilePath(
669 UnitTest::GetInstance()->original_working_dir()),
670 internal::FilePath(kDefaultOutputFile), 0, format.c_str())
671 .string();
672
673 internal::FilePath output_name(colon + 1);
674 if (!output_name.IsAbsolutePath())
675 output_name = internal::FilePath::ConcatPaths(
676 internal::FilePath(UnitTest::GetInstance()->original_working_dir()),
677 internal::FilePath(colon + 1));
678
679 if (!output_name.IsDirectory()) return output_name.string();
680
681 internal::FilePath result(internal::FilePath::GenerateUniqueFileName(
682 output_name, internal::GetCurrentExecutableName(),
683 GetOutputFormat().c_str()));
684 return result.string();
685}
686#endif // GTEST_HAS_FILE_SYSTEM
687
688// Returns true if and only if the wildcard pattern matches the string. Each

Callers

nothing calls this directly

Calls 9

stringFunction · 0.85
FilePathFunction · 0.85
GetCurrentExecutableNameFunction · 0.85
original_working_dirMethod · 0.80
IsAbsolutePathMethod · 0.80
IsDirectoryMethod · 0.80
c_strMethod · 0.45
emptyMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected