42#if GTEST_OS_WINDOWS_MOBILE
55FilePath GetAbsolutePathOf(
const FilePath& relative_path) {
61TEST(XmlOutputTest, GetOutputFormatDefault) {
66TEST(XmlOutputTest, GetOutputFormat) {
71TEST(XmlOutputTest, GetOutputFileDefault) {
73 EXPECT_EQ(GetAbsolutePathOf(FilePath(
"test_detail.xml")).
string(),
77TEST(XmlOutputTest, GetOutputFileSingleFile) {
79 EXPECT_EQ(GetAbsolutePathOf(FilePath(
"filename.abc")).
string(),
83TEST(XmlOutputTest, GetOutputFileFromDirectoryPath) {
85 const std::string expected_output_file =
89 const std::string& output_file =
94 EXPECT_EQ(expected_output_file, output_file.c_str());
102 _strcmpi(
"gtest-options_test", exe_str.c_str()) == 0 ||
103 _strcmpi(
"gtest-options-ex_test", exe_str.c_str()) == 0 ||
104 _strcmpi(
"gtest_all_test", exe_str.c_str()) == 0 ||
105 _strcmpi(
"gtest_dll_test", exe_str.c_str()) == 0;
106#elif GTEST_OS_FUCHSIA
107 const bool success = exe_str ==
"app";
112 exe_str ==
"gtest-options_test" ||
113 exe_str ==
"gtest_all_test" ||
114 exe_str ==
"lt-gtest_all_test" ||
115 exe_str ==
"gtest_dll_test";
118 FAIL() <<
"GetCurrentExecutableName() returns " << exe_str;
123class XmlOutputChangeDirTest :
public Test {
125 virtual void SetUp() {
133 virtual void TearDown() {
140TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithDefault) {
143 FilePath(
"test_detail.xml")).
string(),
147TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithDefaultXML) {
150 FilePath(
"test_detail.xml")).
string(),
154TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithRelativeFile) {
157 FilePath(
"filename.abc")).
string(),
161TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithRelativePath) {
163 const std::string expected_output_file =
168 const std::string& output_file =
173 EXPECT_EQ(expected_output_file, output_file.c_str());
177TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithAbsoluteFile) {
179 GTEST_FLAG(output) =
"xml:c:\\tmp\\filename.abc";
180 EXPECT_EQ(FilePath(
"c:\\tmp\\filename.abc").
string(),
184 EXPECT_EQ(FilePath(
"/tmp/filename.abc").
string(),
189TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithAbsolutePath) {
191 const std::string path =
"c:\\tmp\\";
193 const std::string path =
"/tmp/";
197 const std::string expected_output_file =
199 const std::string& output_file =
205 EXPECT_EQ(expected_output_file, output_file.c_str());
const std::string & string() const
static FilePath GetCurrentDir()
static FilePath ConcatPaths(const FilePath &directory, const FilePath &relative_path)
static std::string GetAbsolutePathToOutputFile()
static std::string GetOutputFormat()
FilePath original_working_dir_
#define TEST_F(test_fixture, test_name)
#define EXPECT_EQ(val1, val2)
#define EXPECT_NE(val1, val2)
#define EXPECT_STRCASEEQ(s1, s2)
#define EXPECT_STREQ(s1, s2)
#define TEST(test_case_name, test_name)
int ChDir(const char *dir)
GTEST_API_ FilePath GetCurrentExecutableName()