From 2be8fa6ecf1fdd5e346dcf0442e8eac76aeb4b98 Mon Sep 17 00:00:00 2001 From: srz-zumix Date: Fri, 7 Nov 2014 09:38:30 +0900 Subject: [PATCH] update r738 --- .travis.yml | 6 -- doc/Doxyfile | 2 +- include/impl/iutest_default_xml_generator.ipp | 2 + include/iutest_ver.hpp | 4 +- test/CommonMakefile.in | 1 + test/iutest_output_xml_invalid_path_tests.cpp | 65 +++++++++++++++++++ 6 files changed, 71 insertions(+), 9 deletions(-) create mode 100644 test/iutest_output_xml_invalid_path_tests.cpp diff --git a/.travis.yml b/.travis.yml index e8bf9a404c..e19bbbfe78 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,10 +25,6 @@ install: # lcov - if [ "${USE_COVERAGE}" = 'lcov' ]; then sudo apt-get install lcov rubygems; fi - if [ "${USE_COVERAGE}" = 'lcov' ]; then gem install lcoveralls; fi - # gtest - - if [ "${USE_GTEST}" = '1' ]; then sudo apt-get -qq install cmake; fi - - if [ "${USE_GTEST}" = '1' ]; then sudo apt-get -qq install libgtest-dev; fi - - if [ "${USE_GTEST}" = '1' ]; then cd /usr/src/gtest && sudo cmake . && sudo cmake --build . && sudo mv libg* /usr/local/lib/; cd -; fi script: - cd ./test @@ -65,8 +61,6 @@ matrix: env: USE_FUSE=fuse_min - compiler: gcc env: USE_FUSE=fuse_min STDFLAG=-std=c++98 - - compiler: gcc - env: USE_GTEST=1 - compiler: gcc env: COVERITY_SCAN=1 addons: diff --git a/doc/Doxyfile b/doc/Doxyfile index 2a93fed962..cbb2d46d9e 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = iutest # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.10.99.36 +PROJECT_NUMBER = 1.10.99.37 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/include/impl/iutest_default_xml_generator.ipp b/include/impl/iutest_default_xml_generator.ipp index 805bc13d7b..b3beadd2f5 100644 --- a/include/impl/iutest_default_xml_generator.ipp +++ b/include/impl/iutest_default_xml_generator.ipp @@ -270,6 +270,8 @@ IUTEST_IPP_INLINE bool DefaultXmlGeneratorListener::FileOpen(const char* path) { fprintf(stderr, "Unable to open file \"%s\".\n", m_output_path.c_str()); fflush(stderr); + detail::IFileSystem::Free(m_fp); + m_fp = NULL; return false; } return true; diff --git a/include/iutest_ver.hpp b/include/iutest_ver.hpp index c69ebb5744..c6b1722b06 100644 --- a/include/iutest_ver.hpp +++ b/include/iutest_ver.hpp @@ -17,11 +17,11 @@ //====================================================================== // define -#define IUTEST_VER 0x01109936u //!< iutest version 1.10.99.36 +#define IUTEST_VER 0x01109937u //!< iutest version 1.10.99.37 #define IUTEST_MAJORVER 0x01u //!< Major Version #define IUTEST_MINORVER 0x10u //!< Minor Version #define IUTEST_BUILD 0x99u //!< Build -#define IUTEST_REVISION 0x36u //!< Revision +#define IUTEST_REVISION 0x37u //!< Revision /** * @mainpage diff --git a/test/CommonMakefile.in b/test/CommonMakefile.in index 5620d64ab9..f377735aaf 100644 --- a/test/CommonMakefile.in +++ b/test/CommonMakefile.in @@ -100,6 +100,7 @@ TARGETS_IUTEST_ONLY = \ iutest_env_var_tests \ iutest_env_var_gtest_tests \ iutest_ostream_formatter_tests \ + iutest_output_xml_invalid_path_tests \ iutest_tap_printer_listener_tests \ iutest_type_param_tests_strict \ iutest_unit_tests \ diff --git a/test/iutest_output_xml_invalid_path_tests.cpp b/test/iutest_output_xml_invalid_path_tests.cpp new file mode 100644 index 0000000000..5647decbf5 --- /dev/null +++ b/test/iutest_output_xml_invalid_path_tests.cpp @@ -0,0 +1,65 @@ +//====================================================================== +//----------------------------------------------------------------------- +/** + * @file iutest_output_xml_tests.cpp + * @brief xml 出力対応テスト + * + * @author t.shirayanagi + * @par copyright + * Copyright (C) 2013-2014, Takazumi Shirayanagi\n + * This software is released under the new BSD License, + * see LICENSE +*/ +//----------------------------------------------------------------------- +//====================================================================== + +//====================================================================== +// include +#include "iutest.hpp" + +#if IUTEST_HAS_STREAMCAPTURE + +::iutest::detail::IUStreamCapture stderr_capture(stderr); + +#endif + +#if !defined(IUTEST_USE_GTEST) +# define OUTPUT_XML_TEST 1 +#else +# define OUTPUT_XML_TEST 0 +#endif + +IUTEST(Foo, Bar) +{ + IUTEST_ASSERT_EQ(3, 3); +} + +#ifdef UNICODE +int wmain(int argc, wchar_t* argv[]) +#else +int main(int argc, char* argv[]) +#endif +{ +#if OUTPUT_XML_TEST + IUTEST_INIT(&argc, argv); + + ::iutest::IUTEST_FLAG(output) = "xml:invalid_path?/test.xml"; + + { + const int ret = IUTEST_RUN_ALL_TESTS(); + + if( ret != 0 ) return 1; +#if IUTEST_HAS_STREAMCAPTURE && IUTEST_HAS_ASSERTION_RETURN + IUTEST_ASSERT_STRIN("Unable to open file \"invalid_path?/test.xml\".", stderr_capture.GetStreamString()) + << ::iutest::AssertionReturn(1); +#endif + } + + printf("*** Successful ***\n"); +#else + (void)argc; + (void)argv; + printf("*** OUTPUT_XML_TEST=0 ***\n"); +#endif + return 0; +}