• R/O
  • SSH
  • HTTPS

iutest: Commit


Commit MetaInfo

Revision1337 (tree)
Time2018-08-27 22:33:16
Authorsrz_zumix

Log Message

Merge remote-tracking branch 'origin/develop'

git@9915eed84c2ba7a046b43e2f33681d923f1196e5
https://github.com/srz-zumix/iutest/commit/9915eed84c2ba7a046b43e2f33681d923f1196e5

Change Summary

Incremental Difference

--- trunk/tools/wandbox/iuwandbox.py (revision 1336)
+++ trunk/tools/wandbox/iuwandbox.py (revision 1337)
@@ -41,7 +41,7 @@
4141 '-v',
4242 '--version',
4343 action='version',
44- version=u'%(prog)s version 6.1'
44+ version=u'%(prog)s version 6.2'
4545 )
4646 parser.add_argument(
4747 '--list-compiler',
@@ -489,6 +489,8 @@
489489 colist.extend(re.split('\s(?=-)', x.strip('"')))
490490 if options.iutest_use_main:
491491 colist.append('-DIUTEST_USE_MAIN')
492+ if '-D__WANDBOX__' not in colist:
493+ colist.append('-D__WANDBOX__')
492494 return colist
493495
494496
--- trunk/tools/wandbox/tests/test_iuwandbox.py (revision 1336)
+++ trunk/tools/wandbox/tests/test_iuwandbox.py (revision 1337)
@@ -30,6 +30,8 @@
3030 test_opt_nomain = test_opt_default
3131 test_opt = ['-f"-DIUTEST_USE_MAIN"']
3232 test_opt.extend(test_opt_default)
33+test_opt_verbose = ['--verbose']
34+test_opt_dryrun = ['--dryrun']
3335
3436
3537 def eprint(*args, **kwargs):
@@ -112,6 +114,19 @@
112114 self.assertEqual(cm.exception.code, 0, self.capture.getvalue())
113115 self.assertRegex(self.capture.getvalue(), '.*OK.*')
114116
117+ def test_define_wandbox(self):
118+ sys.argv[1:] = [test_src]
119+ sys.argv.extend(test_opt)
120+ sys.argv.extend(test_opt_dryrun)
121+ sys.argv.extend(test_opt_verbose)
122+ sys.argv.append('-f"-DTEST"')
123+ with self.assertRaises(SystemExit) as cm:
124+ iuwandbox.main()
125+ self.dump()
126+ self.assertEqual(cm.exception.code, 0, self.capture.getvalue())
127+ self.assertRegex(self.capture.getvalue(), '.*-D__WNADBOX__.*')
128+ self.assertRegex(self.capture.getvalue(), '.*-DTEST.*')
129+
115130 def test_boosttest_workarround(self):
116131 sys.argv[1:] = [test_src]
117132 sys.argv.extend(test_opt_nomain)
--- trunk/test/feature_spec_tests.cpp (revision 0)
+++ trunk/test/feature_spec_tests.cpp (revision 1337)
@@ -0,0 +1,92 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file feature_spec_tests.cpp
5+ * @brief --feature --spce test
6+ *
7+ * @author t.shirayanagi
8+ * @par copyright
9+ * Copyright (C) 2018, Takazumi Shirayanagi\n
10+ * This software is released under the new BSD License,
11+ * see LICENSE
12+*/
13+//-----------------------------------------------------------------------
14+//======================================================================
15+
16+//======================================================================
17+// include
18+#include "iutest.hpp"
19+#include "logger_tests.hpp"
20+
21+TestLogger logger;
22+
23+#ifdef UNICODE
24+# define DECAL_ARGV(cmd) const wchar_t* targv[] = { argv[0], L cmd }
25+#else
26+# define DECAL_ARGV(cmd) const char* targv[] = { argv[0], cmd }
27+#endif
28+
29+#ifdef UNICODE
30+# define DECAL_ARGV2(cmd1, cmd2) const wchar_t* targv[] = { argv[0], L cmd1, L cmd2 }
31+#else
32+# define DECAL_ARGV2(cmd1, cmd2) const char* targv[] = { argv[0], cmd1, cmd2 }
33+#endif
34+
35+#ifdef UNICODE
36+int wmain(int argc, wchar_t* argv[])
37+#else
38+int main(int argc, char* argv[])
39+#endif
40+{
41+ (void)argc;
42+ (void)argv;
43+#if !defined(IUTEST_USE_GTEST)
44+ ::iutest::detail::iuConsole::SetLogger(&logger);
45+
46+ {
47+ int targc = 2;
48+ DECAL_ARGV("--feature");
49+ IUTEST_INIT(&targc, targv);
50+ IUTEST_EXPECT_TRUE(::iutest::TestFlag::IsEnableFlag(::iutest::TestFlag::SHOW_FEATURE));
51+ logger.clear();
52+ const int ret = IUTEST_RUN_ALL_TESTS();
53+#if IUTEST_HAS_ASSERTION_RETURN
54+ IUTEST_ASSERT_STRIN ("IUTEST_HAS_TYPED_TEST_P", logger.c_str()) << ::iutest::AssertionReturn<int>(1);
55+ IUTEST_ASSERT_STRNOTIN("IUTEST_HAS_TUPLE", logger.c_str()) << ::iutest::AssertionReturn<int>(1);
56+#endif
57+ if( ret != 0 ) return 1;
58+ }
59+
60+ {
61+ int targc = 2;
62+ DECAL_ARGV("--spec");
63+ IUTEST_INIT(&targc, targv);
64+ IUTEST_EXPECT_TRUE(::iutest::TestFlag::IsEnableFlag(::iutest::TestFlag::SHOW_SPEC));
65+ logger.clear();
66+ const int ret = IUTEST_RUN_ALL_TESTS();
67+#if IUTEST_HAS_ASSERTION_RETURN
68+ IUTEST_ASSERT_STRNOTIN("IUTEST_HAS_TYPED_TEST_P", logger.c_str()) << ::iutest::AssertionReturn<int>(1);
69+ IUTEST_ASSERT_STRIN ("IUTEST_HAS_TUPLE", logger.c_str()) << ::iutest::AssertionReturn<int>(1);
70+#endif
71+ if( ret != 0 ) return 1;
72+ }
73+
74+ {
75+ int targc = 3;
76+ DECAL_ARGV2("--feature", "--spec");
77+ IUTEST_INIT(&targc, targv);
78+ IUTEST_EXPECT_TRUE(::iutest::TestFlag::IsEnableFlag(::iutest::TestFlag::SHOW_FEATURE));
79+ IUTEST_EXPECT_TRUE(::iutest::TestFlag::IsEnableFlag(::iutest::TestFlag::SHOW_SPEC));
80+ logger.clear();
81+ const int ret = IUTEST_RUN_ALL_TESTS();
82+#if IUTEST_HAS_ASSERTION_RETURN
83+ IUTEST_ASSERT_STRIN("IUTEST_HAS_TYPED_TEST_P", logger.c_str()) << ::iutest::AssertionReturn<int>(1);
84+ IUTEST_ASSERT_STRIN("IUTEST_HAS_TUPLE", logger.c_str()) << ::iutest::AssertionReturn<int>(1);
85+#endif
86+ if( ret != 0 ) return 1;
87+ }
88+#endif
89+ printf("*** Successful ***\n");
90+ return 0;
91+}
92+
--- trunk/test/CommonMakefile.in (revision 1336)
+++ trunk/test/CommonMakefile.in (revision 1337)
@@ -135,6 +135,7 @@
135135 default_printer_listener_tests \
136136 env_var_tests \
137137 exit_tests \
138+ feature_spec_tests \
138139 filter_file_invalid_path_tests \
139140 filter_file_syntax_tests \
140141 filter_file_tests \
--- trunk/include/tr1/iutest_vc_unittest.hpp (revision 1336)
+++ trunk/include/tr1/iutest_vc_unittest.hpp (revision 1337)
@@ -254,7 +254,7 @@
254254 ::testing::TestEventListener* GetTestEventListenerRepeater(::testing::TestEventListeners& listeners)
255255 {
256256 #if defined(IUTEST_USE_GTEST)
257- return reinterpret_cast<::testing::TestEventListener*>( IUTEST_PEEP_GET(listeners, ::testing::TestEventListeners, repeater_) );
257+ return reinterpret_cast< ::testing::TestEventListener* >( IUTEST_PEEP_GET(listeners, ::testing::TestEventListeners, repeater_) );
258258 #else
259259 return &(IUTEST_PEEP_GET(listeners, ::iutest::TestEventListeners, m_repeater));
260260 #endif
@@ -316,7 +316,7 @@
316316 {
317317 #ifndef IUTEST_USE_GTEST
318318 (IUTEST_PEEP_GET(*(::iutest::UnitTest::GetInstance())
319- , ::iutest::UnitTest, m_current_testcase)) = const_cast<::iutest::TestCase*>(testcase);
319+ , ::iutest::UnitTest, m_current_testcase)) = const_cast< ::iutest::TestCase* >(testcase);
320320 #endif
321321 }
322322 };
--- trunk/include/internal/iutest_option_message.hpp (revision 1336)
+++ trunk/include/internal/iutest_option_message.hpp (revision 1337)
@@ -102,9 +102,10 @@
102102 }
103103
104104 /** @private */
105-#define IIUT_SHOW_MACRO(macro) detail::iuConsole::output("#define %s %s\n", #macro, IUTEST_PP_TOSTRING(macro))
106-#define IIUT_SHOW_ENABLE_MACRO(macro) IUTEST_PP_IF(macro, IIUT_SHOW_MACRO(macro), IUTEST_PP_EMPTY())
107-#define IIUT_SHOW_DISABLE_MACRO(macro) IUTEST_PP_IF(macro, IUTEST_PP_EMPTY(), IIUT_SHOW_MACRO(macro))
105+#define IIUT_SHOW_MACRO(macro) IIUT_SHOW_MACRO_I(#macro, IUTEST_PP_TOSTRING(macro))
106+#define IIUT_SHOW_MACRO_I(name, value) detail::iuConsole::output("#define %s %s\n", name, value)
107+#define IIUT_SHOW_ENABLE_MACRO(macro) IUTEST_PP_IF(macro, IIUT_SHOW_MACRO_I(#macro, IUTEST_PP_TOSTRING(macro)), IUTEST_PP_EMPTY())
108+#define IIUT_SHOW_DISABLE_MACRO(macro) IUTEST_PP_IF(macro, IUTEST_PP_EMPTY(), IIUT_SHOW_MACRO_I(#macro, IUTEST_PP_TOSTRING(macro)))
108109
109110 /** @private */
110111 #define IIUT_SHOW_FEATURE_MACROS(m) \
--- trunk/include/iutest_ver.hpp (revision 1336)
+++ trunk/include/iutest_ver.hpp (revision 1337)
@@ -17,11 +17,11 @@
1717
1818 //======================================================================
1919 // define
20-#define IUTEST_VER 0x01160501u //!< iutest version 1.16.5.1
20+#define IUTEST_VER 0x01160502u //!< iutest version 1.16.5.2
2121 #define IUTEST_MAJORVER 0x01u //!< Major Version
2222 #define IUTEST_MINORVER 0x16u //!< Minor Version
2323 #define IUTEST_MICROVER 0x05u //!< Micro Version
24-#define IUTEST_REVISION 0x01u //!< Revision
24+#define IUTEST_REVISION 0x02u //!< Revision
2525
2626 #define IUTEST_BUILD IUTEST_MICROVER //!< @deprecated
2727
--- trunk/.travis.yml (revision 1336)
+++ trunk/.travis.yml (revision 1337)
@@ -128,7 +128,7 @@
128128 - STDFLAG=
129129
130130 allow_failures:
131- - COVERITY_SCAN=1
131+ - env: COVERITY_SCAN=1
132132
133133 matrix:
134134 include:
--- trunk/projects/cmake/CMakeLists.txt (revision 1336)
+++ trunk/projects/cmake/CMakeLists.txt (revision 1337)
@@ -153,6 +153,7 @@
153153 values_gen_tests.cpp
154154 variadic_templates_tests.cpp
155155 )
156+ cxx_executable_test(feature_spec_tests)
156157 cxx_executable_test(file_system_tests)
157158 cxx_executable_test(filter_tests)
158159 cxx_executable_test(flagfile_gtest_tests)
Show on old repository browser