• R/O
  • SSH
  • HTTPS

iutest: Commit


Commit MetaInfo

Revision1425 (tree)
Zeit2020-10-21 22:13:44
Autorsrz_zumix

Log Message

fix NMAKE $< warning U4006 (#518)

* echo test

* fix

* add .exe

* test

* fix nmake

* fix filename for windows

* sync cmake tests

* fix

* add help
git@78379f8fcbabf503d5b6025f17d119cfc801d79c
https://github.com/srz-zumix/iutest/commit/78379f8fcbabf503d5b6025f17d119cfc801d79c


v1.17.99.3

git@7bbe13f7ec7a1367fbc8992386bfbbfc4a6d7929


fix gtest compat (#522)

* fix gtest compat

* up

* up

* update README

* fix

* add gmock badge

* add template [ci skip]

* fix

* fix compat

* fix

* fix

* fix

* fix

* fix make
git@4874f09384cd1a1d5bd660b1a6488616ddad8769


cmake config check (#521)

* cmake config check

* cmake config check

* update test

* fix test config

* fix

* fix

* fix test
git@ad233cad0c5103a4c9eb43b94a1a12e5bdecb32b


update template

git@d9f2cdf16ba242e0e52da0aca0fb49229128e0bd

Ändern Zusammenfassung

Diff

--- trunk/README.md (revision 1424)
+++ trunk/README.md (revision 1425)
@@ -14,6 +14,8 @@
1414 [![Semaphore Build Status](https://semaphoreci.com/api/v1/srz_zumix/iutest/branches/master/badge.svg)](https://semaphoreci.com/srz_zumix/iutest)
1515 [![Semaphore 2.0 Build Status](https://srz-zumix.semaphoreci.com/badges/iutest/branches/master.svg)](https://srz-zumix.semaphoreci.com/projects/iutest)
1616 [![Shippable Run Status](https://api.shippable.com/projects/541904d2ac22859af743f867/badge?branch=master)](https://app.shippable.com/github/srz-zumix/iutest)
17+[![TeamCity Cloud Build Status](https://iutest.beta.teamcity.com/app/rest/builds/buildType:Iutest_GoogleTestCompatibleTest/statusIcon?guest=1)](https://iutest.beta.teamcity.com/viewType.html?buildTypeId=Iutest_GoogleTestCompatibleTest&guest=1)
18+[![TeamCity Cloud Build Status](https://iutest.beta.teamcity.com/app/rest/builds/buildType:Iutest_GoogleMockCompatibleTest/statusIcon?guest=1)](https://iutest.beta.teamcity.com/viewType.html?buildTypeId=Iutest_GoogleMockCompatibleTest&guest=1)
1719 [![Travis-CI Build Status](https://travis-ci.com/srz-zumix/iutest.svg?branch=master)](https://travis-ci.com/srz-zumix/iutest)
1820 [![Wercker status](https://app.wercker.com/status/d385156052aa4118a7f24affe4a8f851/s/master "wercker status")](https://app.wercker.com/project/bykey/d385156052aa4118a7f24affe4a8f851)
1921
@@ -143,20 +145,20 @@
143145 |[Semaphore](https://semaphoreci.com/)|[![Semaphore Build Status](https://semaphoreci.com/api/v1/srz_zumix/iutest/branches/master/badge.svg)](https://semaphoreci.com/srz_zumix/iutest)|[![Semaphore Build Status](https://semaphoreci.com/api/v1/srz_zumix/iutest/branches/develop/badge.svg)](https://semaphoreci.com/srz_zumix/iutest)|Scan-build|
144146 |[Semaphore 2.0](https://semaphoreci.com/)|[![Semaphore 2.0 Build Status](https://srz-zumix.semaphoreci.com/badges/iutest/branches/master.svg)](https://srz-zumix.semaphoreci.com/projects/iutest)|[![Semaphore 2.0 Build Status](https://srz-zumix.semaphoreci.com/badges/iutest/branches/develop.svg)](https://srz-zumix.semaphoreci.com/projects/iutest)|Scan-build, Basic test, sample run|
145147 |[Shippable](https://shippable.com/)|[![Shippable Run Status](https://api.shippable.com/projects/541904d2ac22859af743f867/badge?branch=master)](https://app.shippable.com/github/srz-zumix/iutest)|[![Run Status](https://api.shippable.com/projects/541904d2ac22859af743f867/badge?branch=develop)](https://app.shippable.com/github/srz-zumix/iutest)|CentOS gcc/clang Baisc test|
148+|[TeamCity Cloud](https://www.jetbrains.com/teamcity/cloud/)|[![TeamCity Cloud Build Status](https://iutest.beta.teamcity.com/app/rest/builds/buildType:Iutest_GoogleTestCompatibleTest/statusIcon)](https://iutest.beta.teamcity.com/viewType.html?buildTypeId=Iutest_GoogleTestCompatibleTest&guest=1)||Google Test compatible test for released versions|
149+|[TeamCity Cloud](https://www.jetbrains.com/teamcity/cloud/)|[![TeamCity Cloud Build Status](https://iutest.beta.teamcity.com/app/rest/builds/buildType:Iutest_GoogleMockCompatibleTest/statusIcon)](https://iutest.beta.teamcity.com/viewType.html?buildTypeId=Iutest_GoogleMockCompatibleTest&guest=1)||Google Mock compatible test for released versions|
146150 |[Travis CI](https://travis-ci.com/)|[![Travis-CI Build Status](https://travis-ci.com/srz-zumix/iutest.svg?branch=master)](https://travis-ci.com/srz-zumix/iutest)|[![Travis-CI Build Status](https://travis-ci.com/srz-zumix/iutest.svg?branch=develop)](https://travis-ci.com/srz-zumix/iutest)|Basic tests, Google Test compatibility, Coverage, Coverity-scan|
147-|[Wercker](https://www.wercker.com/)|[![wercker status](https://app.wercker.com/status/d385156052aa4118a7f24affe4a8f851/s/master "wercker status")](https://app.wercker.com/project/byKey/d385156052aa4118a7f24affe4a8f851)|[![wercker status](https://app.wercker.com/status/d385156052aa4118a7f24affe4a8f851/s/develop "wercker status")](https://app.wercker.com/project/byKey/d385156052aa4118a7f24affe4a8f851)|gtest compatible test for released versions / gtest version detect test, iuwandbox make build|
151+|[Wercker](https://www.wercker.com/)|[![wercker status](https://app.wercker.com/status/d385156052aa4118a7f24affe4a8f851/s/master "wercker status")](https://app.wercker.com/project/byKey/d385156052aa4118a7f24affe4a8f851)|[![wercker status](https://app.wercker.com/status/d385156052aa4118a7f24affe4a8f851/s/develop "wercker status")](https://app.wercker.com/project/byKey/d385156052aa4118a7f24affe4a8f851)|test/cmake project check, iuwandbox make build|
148152
149153 Basic test
150154
151155 [Compiler and OS tests status](./docs/status/compiler_os_ci_status.rst)
152156
153-
154157 Coverage
155158 --------------------------------------------------
156159
157160 [![Coveralls Coverage Status](https://coveralls.io/repos/github/srz-zumix/iutest/badge.svg?branch=master)](https://coveralls.io/github/srz-zumix/iutest?branch=master)
158161
159-
160162 [![Codecov](https://codecov.io/gh/srz-zumix/iutest/branch/master/graph/badge.svg)](https://codecov.io/gh/srz-zumix/iutest)
161163 [![Codecov](https://codecov.io/gh/srz-zumix/iutest/branch/master/graphs/icicle.svg)](https://codecov.io/gh/srz-zumix/iutest)
162164
--- trunk/appveyor.yml (revision 1424)
+++ trunk/appveyor.yml (revision 1425)
@@ -78,9 +78,7 @@
7878 only:
7979 - master
8080 - develop
81- # - /feature.*/
82- # - /fix.*/
83- # - /appveyor.*/
81+ - /appveyor.*/
8482
8583 skip_commits:
8684 files:
@@ -227,7 +225,7 @@
227225 before_build:
228226 cmd: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\vsdevcmd.bat"'
229227 build_script:
230- cmd: cd test && nmake all_tests && all_tests --spec && nmake
228+ cmd: cd test && nmake minimum_tests && minimum_tests.exe --spec
231229 test_script:
232230 cmd: nmake test
233231 # Prefast
--- trunk/include/gtest/iutest_assertion_only.hpp (revision 1424)
+++ trunk/include/gtest/iutest_assertion_only.hpp (revision 1425)
@@ -7,7 +7,7 @@
77 *
88 * @author t.shirayanagi
99 * @par copyright
10- * Copyright (C) 2012-2016, Takazumi Shirayanagi\n
10+ * Copyright (C) 2012-2020, Takazumi Shirayanagi\n
1111 * This software is released under the new BSD License,
1212 * see LICENSE
1313 */
@@ -21,7 +21,7 @@
2121 #else // !defined(IUTEST_USE_GTEST)
2222
2323 #include "iutest_gtest_ver.hpp"
24-#if GTEST_OS_WINDOWS
24+#if defined(_WIN32) || defined(WIN32) || defined(__WIN32__) || defined(WINAPI_FAMILY)
2525 #include <windows.h>
2626 #endif
2727
@@ -86,7 +86,7 @@
8686 #endif
8787
8888 printf("%s", msg.GetString().c_str());
89-#if GTEST_OS_WINDOWS
89+#if defined(_WIN32) || defined(WIN32) || defined(__WIN32__) || defined(WINAPI_FAMILY)
9090 OutputDebugStringA(msg.GetString().c_str());
9191 #endif
9292 }
--- trunk/include/gtest/iutest_switch_for_gtest.hpp (revision 1424)
+++ trunk/include/gtest/iutest_switch_for_gtest.hpp (revision 1425)
@@ -84,6 +84,10 @@
8484 //======================================================================
8585 // define
8686
87+#if !defined(GTEST_HAS_PARAM_TEST)
88+# define GTEST_HAS_PARAM_TEST 1
89+#endif
90+
8791 #if defined(INCG_IRIS_IUTEST_HPP_)
8892 #undef IUTEST_SUCCEED
8993 #undef IUTEST_FAIL
@@ -553,6 +557,14 @@
553557 {
554558 *os << val;
555559 }
560+#if IUTEST_HAS_CXX_HDR_STRING_VIEW
561+template<typename CharT, typename Traits>
562+inline void GTestStreamTo(std::ostream* os, const ::std::basic_string_view<CharT, Traits>& val)
563+{
564+ const ::std::basic_string<CharT, Traits> str{ val };
565+ *os << str.c_str();
566+}
567+#endif
556568
557569 } // end of namespace printer_internal2
558570 } // end of namespace testing
--- trunk/include/gtest/iutest_switch_for_iutest.hpp (revision 1424)
+++ trunk/include/gtest/iutest_switch_for_iutest.hpp (revision 1425)
@@ -36,7 +36,9 @@
3636 #undef ADD_FAILURE_AT
3737
3838 #undef GTEST_HAS_DEATH_TEST
39-#undef GTEST_HAS_PARAM_TEST
39+#if defined(GTEST_HAS_PARAM_TEST)
40+# undef GTEST_HAS_PARAM_TEST
41+#endif
4042 #undef GTEST_HAS_COMBINE
4143 #undef GTEST_HAS_TYPED_TEST
4244 #undef GTEST_HAS_TYPED_TEST_P
--- trunk/include/iutest_ver.hpp (revision 1424)
+++ trunk/include/iutest_ver.hpp (revision 1425)
@@ -17,11 +17,11 @@
1717
1818 //======================================================================
1919 // define
20-#define IUTEST_VER 0x01179902u //!< iutest version 1.17.99.2
20+#define IUTEST_VER 0x01179903u //!< iutest version 1.17.99.3
2121 #define IUTEST_MAJORVER 0x01u //!< Major Version
2222 #define IUTEST_MINORVER 0x17u //!< Minor Version
2323 #define IUTEST_MICROVER 0x99u //!< Micro Version
24-#define IUTEST_REVISION 0x02u //!< Revision
24+#define IUTEST_REVISION 0x03u //!< Revision
2525
2626 #define IUTEST_BUILD IUTEST_MICROVER //!< @deprecated
2727
--- trunk/projects/cmake/CMakeLists.txt (revision 1424)
+++ trunk/projects/cmake/CMakeLists.txt (revision 1425)
@@ -139,11 +139,14 @@
139139 typed_test_tests.cpp
140140 values_tests.cpp
141141 )
142+ cxx_executable_test(also_run_disabled_tests)
143+ cxx_executable_test(assertion_only_tests)
142144 cxx_executable_test(assertion_return_tests)
143145 cxx_executable_test(assume_tests)
144146 cxx_executable_test(break_on_failure_nobreak_tests)
145147 cxx_executable_test(catch_exceptions_tests)
146148 cxx_executable_test(charcode_tests)
149+ cxx_executable_test(csvparams_invalid_file_tests)
147150 cxx_executable_test(commandline_tests)
148151 cxx_executable_test(csvparams_tests)
149152 cxx_executable_test(cxx_feature_tests)
@@ -152,7 +155,7 @@
152155 cxx_executable_test(env_var_gtest_tests)
153156 cxx_executable_test(environment_tests)
154157 cxx_executable_test(exception_assertion_tests)
155- cxx_executable_test(exception_setup_testsuite_tests)
158+ cxx_executable_test(exception_set_up_testsuite_tests)
156159 cxx_executable_test(exception_tests)
157160 cxx_executable_test(expression_assertion_tests)
158161 cxx_executable_test_with_main(extension_tests
@@ -169,14 +172,16 @@
169172 values_gen_tests.cpp
170173 variadic_templates_tests.cpp
171174 )
172- cxx_executable_test(feature_spec_tests)
173175 cxx_executable_test(file_system_tests)
174176 cxx_executable_test(filter_tests)
175177 cxx_executable_test(flagfile_gtest_tests)
176178 cxx_executable_test(gtest_version_tests)
177179 cxx_executable_test(help_tests)
180+ cxx_executable_test(inform_tests)
181+ cxx_executable_test(internal_log_tests)
178182 cxx_executable_test(invalid_commandline_tests)
179183 cxx_executable_test(japanese_tests)
184+ cxx_executable_test(legacy_testcase_api_tests)
180185 cxx_executable_test(list_test_tests)
181186 cxx_executable_test(listener_tests)
182187 cxx_executable_test(matcher_tests)
@@ -184,6 +189,7 @@
184189 cxx_executable_test(no_failure_fail_tests)
185190 cxx_executable_test(no_fatalfailure_tests)
186191 cxx_executable_test(no_test_tests)
192+ cxx_executable_test(output_env_var_tests)
187193 cxx_executable_test(output_junit_xml_tests)
188194 cxx_executable_test(output_xml_tests)
189195 cxx_executable_test(port_tests)
@@ -207,7 +213,7 @@
207213 cxx_executable_test(uninitialize_tests)
208214 cxx_executable_test(util_tests)
209215 if (build_namespace_tests)
210- cxx_namespace_test(namespace_tests
216+ cxx_executable_test_ns(namespace_tests
211217 assertion_tests.cpp
212218 basic_tests.cpp
213219 combine_tests.cpp
@@ -239,6 +245,7 @@
239245 cxx_executable_test(default_printer_listener_tests)
240246 cxx_executable_test(env_var_tests)
241247 cxx_executable_test(exit_tests)
248+ cxx_executable_test(feature_spec_tests)
242249 cxx_executable_test(filter_file_invalid_path_tests)
243250 cxx_executable_test(filter_file_syntax_tests)
244251 cxx_executable_test(filter_file_tests)
@@ -245,7 +252,11 @@
245252 cxx_executable_test(flagfile_env_var_tests)
246253 cxx_executable_test(flagfile_invalid_path_tests)
247254 cxx_executable_test(flagfile_tests)
255+ cxx_executable_test(invalid_both_suite_and_case_set_up_tests)
256+ cxx_executable_test(invalid_both_suite_and_case_teardown_tests)
257+ cxx_executable_test(invalid_locale_ctype_tests)
248258 cxx_executable_test(ostream_formatter_tests)
259+ cxx_executable_test(output_long_type_param_tests)
249260 cxx_executable_test(output_tests)
250261 cxx_executable_test(output_xml_invalid_path_tests)
251262 cxx_executable_test(output_xml_repeat_tests)
@@ -254,6 +265,7 @@
254265 cxx_executable_test(param_test_name_tests)
255266 cxx_executable_test(no_yoda_tests)
256267 cxx_executable_test(scoped_trace_exception_tests)
268+ cxx_executable_test(spec_tests)
257269 cxx_executable_test(tap_file_generator_listener_tests)
258270 cxx_executable_test(tap_printer_listener_tests)
259271 cxx_executable_test(type_param_strict_tests)
@@ -275,6 +287,8 @@
275287
276288 if (build_tests)
277289 cxx_add_test(all_tests)
290+ cxx_add_test(also_run_disabled_tests)
291+ cxx_add_test(assertion_only_tests)
278292 cxx_add_test(assertion_return_tests)
279293 cxx_add_test(assume_tests)
280294 cxx_add_test(break_on_failure_nobreak_tests)
@@ -281,13 +295,15 @@
281295 cxx_add_test(catch_exceptions_tests)
282296 cxx_add_test(charcode_tests)
283297 cxx_add_test(commandline_tests)
298+ cxx_add_test(csvparams_invalid_file_tests)
284299 cxx_add_test(csvparams_tests)
300+ cxx_add_test(cxx_feature_tests)
285301 cxx_add_test(disabled_tests)
286302 cxx_add_test(empty_testname_tests)
287303 cxx_add_test(env_var_gtest_tests)
288304 cxx_add_test(environment_tests)
289305 cxx_add_test(exception_assertion_tests)
290- cxx_add_test(exception_setup_testsuite_tests)
306+ cxx_add_test(exception_set_up_testsuite_tests)
291307 cxx_add_test(exception_tests)
292308 cxx_add_test(expression_assertion_tests)
293309 cxx_add_test(extension_tests)
@@ -296,8 +312,11 @@
296312 cxx_add_test(flagfile_gtest_tests)
297313 cxx_add_test(gtest_version_tests)
298314 cxx_add_test(help_tests)
315+ cxx_add_test(inform_tests)
316+ cxx_add_test(internal_log_tests)
299317 cxx_add_test(invalid_commandline_tests)
300318 cxx_add_test(japanese_tests)
319+ cxx_add_test(legacy_testcase_api_tests)
301320 cxx_add_test(list_test_tests)
302321 cxx_add_test(listener_tests)
303322 cxx_add_test(matcher_tests)
@@ -305,6 +324,7 @@
305324 cxx_add_test(no_failure_fail_tests)
306325 cxx_add_test(no_fatalfailure_tests)
307326 cxx_add_test(no_test_tests)
327+ cxx_add_test(output_env_var_tests)
308328 cxx_add_test(output_junit_xml_tests)
309329 cxx_add_test(output_xml_tests)
310330 cxx_add_test(port_tests)
@@ -335,6 +355,7 @@
335355 cxx_add_test(default_printer_listener_tests)
336356 cxx_add_test(env_var_tests)
337357 cxx_add_test(exit_tests)
358+ cxx_add_test(feature_spec_tests)
338359 cxx_add_test(filter_file_invalid_path_tests)
339360 cxx_add_test(filter_file_syntax_tests)
340361 cxx_add_test(filter_file_tests)
@@ -341,14 +362,20 @@
341362 cxx_add_test(flagfile_env_var_tests)
342363 cxx_add_test(flagfile_invalid_path_tests)
343364 cxx_add_test(flagfile_tests)
365+ cxx_add_test(invalid_both_suite_and_case_set_up_tests)
366+ cxx_add_test(invalid_both_suite_and_case_teardown_tests)
367+ cxx_add_test(invalid_locale_ctype_tests)
344368 cxx_add_test(ostream_formatter_tests)
369+ cxx_add_test(output_long_type_param_tests)
345370 cxx_add_test(output_tests)
346371 cxx_add_test(output_xml_invalid_path_tests)
347372 cxx_add_test(output_xml_repeat_tests)
373+ cxx_add_test(own_string_view_tests)
348374 cxx_add_test(param_test_name_invalid_tests)
349375 cxx_add_test(param_test_name_tests)
350376 cxx_add_test(no_yoda_tests)
351377 cxx_add_test(scoped_trace_exception_tests)
378+ cxx_add_test(spec_tests)
352379 cxx_add_test(tap_file_generator_listener_tests)
353380 cxx_add_test(tap_printer_listener_tests)
354381 cxx_add_test(type_param_strict_tests)
--- trunk/test/invalid_both_suite_and_case_setup_tests.cpp (revision 1424)
+++ trunk/test/invalid_both_suite_and_case_setup_tests.cpp (nonexistent)
@@ -1,79 +0,0 @@
1-//======================================================================
2-//-----------------------------------------------------------------------
3-/**
4- * @file invalid_both_suite_and_case_setup_tests.cpp
5- * @brief invalid testsuite and testcase both implement
6- *
7- * @author t.shirayanagi
8- * @par copyright
9- * Copyright (C) 2020, Takazumi Shirayanagi\n
10- * This software is released under the new BSD License,
11- * see LICENSE
12-*/
13-//-----------------------------------------------------------------------
14-//======================================================================
15-
16-//======================================================================
17-// include
18-#define IUTEST_ABORT() (void)0
19-#include "iutest.hpp"
20-
21-#if !defined(IUTEST_USE_GTEST)
22-# if IUTEST_HAS_TESTSUITE && IUTEST_HAS_TESTCASE && !defined(IUTEST_USE_LIB)
23-# define HAS_INVALID_TESTSUITE_AND_TESTCASE 1
24-# endif
25-#endif
26-
27-#if !defined(HAS_INVALID_TESTSUITE_AND_TESTCASE)
28-# define HAS_INVALID_TESTSUITE_AND_TESTCASE 0
29-#endif
30-
31-#if HAS_INVALID_TESTSUITE_AND_TESTCASE
32-
33-#if IUTEST_HAS_STREAM_BUFFER
34-::iutest::detail::IUStreamBuffer<2048> stderr_capture(stderr);
35-#endif
36-
37-class BothTest : public ::iutest::Test
38-{
39-public:
40- static void SetUpTestSuite()
41- {
42- }
43- static void SetUpTestCase()
44- {
45- }
46-};
47-
48-IUTEST_F(BothTest, Run)
49-{
50-}
51-
52-#endif
53-
54-#ifdef UNICODE
55-int wmain(int argc, wchar_t* argv[])
56-#else
57-int main(int argc, char* argv[])
58-#endif
59-{
60- IUTEST_INIT(&argc, argv);
61-#if HAS_INVALID_TESTSUITE_AND_TESTCASE
62- int ret = IUTEST_RUN_ALL_TESTS();
63-#if IUTEST_HAS_ASSERTION_RETURN && IUTEST_HAS_STREAM_BUFFER
64- IUTEST_ASSERT_STRIN(
65- "Test can not provide both SetUpTestSuite and SetUpTestCase"
66- ", please make sure there is only one present at "
67- , stderr_capture.GetStreamString()) << ::iutest::AssertionReturn<int>(1);
68-#endif
69- if( ret == 0 )
70- {
71- return 1;
72- }
73- printf("*** Successful ***\n");
74- return 0;
75-#else
76- return IUTEST_RUN_ALL_TESTS();
77-#endif
78-}
79-
--- trunk/test/exception_setup_testsuite_tests.cpp (revision 1424)
+++ trunk/test/exception_setup_testsuite_tests.cpp (nonexistent)
@@ -1,80 +0,0 @@
1-//======================================================================
2-//-----------------------------------------------------------------------
3-/**
4- * @file exception_setup_testsuite_tests.cpp
5- * @brief iutest exception at SetUpTestSuite
6- *
7- * @author t.shirayanagi
8- * @par copyright
9- * Copyright (C) 2020, 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-
20-#if defined(IUTEST_USE_GTEST)
21-# if GTEST_VER < 0x01060000 && !IUTEST_HAS_SEH
22-# define EXCEPTION_CATCH_TEST 0
23-# endif
24-#endif
25-
26-#if !defined(EXCEPTION_CATCH_TEST)
27-# if IUTEST_HAS_EXCEPTIONS
28-# define EXCEPTION_CATCH_TEST 1
29-# else
30-# define EXCEPTION_CATCH_TEST 0
31-# endif
32-#endif
33-
34-#if EXCEPTION_CATCH_TEST
35-
36-class ExceptionSetUpTest : public ::iuutil::backward::Test<ExceptionSetUpTest>
37-{
38-public:
39- static void SetUpTestSuite()
40- {
41- throw "ExceptionSetUpTest";
42- }
43-};
44-
45-IUTEST_F(ExceptionSetUpTest, Empty)
46-{
47-}
48-
49-#endif
50-
51-#ifdef UNICODE
52-int wmain(int argc, wchar_t* argv[])
53-#else
54-int main(int argc, char* argv[])
55-#endif
56-{
57-#if EXCEPTION_CATCH_TEST
58- IUTEST_INIT(&argc, argv);
59- ::iutest::IUTEST_FLAG(catch_exceptions) = true;
60-
61-#if defined(OUTPUTXML)
62- // 失敗テストを含むので xml 出力しない
63- ::iutest::IUTEST_FLAG(output) = NULL;
64-#endif
65- if( IUTEST_RUN_ALL_TESTS() == 0 ) return 1;
66-#if IUTEST_HAS_ASSERTION_RETURN
67- IUTEST_ASSERT_EQ(0, ::iutest::UnitTest::GetInstance()->failed_test_count())
68- << ::iutest::AssertionReturn<int>(1);
69-#else
70- IUTEST_ASSERT_EXIT( ::iutest::UnitTest::GetInstance()->failed_test_count() == 0 );
71-#endif
72-
73-#else
74- IUTEST_UNUSED_VAR(argc);
75- IUTEST_UNUSED_VAR(argv);
76-#endif
77- printf("*** Successful ***\n");
78- return 0;
79-}
80-
--- trunk/test/CommonMakefile.in (revision 1424)
+++ trunk/test/CommonMakefile.in (revision 1425)
@@ -110,7 +110,7 @@
110110 $(OUTDIR)/env_var_gtest_tests \
111111 $(OUTDIR)/environment_tests \
112112 $(OUTDIR)/exception_assertion_tests \
113- $(OUTDIR)/exception_setup_testsuite_tests \
113+ $(OUTDIR)/exception_set_up_testsuite_tests \
114114 $(OUTDIR)/exception_tests \
115115 $(OUTDIR)/expression_assertion_tests \
116116 $(OUTDIR)/file_system_tests \
@@ -170,7 +170,7 @@
170170 $(OUTDIR)/flagfile_env_var_tests \
171171 $(OUTDIR)/flagfile_invalid_path_tests \
172172 $(OUTDIR)/flagfile_tests \
173- $(OUTDIR)/invalid_both_suite_and_case_setup_tests \
173+ $(OUTDIR)/invalid_both_suite_and_case_set_up_tests \
174174 $(OUTDIR)/invalid_both_suite_and_case_teardown_tests \
175175 $(OUTDIR)/invalid_locale_ctype_tests \
176176 $(OUTDIR)/ostream_formatter_tests \
--- trunk/test/Makefile (revision 1424)
+++ trunk/test/Makefile (revision 1425)
@@ -50,7 +50,8 @@
5050 NAMESPACETESTS_SRCS = main.cpp $(NAMESPACETESTS_TEST_SRCS)
5151
5252 SRCS = $(BUILD_TARGETS:_tests=_tests.cpp)
53-RUNNER = $(RUN_TARGETS:_tests=_tests_run)
53+RUNNER_ = $(RUN_TARGETS:_tests=_tests_run)
54+RUNNER = $(RUNNER_:./=)
5455
5556
5657 # build targets.
@@ -75,9 +76,9 @@
7576 $(RUNNER) : $(@:_tests_run=_tests)
7677 @echo $@
7778 !ifdef OUTPUTXML
78- $< $(RUN_OPTION) --iutest_output=xml:$<.xml
79+ $?.exe $(RUN_OPTION) --iutest_output=xml:$?.xml
7980 !else
80- $< $(RUN_OPTION)
81+ $?.exe $(RUN_OPTION)
8182 !endif
8283
8384 #
--- trunk/test/exception_set_up_testsuite_tests.cpp (nonexistent)
+++ trunk/test/exception_set_up_testsuite_tests.cpp (revision 1425)
@@ -0,0 +1,93 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file exception_set_up_testsuite_tests.cpp
5+ * @brief iutest exception at SetUpTestSuite
6+ *
7+ * @author t.shirayanagi
8+ * @par copyright
9+ * Copyright (C) 2020, 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+
20+#if defined(IUTEST_USE_GTEST)
21+# if GTEST_VER < 0x01060000 && !IUTEST_HAS_SEH
22+# define EXCEPTION_CATCH_TEST 0
23+# endif
24+#endif
25+
26+#if !defined(EXCEPTION_CATCH_TEST)
27+# if IUTEST_HAS_EXCEPTIONS
28+# define EXCEPTION_CATCH_TEST 1
29+# else
30+# define EXCEPTION_CATCH_TEST 0
31+# endif
32+#endif
33+
34+#if EXCEPTION_CATCH_TEST
35+
36+class ExceptionSetUpTest : public ::iuutil::backward::Test<ExceptionSetUpTest>
37+{
38+public:
39+ static void SetUpTestSuite()
40+ {
41+ throw "ExceptionSetUpTest";
42+ }
43+};
44+
45+IUTEST_F(ExceptionSetUpTest, Empty)
46+{
47+}
48+
49+#endif
50+
51+#ifdef UNICODE
52+int wmain(int argc, wchar_t* argv[])
53+#else
54+int main(int argc, char* argv[])
55+#endif
56+{
57+#if EXCEPTION_CATCH_TEST
58+ IUTEST_INIT(&argc, argv);
59+ ::iutest::IUTEST_FLAG(catch_exceptions) = true;
60+
61+#if defined(OUTPUTXML)
62+ // 失敗テストを含むので xml 出力しない
63+ ::iutest::IUTEST_FLAG(output) = NULL;
64+#endif
65+#if defined(IUTEST_USE_GTEST) && GTEST_VER == 0x01080100
66+ // bug?
67+ if( IUTEST_RUN_ALL_TESTS() != 0 )
68+ {
69+ printf("Test expect success.\n");
70+ return 1;
71+ }
72+#else
73+ if( IUTEST_RUN_ALL_TESTS() == 0 )
74+ {
75+ printf("Test expect fail.\n");
76+ return 1;
77+ }
78+#endif
79+#if IUTEST_HAS_ASSERTION_RETURN
80+ IUTEST_ASSERT_EQ(0, ::iutest::UnitTest::GetInstance()->failed_test_count())
81+ << ::iutest::AssertionReturn<int>(1);
82+#else
83+ IUTEST_ASSERT_EXIT( ::iutest::UnitTest::GetInstance()->failed_test_count() == 0 );
84+#endif
85+
86+#else
87+ IUTEST_UNUSED_VAR(argc);
88+ IUTEST_UNUSED_VAR(argv);
89+#endif
90+ printf("*** Successful ***\n");
91+ return 0;
92+}
93+
--- trunk/test/invalid_both_suite_and_case_set_up_tests.cpp (nonexistent)
+++ trunk/test/invalid_both_suite_and_case_set_up_tests.cpp (revision 1425)
@@ -0,0 +1,88 @@
1+//======================================================================
2+//-----------------------------------------------------------------------
3+/**
4+ * @file invalid_both_suite_and_case_set_up_tests.cpp
5+ * @brief invalid testsuite and testcase both implement
6+ *
7+ * @author t.shirayanagi
8+ * @par copyright
9+ * Copyright (C) 2020, Takazumi Shirayanagi\n
10+ * This software is released under the new BSD License,
11+ * see LICENSE
12+*/
13+//-----------------------------------------------------------------------
14+//======================================================================
15+
16+//======================================================================
17+// include
18+#define IUTEST_ABORT() (void)0
19+#include "iutest.hpp"
20+
21+#if !defined(IUTEST_USE_GTEST)
22+# if IUTEST_HAS_TESTSUITE && IUTEST_HAS_TESTCASE && !defined(IUTEST_USE_LIB)
23+# define HAS_INVALID_TESTSUITE_AND_TESTCASE 1
24+# endif
25+#endif
26+
27+#if !defined(HAS_INVALID_TESTSUITE_AND_TESTCASE)
28+# define HAS_INVALID_TESTSUITE_AND_TESTCASE 0
29+#endif
30+
31+#if HAS_INVALID_TESTSUITE_AND_TESTCASE
32+
33+#if IUTEST_HAS_STREAM_BUFFER
34+::iutest::detail::IUStreamBuffer<2048> stderr_capture(stderr);
35+#endif
36+
37+class BothTest : public ::iutest::Test
38+{
39+public:
40+ static int x;
41+public:
42+ static void SetUpTestSuite()
43+ {
44+ ++x;
45+ }
46+ static void SetUpTestCase()
47+ {
48+ ++x;
49+ }
50+};
51+
52+IUTEST_F(BothTest, Run)
53+{
54+}
55+
56+int BothTest::x = 0;
57+
58+#endif
59+
60+#ifdef UNICODE
61+int wmain(int argc, wchar_t* argv[])
62+#else
63+int main(int argc, char* argv[])
64+#endif
65+{
66+ IUTEST_INIT(&argc, argv);
67+#if HAS_INVALID_TESTSUITE_AND_TESTCASE
68+ int ret = IUTEST_RUN_ALL_TESTS();
69+#if IUTEST_HAS_ASSERTION_RETURN
70+#if IUTEST_HAS_STREAM_BUFFER
71+ IUTEST_ASSERT_STRIN(
72+ "Test can not provide both SetUpTestSuite and SetUpTestCase"
73+ ", please make sure there is only one present at "
74+ , stderr_capture.GetStreamString()) << ::iutest::AssertionReturn<int>(1);
75+#endif
76+ IUTEST_ASSERT_EQ(1, BothTest::x) << ::iutest::AssertionReturn<int>(1);
77+#endif
78+ if( ret == 0 )
79+ {
80+ return 1;
81+ }
82+ printf("*** Successful ***\n");
83+ return 0;
84+#else
85+ return IUTEST_RUN_ALL_TESTS();
86+#endif
87+}
88+
--- trunk/test/invalid_both_suite_and_case_teardown_tests.cpp (revision 1424)
+++ trunk/test/invalid_both_suite_and_case_teardown_tests.cpp (revision 1425)
@@ -37,14 +37,20 @@
3737 class BothTest : public ::iutest::Test
3838 {
3939 public:
40+ static int x;
41+public:
4042 static void TearDownTestSuite()
4143 {
44+ ++x;
4245 }
4346 static void TearDownTestCase()
4447 {
48+ ++x;
4549 }
4650 };
4751
52+int BothTest::x = 0;
53+
4854 IUTEST_F(BothTest, Run)
4955 {
5056 }
@@ -60,12 +66,15 @@
6066 IUTEST_INIT(&argc, argv);
6167 #if HAS_INVALID_TESTSUITE_AND_TESTCASE
6268 int ret = IUTEST_RUN_ALL_TESTS();
63-#if IUTEST_HAS_ASSERTION_RETURN && IUTEST_HAS_STREAM_BUFFER
69+#if IUTEST_HAS_ASSERTION_RETURN
70+#if IUTEST_HAS_STREAM_BUFFER
6471 IUTEST_ASSERT_STRIN(
6572 "Test can not provide both TearDownTestSuite and TearDownTestCase"
6673 ", please make sure there is only one present at "
6774 , stderr_capture.GetStreamString()) << ::iutest::AssertionReturn<int>(1);
6875 #endif
76+ IUTEST_ASSERT_EQ(1, BothTest::x) << ::iutest::AssertionReturn<int>(1);
77+#endif
6978 if( ret == 0 )
7079 {
7180 return 1;
--- trunk/test/matcher_tests.cpp (revision 1424)
+++ trunk/test/matcher_tests.cpp (revision 1425)
@@ -53,6 +53,11 @@
5353
5454 } // end of namespace
5555
56+IUTEST(Matcher, SuppressWarning)
57+{
58+ (void)gn;
59+}
60+
5661 IUTEST(Matcher, Eq)
5762 {
5863 IUTEST_EXPECT_THAT(1, Eq(1));
--- trunk/test/printers_tests.cpp (revision 1424)
+++ trunk/test/printers_tests.cpp (revision 1425)
@@ -30,10 +30,12 @@
3030 #else
3131
3232 #define IUTEST_PRINTTOSTRING_EQ(expect, val) \
33- (void)(expect, val)
33+ (void)(expect); \
34+ (void)(val)
3435
3536 #define IUTEST_PRINTTOSTRING_CONTAINE(expect, val) \
36- (void)(expect, val)
37+ (void)(expect); \
38+ (void)(val)
3739
3840 #endif
3941
--- trunk/wercker.yml (revision 1424)
+++ trunk/wercker.yml (revision 1425)
@@ -21,6 +21,14 @@
2121 cd tools/wandbox
2222 python iuwandbox.py --list-compiler --verbose
2323
24+cmake-check:
25+ steps:
26+ - script:
27+ name: CMake tests check
28+ code: |
29+ cd test
30+ make cmake-sync-check
31+
2432 gtest-compat:
2533 box: alpine
2634 docker: true
@@ -64,7 +72,7 @@
6472 code: |
6573 export PYTHONDONTWRITEBYTECODE=1
6674 export IUWANDBOX_COMMANDLINE_OPTION="-f"-Werror" --encoding utf-8-sig --expand-include --verbose --check-config --retry-wait 180 --iutest-use-main"
67- if [ "${IUWANDBOX_TARGET_SRC+x}" ]; then export IUWANDBOX_TARGET_SRC="../../test/syntax_tests.cpp"; fi
75+ if [ -z "${IUWANDBOX_TARGET_SRC+x}" ]; then export IUWANDBOX_TARGET_SRC="../../test/syntax_tests.cpp"; fi
6876
6977 - script: &experimental
7078 name: experimental setup
@@ -77,6 +85,7 @@
7785 cd tools/wandbox
7886 for compiler in ${IUWANDBOX_COMPILER}
7987 do
88+ echo ./iuwandbox.py ${IUWANDBOX_EXPERIMENTAL_OPTION} ${IUWANDBOX_COMMANDLINE_OPTION} -c $compiler --std "c++${IUWANDBOX_CPPVER}" ${IUWANDBOX_TARGET_SRC} ${IUWANDBOX_ADD_OPTION} ${IUWANDBOX_STDC_ADD_OPTION};
8089 python ./iuwandbox.py ${IUWANDBOX_EXPERIMENTAL_OPTION} ${IUWANDBOX_COMMANDLINE_OPTION} -c $compiler --std "c++${IUWANDBOX_CPPVER}" ${IUWANDBOX_TARGET_SRC} ${IUWANDBOX_ADD_OPTION} ${IUWANDBOX_STDC_ADD_OPTION};
8190 done
8291
Show on old repository browser