11be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// Copyright 2008, Google Inc.
21be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// All rights reserved.
31be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania//
41be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// Redistribution and use in source and binary forms, with or without
51be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// modification, are permitted provided that the following conditions are
61be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// met:
71be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania//
81be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania//     * Redistributions of source code must retain the above copyright
91be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// notice, this list of conditions and the following disclaimer.
101be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania//     * Redistributions in binary form must reproduce the above
111be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// copyright notice, this list of conditions and the following disclaimer
121be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// in the documentation and/or other materials provided with the
131be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// distribution.
141be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania//     * Neither the name of Google Inc. nor the names of its
151be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// contributors may be used to endorse or promote products derived from
161be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// this software without specific prior written permission.
171be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania//
181be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
191be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
201be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
211be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
221be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
231be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
241be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
251be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
261be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
271be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
281be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
291be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania//
301be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// Authors: keith.ray@gmail.com (Keith Ray)
311be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania//
321be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// Google Test UnitTestOptions tests
331be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania//
341be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// This file tests classes and functions used internally by
351be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// Google Test.  They are subject to change without notice.
361be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania//
371be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// This file is #included from gtest.cc, to avoid changing build or
381be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// make-files on Windows and other platforms. Do not #include this file
391be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// anywhere else!
401be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
4141d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot#include "gtest/gtest.h"
421be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
4341d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot#if GTEST_OS_WINDOWS_MOBILE
4441d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot# include <windows.h>
451be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#elif GTEST_OS_WINDOWS
4641d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot# include <direct.h>
4741d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot#endif  // GTEST_OS_WINDOWS_MOBILE
481be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
491be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// Indicates that this translation unit is part of Google Test's
501be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// implementation.  It must come before gtest-internal-inl.h is
511be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// included, or there will be a compiler error.  This trick is to
521be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// prevent a user from accidentally including gtest-internal-inl.h in
531be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// his code.
541be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#define GTEST_IMPLEMENTATION_ 1
551be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#include "src/gtest-internal-inl.h"
561be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#undef GTEST_IMPLEMENTATION_
571be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
581be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catanianamespace testing {
591be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catanianamespace internal {
601be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catanianamespace {
611be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
621be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// Turns the given relative path into an absolute path.
631be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaFilePath GetAbsolutePathOf(const FilePath& relative_path) {
641be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  return FilePath::ConcatPaths(FilePath::GetCurrentDir(), relative_path);
651be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania}
661be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
671be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania// Testing UnitTestOptions::GetOutputFormat/GetOutputFile.
681be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
691be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaTEST(XmlOutputTest, GetOutputFormatDefault) {
701be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  GTEST_FLAG(output) = "";
711be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  EXPECT_STREQ("", UnitTestOptions::GetOutputFormat().c_str());
721be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania}
731be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
741be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaTEST(XmlOutputTest, GetOutputFormat) {
751be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  GTEST_FLAG(output) = "xml:filename";
761be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  EXPECT_STREQ("xml", UnitTestOptions::GetOutputFormat().c_str());
771be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania}
781be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
791be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaTEST(XmlOutputTest, GetOutputFileDefault) {
801be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  GTEST_FLAG(output) = "";
81fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes  EXPECT_EQ(GetAbsolutePathOf(FilePath("test_detail.xml")).string(),
82fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes            UnitTestOptions::GetAbsolutePathToOutputFile());
831be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania}
841be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
851be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaTEST(XmlOutputTest, GetOutputFileSingleFile) {
861be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  GTEST_FLAG(output) = "xml:filename.abc";
87fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes  EXPECT_EQ(GetAbsolutePathOf(FilePath("filename.abc")).string(),
88fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes            UnitTestOptions::GetAbsolutePathToOutputFile());
891be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania}
901be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
911be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaTEST(XmlOutputTest, GetOutputFileFromDirectoryPath) {
9241d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot  GTEST_FLAG(output) = "xml:path" GTEST_PATH_SEP_;
9341d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot  const std::string expected_output_file =
9441d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot      GetAbsolutePathOf(
9541d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot          FilePath(std::string("path") + GTEST_PATH_SEP_ +
96fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes                   GetCurrentExecutableName().string() + ".xml")).string();
97fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes  const std::string& output_file =
98fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes      UnitTestOptions::GetAbsolutePathToOutputFile();
9941d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot#if GTEST_OS_WINDOWS
10041d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot  EXPECT_STRCASEEQ(expected_output_file.c_str(), output_file.c_str());
1011be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#else
10241d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot  EXPECT_EQ(expected_output_file, output_file.c_str());
1031be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#endif
1041be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania}
1051be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1061be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaTEST(OutputFileHelpersTest, GetCurrentExecutableName) {
107fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes  const std::string exe_str = GetCurrentExecutableName().string();
10841d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot#if GTEST_OS_WINDOWS
10941d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot  const bool success =
11041d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot      _strcmpi("gtest-options_test", exe_str.c_str()) == 0 ||
11141d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot      _strcmpi("gtest-options-ex_test", exe_str.c_str()) == 0 ||
11241d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot      _strcmpi("gtest_all_test", exe_str.c_str()) == 0 ||
11341d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot      _strcmpi("gtest_dll_test", exe_str.c_str()) == 0;
1141be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#else
1151be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  // TODO(wan@google.com): remove the hard-coded "lt-" prefix when
1161be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  //   Chandler Carruth's libtool replacement is ready.
11741d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot  const bool success =
11841d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot      exe_str == "gtest-options_test" ||
11941d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot      exe_str == "gtest_all_test" ||
12041d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot      exe_str == "lt-gtest_all_test" ||
12141d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot      exe_str == "gtest_dll_test";
12241d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot#endif  // GTEST_OS_WINDOWS
12341d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot  if (!success)
12441d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot    FAIL() << "GetCurrentExecutableName() returns " << exe_str;
1251be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania}
1261be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1271be2c9def7187e4e643c00a31dd9986395795d7dNicolas Cataniaclass XmlOutputChangeDirTest : public Test {
1281be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania protected:
1291be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  virtual void SetUp() {
1301be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    original_working_dir_ = FilePath::GetCurrentDir();
13141d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot    posix::ChDir("..");
1321be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania    // This will make the test fail if run from the root directory.
133fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes    EXPECT_NE(original_working_dir_.string(),
134fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes              FilePath::GetCurrentDir().string());
1351be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  }
1361be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1371be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  virtual void TearDown() {
138fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes    posix::ChDir(original_working_dir_.string().c_str());
1391be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  }
1401be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1411be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  FilePath original_working_dir_;
1421be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania};
1431be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1441be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaTEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithDefault) {
1451be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  GTEST_FLAG(output) = "";
146fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes  EXPECT_EQ(FilePath::ConcatPaths(original_working_dir_,
147fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes                                  FilePath("test_detail.xml")).string(),
148fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes            UnitTestOptions::GetAbsolutePathToOutputFile());
1491be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania}
1501be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1511be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaTEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithDefaultXML) {
1521be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  GTEST_FLAG(output) = "xml";
153fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes  EXPECT_EQ(FilePath::ConcatPaths(original_working_dir_,
154fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes                                  FilePath("test_detail.xml")).string(),
155fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes            UnitTestOptions::GetAbsolutePathToOutputFile());
1561be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania}
1571be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1581be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaTEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithRelativeFile) {
1591be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  GTEST_FLAG(output) = "xml:filename.abc";
160fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes  EXPECT_EQ(FilePath::ConcatPaths(original_working_dir_,
161fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes                                  FilePath("filename.abc")).string(),
162fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes            UnitTestOptions::GetAbsolutePathToOutputFile());
1631be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania}
1641be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1651be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaTEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithRelativePath) {
16641d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot  GTEST_FLAG(output) = "xml:path" GTEST_PATH_SEP_;
16741d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot  const std::string expected_output_file =
16841d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot      FilePath::ConcatPaths(
16941d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot          original_working_dir_,
17041d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot          FilePath(std::string("path") + GTEST_PATH_SEP_ +
171fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes                   GetCurrentExecutableName().string() + ".xml")).string();
172fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes  const std::string& output_file =
173fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes      UnitTestOptions::GetAbsolutePathToOutputFile();
17441d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot#if GTEST_OS_WINDOWS
17541d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot  EXPECT_STRCASEEQ(expected_output_file.c_str(), output_file.c_str());
1761be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#else
17741d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot  EXPECT_EQ(expected_output_file, output_file.c_str());
1781be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#endif
1791be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania}
1801be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1811be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaTEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithAbsoluteFile) {
1821be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#if GTEST_OS_WINDOWS
1831be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  GTEST_FLAG(output) = "xml:c:\\tmp\\filename.abc";
184fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes  EXPECT_EQ(FilePath("c:\\tmp\\filename.abc").string(),
185fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes            UnitTestOptions::GetAbsolutePathToOutputFile());
1861be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#else
1871be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania  GTEST_FLAG(output) ="xml:/tmp/filename.abc";
188fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes  EXPECT_EQ(FilePath("/tmp/filename.abc").string(),
189fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes            UnitTestOptions::GetAbsolutePathToOutputFile());
1901be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#endif
1911be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania}
1921be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
1931be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaTEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithAbsolutePath) {
1941be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#if GTEST_OS_WINDOWS
19541d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot  const std::string path = "c:\\tmp\\";
1961be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#else
19741d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot  const std::string path = "/tmp/";
19841d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot#endif
19941d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot
20041d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot  GTEST_FLAG(output) = "xml:" + path;
20141d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot  const std::string expected_output_file =
202fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes      path + GetCurrentExecutableName().string() + ".xml";
203fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes  const std::string& output_file =
204fc2de66453b0669c09eaca643b07d34443858b6fElliott Hughes      UnitTestOptions::GetAbsolutePathToOutputFile();
20541d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot
20641d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot#if GTEST_OS_WINDOWS
20741d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot  EXPECT_STRCASEEQ(expected_output_file.c_str(), output_file.c_str());
20841d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot#else
20941d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot  EXPECT_EQ(expected_output_file, output_file.c_str());
2101be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#endif
2111be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania}
2121be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania
2131be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania}  // namespace
2141be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania}  // namespace internal
2151be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania}  // namespace testing
216