MCPcopy Create free account
hub / github.com/BVLC/caffe / GetAbsolutePathToOutputFile

Method GetAbsolutePathToOutputFile

src/gtest/gtest-all.cpp:1700–1729  ·  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

1698// Returns the name of the requested output file, or the default if none
1699// was explicitly specified.
1700String UnitTestOptions::GetAbsolutePathToOutputFile() {
1701 const char* const gtest_output_flag = GTEST_FLAG(output).c_str();
1702 if (gtest_output_flag == NULL)
1703 return String("");
1704
1705 const char* const colon = strchr(gtest_output_flag, ':');
1706 if (colon == NULL)
1707 return String(internal::FilePath::ConcatPaths(
1708 internal::FilePath(
1709 UnitTest::GetInstance()->original_working_dir()),
1710 internal::FilePath(kDefaultOutputFile)).ToString() );
1711
1712 internal::FilePath output_name(colon + 1);
1713 if (!output_name.IsAbsolutePath())
1714 // TODO(wan@google.com): on Windows \some\path is not an absolute
1715 // path (as its meaning depends on the current drive), yet the
1716 // following logic for turning it into an absolute path is wrong.
1717 // Fix it.
1718 output_name = internal::FilePath::ConcatPaths(
1719 internal::FilePath(UnitTest::GetInstance()->original_working_dir()),
1720 internal::FilePath(colon + 1));
1721
1722 if (!output_name.IsDirectory())
1723 return output_name.ToString();
1724
1725 internal::FilePath result(internal::FilePath::GenerateUniqueFileName(
1726 output_name, internal::GetCurrentExecutableName(),
1727 GetOutputFormat().c_str()));
1728 return result.ToString();
1729}
1730
1731// Returns true iff the wildcard pattern matches the string. The
1732// first ':' or '\0' character in pattern marks the end of it.

Callers

nothing calls this directly

Calls 6

FilePathFunction · 0.85
GetCurrentExecutableNameFunction · 0.85
original_working_dirMethod · 0.80
IsAbsolutePathMethod · 0.80
IsDirectoryMethod · 0.80
StringFunction · 0.70

Tested by

no test coverage detected