Index: tests/tests_shared/TestsExports.cpp =================================================================== diff -u -r2e23b5892ef4d4bb1ee2c6cde893004a71a11510 -rd77bade63dd20f22326718ebb7170e95f64b77a8 --- tests/tests_shared/TestsExports.cpp (.../TestsExports.cpp) (revision 2e23b5892ef4d4bb1ee2c6cde893004a71a11510) +++ tests/tests_shared/TestsExports.cpp (.../TestsExports.cpp) (revision d77bade63dd20f22326718ebb7170e95f64b77a8) @@ -1,15 +1,73 @@ #include "gtest/gtest.h" #include "gmock/gmock.h" #include +#include +#include #ifdef TESTING +class TFailedOutputPrinter : public ::testing::EmptyTestEventListener +{ + virtual void OnTestStart(const ::testing::TestInfo& test_info) + { + m_strTestName = str(boost::format("%1%.%2%") % test_info.test_case_name() % test_info.name()); + } + + virtual void OnTestPartResult(const ::testing::TestPartResult& test_part_result) + { + if(test_part_result.failed()) + { + char* pszFailureText = NULL; + if(test_part_result.fatally_failed()) + pszFailureText = "FATAL"; + else + pszFailureText = "NON-FATAL"; + + std::string strMsg = test_part_result.message() ? test_part_result.message() : ""; + boost::replace_all(strMsg, "\n", "\n "); + + printf("**[%s FAILURE]** Unit test %s failed\n %s(%ld) : %s\n", + pszFailureText, + m_strTestName.c_str(), + test_part_result.file_name() ? test_part_result.file_name() : "Unknown location", + test_part_result.line_number() < 0 ? 0 : test_part_result.line_number(), + strMsg.c_str()); + } + } + + virtual void OnTestProgramEnd(const ::testing::UnitTest& unit_test) + { + if(unit_test.Failed()) + { + printf("Unit tests execution FAILED (successful: %ld, failed: %ld, elapsed time: %I64d ms)\n>\n", + unit_test.successful_test_count(), + unit_test.failed_test_count(), + unit_test.elapsed_time()); + } + else + { + printf("Unit tests execution succeeded (successful: %ld, failed: %ld, elapsed time: %I64d ms)\n>\n", + unit_test.successful_test_count(), + unit_test.failed_test_count(), + unit_test.elapsed_time()); + } + } + +private: + std::string m_strTestName; +}; + #ifdef _CONSOLE int _tmain(int argc, _TCHAR* argv[]) { testing::InitGoogleMock(&argc, argv); ::testing::FLAGS_gtest_death_test_style = "fast"; ::testing::FLAGS_gtest_print_time = 1; + + ::testing::TestEventListeners& listeners = ::testing::UnitTest::GetInstance()->listeners(); + delete listeners.Release(listeners.default_result_printer()); + listeners.Append(new TFailedOutputPrinter); + return RUN_ALL_TESTS(); } #else @@ -19,6 +77,11 @@ testing::InitGoogleMock(&argc, argv); ::testing::FLAGS_gtest_death_test_style = "fast"; ::testing::FLAGS_gtest_print_time = 1; + + ::testing::TestEventListeners& listeners = ::testing::UnitTest::GetInstance()->listeners(); + delete listeners.Release(listeners.default_result_printer()); + listeners.Append(new TFailedOutputPrinter); + return RUN_ALL_TESTS(); } #endif Index: tools.sln =================================================================== diff -u --- tools.sln (revision 0) +++ tools.sln (revision d77bade63dd20f22326718ebb7170e95f64b77a8) @@ -0,0 +1,74 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rc2lng", "src\rc2lng\rc2lng.vc90.vcproj", "{10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libicpf", "src\libicpf\libicpf.vc90.vcproj", "{5510B933-046F-4F75-8B46-5E8279C8CCDE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_runner", "tests\test_runner\test_runner.vcproj", "{2AF37846-09E7-46EB-83AE-1E4C67742EE7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + Testing Debug|Win32 = Testing Debug|Win32 + Testing Debug|x64 = Testing Debug|x64 + Testing Release|Win32 = Testing Release|Win32 + Testing Release|x64 = Testing Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}.Debug|Win32.ActiveCfg = Debug|Win32 + {10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}.Debug|Win32.Build.0 = Debug|Win32 + {10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}.Debug|x64.ActiveCfg = Debug|x64 + {10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}.Debug|x64.Build.0 = Debug|x64 + {10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}.Release|Win32.ActiveCfg = Release|Win32 + {10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}.Release|Win32.Build.0 = Release|Win32 + {10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}.Release|x64.ActiveCfg = Release|x64 + {10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}.Release|x64.Build.0 = Release|x64 + {10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}.Testing Debug|Win32.ActiveCfg = Testing Debug|Win32 + {10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}.Testing Debug|Win32.Build.0 = Testing Debug|Win32 + {10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}.Testing Debug|x64.ActiveCfg = Testing Debug|x64 + {10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}.Testing Debug|x64.Build.0 = Testing Debug|x64 + {10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}.Testing Release|Win32.ActiveCfg = Testing Release|Win32 + {10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}.Testing Release|Win32.Build.0 = Testing Release|Win32 + {10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}.Testing Release|x64.ActiveCfg = Testing Release|x64 + {10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}.Testing Release|x64.Build.0 = Testing Release|x64 + {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Debug|Win32.ActiveCfg = Debug|Win32 + {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Debug|Win32.Build.0 = Debug|Win32 + {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Debug|x64.ActiveCfg = Debug|x64 + {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Debug|x64.Build.0 = Debug|x64 + {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Release|Win32.ActiveCfg = Release|Win32 + {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Release|Win32.Build.0 = Release|Win32 + {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Release|x64.ActiveCfg = Release|x64 + {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Release|x64.Build.0 = Release|x64 + {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Debug|Win32.ActiveCfg = Testing Debug|Win32 + {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Debug|Win32.Build.0 = Testing Debug|Win32 + {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Debug|x64.ActiveCfg = Testing Debug|x64 + {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Debug|x64.Build.0 = Testing Debug|x64 + {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Release|Win32.ActiveCfg = Testing Release|Win32 + {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Release|Win32.Build.0 = Testing Release|Win32 + {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Release|x64.ActiveCfg = Testing Release|x64 + {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Release|x64.Build.0 = Testing Release|x64 + {2AF37846-09E7-46EB-83AE-1E4C67742EE7}.Debug|Win32.ActiveCfg = Debug|Win32 + {2AF37846-09E7-46EB-83AE-1E4C67742EE7}.Debug|Win32.Build.0 = Debug|Win32 + {2AF37846-09E7-46EB-83AE-1E4C67742EE7}.Debug|x64.ActiveCfg = Debug|x64 + {2AF37846-09E7-46EB-83AE-1E4C67742EE7}.Debug|x64.Build.0 = Debug|x64 + {2AF37846-09E7-46EB-83AE-1E4C67742EE7}.Release|Win32.ActiveCfg = Release|Win32 + {2AF37846-09E7-46EB-83AE-1E4C67742EE7}.Release|Win32.Build.0 = Release|Win32 + {2AF37846-09E7-46EB-83AE-1E4C67742EE7}.Release|x64.ActiveCfg = Release|x64 + {2AF37846-09E7-46EB-83AE-1E4C67742EE7}.Release|x64.Build.0 = Release|x64 + {2AF37846-09E7-46EB-83AE-1E4C67742EE7}.Testing Debug|Win32.ActiveCfg = Testing Debug|Win32 + {2AF37846-09E7-46EB-83AE-1E4C67742EE7}.Testing Debug|Win32.Build.0 = Testing Debug|Win32 + {2AF37846-09E7-46EB-83AE-1E4C67742EE7}.Testing Debug|x64.ActiveCfg = Testing Debug|x64 + {2AF37846-09E7-46EB-83AE-1E4C67742EE7}.Testing Debug|x64.Build.0 = Testing Debug|x64 + {2AF37846-09E7-46EB-83AE-1E4C67742EE7}.Testing Release|Win32.ActiveCfg = Testing Release|Win32 + {2AF37846-09E7-46EB-83AE-1E4C67742EE7}.Testing Release|Win32.Build.0 = Testing Release|Win32 + {2AF37846-09E7-46EB-83AE-1E4C67742EE7}.Testing Release|x64.ActiveCfg = Testing Release|x64 + {2AF37846-09E7-46EB-83AE-1E4C67742EE7}.Testing Release|x64.Build.0 = Testing Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal