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) = ""; 811be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania EXPECT_STREQ(GetAbsolutePathOf(FilePath("test_detail.xml")).c_str(), 821be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania UnitTestOptions::GetAbsolutePathToOutputFile().c_str()); 831be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania} 841be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania 851be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaTEST(XmlOutputTest, GetOutputFileSingleFile) { 861be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania GTEST_FLAG(output) = "xml:filename.abc"; 871be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania EXPECT_STREQ(GetAbsolutePathOf(FilePath("filename.abc")).c_str(), 881be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania UnitTestOptions::GetAbsolutePathToOutputFile().c_str()); 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_ + 9641d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot GetCurrentExecutableName().c_str() + ".xml")).c_str(); 971be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania const String& output_file = UnitTestOptions::GetAbsolutePathToOutputFile(); 9841d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot#if GTEST_OS_WINDOWS 9941d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot EXPECT_STRCASEEQ(expected_output_file.c_str(), output_file.c_str()); 1001be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#else 10141d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot EXPECT_EQ(expected_output_file, output_file.c_str()); 1021be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#endif 1031be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania} 1041be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania 1051be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaTEST(OutputFileHelpersTest, GetCurrentExecutableName) { 10641d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot const std::string exe_str = GetCurrentExecutableName().c_str(); 10741d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot#if GTEST_OS_WINDOWS 10841d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot const bool success = 10941d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot _strcmpi("gtest-options_test", exe_str.c_str()) == 0 || 11041d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot _strcmpi("gtest-options-ex_test", exe_str.c_str()) == 0 || 11141d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot _strcmpi("gtest_all_test", exe_str.c_str()) == 0 || 11241d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot _strcmpi("gtest_dll_test", exe_str.c_str()) == 0; 1131be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#else 1141be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania // TODO(wan@google.com): remove the hard-coded "lt-" prefix when 1151be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania // Chandler Carruth's libtool replacement is ready. 11641d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot const bool success = 11741d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot exe_str == "gtest-options_test" || 11841d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot exe_str == "gtest_all_test" || 11941d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot exe_str == "lt-gtest_all_test" || 12041d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot exe_str == "gtest_dll_test"; 12141d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot#endif // GTEST_OS_WINDOWS 12241d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot if (!success) 12341d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot FAIL() << "GetCurrentExecutableName() returns " << exe_str; 1241be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania} 1251be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania 1261be2c9def7187e4e643c00a31dd9986395795d7dNicolas Cataniaclass XmlOutputChangeDirTest : public Test { 1271be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania protected: 1281be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania virtual void SetUp() { 1291be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania original_working_dir_ = FilePath::GetCurrentDir(); 13041d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot posix::ChDir(".."); 1311be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania // This will make the test fail if run from the root directory. 1321be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania EXPECT_STRNE(original_working_dir_.c_str(), 1331be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania FilePath::GetCurrentDir().c_str()); 1341be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania } 1351be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania 1361be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania virtual void TearDown() { 13741d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot posix::ChDir(original_working_dir_.c_str()); 1381be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania } 1391be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania 1401be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania FilePath original_working_dir_; 1411be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania}; 1421be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania 1431be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaTEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithDefault) { 1441be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania GTEST_FLAG(output) = ""; 1451be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania EXPECT_STREQ(FilePath::ConcatPaths(original_working_dir_, 1461be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania FilePath("test_detail.xml")).c_str(), 1471be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania UnitTestOptions::GetAbsolutePathToOutputFile().c_str()); 1481be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania} 1491be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania 1501be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaTEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithDefaultXML) { 1511be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania GTEST_FLAG(output) = "xml"; 1521be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania EXPECT_STREQ(FilePath::ConcatPaths(original_working_dir_, 1531be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania FilePath("test_detail.xml")).c_str(), 1541be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania UnitTestOptions::GetAbsolutePathToOutputFile().c_str()); 1551be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania} 1561be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania 1571be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaTEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithRelativeFile) { 1581be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania GTEST_FLAG(output) = "xml:filename.abc"; 1591be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania EXPECT_STREQ(FilePath::ConcatPaths(original_working_dir_, 1601be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania FilePath("filename.abc")).c_str(), 1611be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania UnitTestOptions::GetAbsolutePathToOutputFile().c_str()); 1621be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania} 1631be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania 1641be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaTEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithRelativePath) { 16541d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot GTEST_FLAG(output) = "xml:path" GTEST_PATH_SEP_; 16641d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot const std::string expected_output_file = 16741d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot FilePath::ConcatPaths( 16841d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot original_working_dir_, 16941d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot FilePath(std::string("path") + GTEST_PATH_SEP_ + 17041d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot GetCurrentExecutableName().c_str() + ".xml")).c_str(); 1711be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania const String& output_file = UnitTestOptions::GetAbsolutePathToOutputFile(); 17241d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot#if GTEST_OS_WINDOWS 17341d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot EXPECT_STRCASEEQ(expected_output_file.c_str(), output_file.c_str()); 1741be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#else 17541d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot EXPECT_EQ(expected_output_file, output_file.c_str()); 1761be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#endif 1771be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania} 1781be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania 1791be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaTEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithAbsoluteFile) { 1801be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#if GTEST_OS_WINDOWS 1811be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania GTEST_FLAG(output) = "xml:c:\\tmp\\filename.abc"; 1821be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania EXPECT_STREQ(FilePath("c:\\tmp\\filename.abc").c_str(), 1831be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania UnitTestOptions::GetAbsolutePathToOutputFile().c_str()); 1841be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#else 1851be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania GTEST_FLAG(output) ="xml:/tmp/filename.abc"; 1861be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania EXPECT_STREQ(FilePath("/tmp/filename.abc").c_str(), 1871be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania UnitTestOptions::GetAbsolutePathToOutputFile().c_str()); 1881be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#endif 1891be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania} 1901be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania 1911be2c9def7187e4e643c00a31dd9986395795d7dNicolas CataniaTEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithAbsolutePath) { 1921be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#if GTEST_OS_WINDOWS 19341d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot const std::string path = "c:\\tmp\\"; 1941be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#else 19541d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot const std::string path = "/tmp/"; 19641d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot#endif 19741d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot 19841d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot GTEST_FLAG(output) = "xml:" + path; 19941d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot const std::string expected_output_file = 20041d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot path + GetCurrentExecutableName().c_str() + ".xml"; 2011be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania const String& output_file = UnitTestOptions::GetAbsolutePathToOutputFile(); 20241d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot 20341d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot#if GTEST_OS_WINDOWS 20441d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot EXPECT_STRCASEEQ(expected_output_file.c_str(), output_file.c_str()); 20541d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot#else 20641d0579e8de9ef4ff178fc4991043c61a19943f7Brett Chabot EXPECT_EQ(expected_output_file, output_file.c_str()); 2071be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania#endif 2081be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania} 2091be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania 2101be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania} // namespace 2111be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania} // namespace internal 2121be2c9def7187e4e643c00a31dd9986395795d7dNicolas Catania} // namespace testing 213