41 #include "gtest/gtest.h" 43 #if GTEST_OS_WINDOWS_MOBILE 45 #elif GTEST_OS_WINDOWS 47 #endif // GTEST_OS_WINDOWS_MOBILE 54 #define GTEST_IMPLEMENTATION_ 1 55 #include "src/gtest-internal-inl.h" 56 #undef GTEST_IMPLEMENTATION_ 63 FilePath GetAbsolutePathOf(
const FilePath& relative_path) {
69 TEST(XmlOutputTest, GetOutputFormatDefault) {
74 TEST(XmlOutputTest, GetOutputFormat) {
79 TEST(XmlOutputTest, GetOutputFileDefault) {
81 EXPECT_EQ(GetAbsolutePathOf(FilePath(
"test_detail.xml")).
string(),
85 TEST(XmlOutputTest, GetOutputFileSingleFile) {
87 EXPECT_EQ(GetAbsolutePathOf(FilePath(
"filename.abc")).
string(),
91 TEST(XmlOutputTest, GetOutputFileFromDirectoryPath) {
102 EXPECT_EQ(expected_output_file, output_file.c_str());
110 _strcmpi(
"gtest-options_test", exe_str.c_str()) == 0 ||
111 _strcmpi(
"gtest-options-ex_test", exe_str.c_str()) == 0 ||
112 _strcmpi(
"gtest_all_test", exe_str.c_str()) == 0 ||
113 _strcmpi(
"gtest_dll_test", exe_str.c_str()) == 0;
118 exe_str ==
"gtest-options_test" ||
119 exe_str ==
"gtest_all_test" ||
120 exe_str ==
"lt-gtest_all_test" ||
121 exe_str ==
"gtest_dll_test";
122 #endif // GTEST_OS_WINDOWS 124 FAIL() <<
"GetCurrentExecutableName() returns " << exe_str;
127 class XmlOutputChangeDirTest :
public Test {
129 virtual void SetUp() {
137 virtual void TearDown() {
144 TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithDefault) {
147 FilePath(
"test_detail.xml")).
string(),
151 TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithDefaultXML) {
154 FilePath(
"test_detail.xml")).
string(),
158 TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithRelativeFile) {
161 FilePath(
"filename.abc")).
string(),
165 TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithRelativePath) {
177 EXPECT_EQ(expected_output_file, output_file.c_str());
181 TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithAbsoluteFile) {
184 EXPECT_EQ(FilePath(
"c:\\tmp\\filename.abc").
string(),
188 EXPECT_EQ(FilePath(
"/tmp/filename.abc").
string(),
193 TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithAbsolutePath) {
209 EXPECT_EQ(expected_output_file, output_file.c_str());
FilePath original_working_dir_
static FilePath ConcatPaths(const FilePath &directory, const FilePath &relative_path)
#define EXPECT_EQ(val1, val2)
#define EXPECT_STRCASEEQ(s1, s2)
static std::string GetAbsolutePathToOutputFile()
int ChDir(const char *dir)
TEST_F(ListenerTest, DoesFoo)
#define EXPECT_STREQ(s1, s2)
static std::string GetOutputFormat()
const std::string & string() const
GTEST_API_ FilePath GetCurrentExecutableName()
static FilePath GetCurrentDir()
#define EXPECT_NE(val1, val2)
TEST(IsXDigitTest, WorksForNarrowAscii)