• R/O
  • SSH
  • HTTPS

iutest: Commit


Commit MetaInfo

Revision1418 (tree)
Zeit2020-07-21 19:44:25
Autorsrz_zumix

Log Message

Merge pull request #489 from srz-zumix/develop

1.17.0.12
git@f04f97f53fc88a7971d832b615cbaed5d7ea61e4
https://github.com/srz-zumix/iutest/commit/f04f97f53fc88a7971d832b615cbaed5d7ea61e4

Ändern Zusammenfassung

Diff

--- trunk/.travis.yml (revision 1417)
+++ trunk/.travis.yml (revision 1418)
@@ -98,6 +98,7 @@
9898 if [ "${COVERITY_SCAN}" != '1' ] && [ "${USE_CMAKE}" != '1' ]; then
9999 make -j4 showcxxversion ${USE_FUSED} default &&
100100 make test ${USE_FUSED}
101+ make report
101102 fi
102103 - |
103104 if [ "${COVERITY_SCAN}" = '1' ] && [ -d cov-int ]; then
--- trunk/CHANGES.md (revision 1417)
+++ trunk/CHANGES.md (revision 1418)
@@ -6,6 +6,8 @@
66
77 * New
88 * GTEST_SKIP 対応
9+ * IUTEST_*_NE_RANGE アサーションを追加
10+ * IUTEST_*_NE_COLLECTIONS アサーションを追加
911
1012 * Improved
1113 * ::std::wstring_view / ::std::u16string_view / ::std::u32string_view 対応
@@ -13,6 +15,9 @@
1315
1416 * Changes
1517 * アサーションに operator << したときの出力を PrintToString したものと同じになるように変更
18+ * iuwandbox: Wandbox 向けにサイズ圧縮したヘッダーをデフォルトで使用するように変更
19+ * iuwandbox: 上記に伴いフルバージョンのヘッダーを使うオプション(--no-iutest-use-wandbox-min)を追加
20+ * deprecated: iuwandbox: --iutest-use-wandbox-min
1621 * Python2 のサポート終了
1722
1823 * Bug fixes
--- trunk/appveyor.yml (revision 1417)
+++ trunk/appveyor.yml (revision 1418)
@@ -196,7 +196,7 @@
196196 make showcxxmacros
197197 make -j4
198198 test_script:
199- cmd: make test
199+ cmd: make test && make report
200200 # MINGW
201201 -
202202 matrix:
@@ -218,7 +218,7 @@
218218 mingw32-make showcxxmacros
219219 mingw32-make -j4 %MAKE_OPTIONS%
220220 test_script:
221- cmd: mingw32-make test %MAKE_OPTIONS%
221+ cmd: mingw32-make test %MAKE_OPTIONS% && mingw32-make report
222222 # NAMKE
223223 -
224224 matrix:
@@ -274,11 +274,3 @@
274274 Write-Output "Building NuGet package"
275275 nuget pack $nuspecPath -OutputDirectory ".\"
276276 test: off
277-
278-notifications:
279- - provider: Email
280- to:
281- - zumix.cpp@gmail.com
282- on_build_success: false
283- on_build_failure: true
284- on_build_status_changed: true
--- trunk/codefresh.yml (revision 1417)
+++ trunk/codefresh.yml (revision 1418)
@@ -110,7 +110,7 @@
110110 environment:
111111 - OUTDIR=gcc9
112112 commands:
113- - make -C test test
113+ - make -C test test && make -C test report
114114 when:
115115 steps:
116116 - name: BuildOtherUnitTest_gcc9
--- trunk/docs/primer.html (revision 1417)
+++ trunk/docs/primer.html (revision 1418)
@@ -147,7 +147,9 @@
147147 <ul>
148148 <li>IUTEST_ASSERT_ALMOST_EQ</li>
149149 <li>IUTEST_ASSERT_EQ_RANGE</li>
150+ <li>IUTEST_ASSERT_NE_RANGE</li>
150151 <li>IUTEST_ASSERT_EQ_COLLECTIONS</li>
152+ <li>IUTEST_ASSERT_NE_COLLECTIONS</li>
151153 <li>IUTEST_ASSERT_STRLNEQ</li>
152154 <li>IUTEST_ASSERT_STRIN</li>
153155 <li>IUTEST_ASSERT_NULL</li>
--- trunk/include/internal/iutest_internal.hpp (revision 1417)
+++ trunk/include/internal/iutest_internal.hpp (revision 1418)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2011-2019, Takazumi Shirayanagi\n
9+ * Copyright (C) 2011-2020, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -558,6 +558,8 @@
558558 IUTEST_PRED_FORMAT2_( ::iutest::internal::CmpHelperSTRCASENE \
559559 , v1, v2, on_failure )
560560
561+#if defined(IUTEST_OS_WINDOWS)
562+
561563 #define IUTEST_TEST_HRESULT_SUCCEEDED(hr, on_failure) \
562564 IUTEST_PRED_FORMAT1_( ::iutest::internal::IsHRESULTSuccess \
563565 , hr, on_failure )
@@ -566,6 +568,8 @@
566568 IUTEST_PRED_FORMAT1_( ::iutest::internal::IsHRESULTFailure \
567569 , hr, on_failure )
568570
571+#endif
572+
569573 #define IUTEST_TEST_SAME(v1, v2, on_failure) \
570574 IUTEST_PRED_FORMAT2_( ::iutest::internal::CmpHelperSame \
571575 , v1, v2, on_failure )
--- trunk/include/internal/iutest_pragma.hpp (revision 1417)
+++ trunk/include/internal/iutest_pragma.hpp (revision 1418)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2012-2019, Takazumi Shirayanagi\n
9+ * Copyright (C) 2012-2020, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -171,77 +171,90 @@
171171 # define IUTEST_PRAGMA_CONSTEXPR_CALLED_AT_RUNTIME_WARN_DISABLE_END()
172172 #endif
173173
174-
175-#if defined(__clang__)
176-# define IUTEST_PRAGMA_WARN_DISABLE_SIGN_COMPARE() IUTEST_PRAGMA_CLANG_WARN_DISABLE("-Wsign-compare")
177-#elif defined(__GNUC__)
178-# define IUTEST_PRAGMA_WARN_DISABLE_SIGN_COMPARE() IUTEST_PRAGMA_GCC_WARN_DISABLE("-Wsign-compare")
179-#elif defined(_MSC_VER)
180-# define IUTEST_PRAGMA_WARN_DISABLE_SIGN_COMPARE() IUTEST_PRAGMA_MSC_WARN_DISABLE(4389 4018)
181-#else
182-# define IUTEST_PRAGMA_WARN_DISABLE_SIGN_COMPARE()
174+#if !defined(IUTEST_PRAGMA_WARN_DISABLE_SIGN_COMPARE)
175+# if defined(__clang__)
176+# define IUTEST_PRAGMA_WARN_DISABLE_SIGN_COMPARE() IUTEST_PRAGMA_CLANG_WARN_DISABLE("-Wsign-compare")
177+# elif defined(__GNUC__)
178+# define IUTEST_PRAGMA_WARN_DISABLE_SIGN_COMPARE() IUTEST_PRAGMA_GCC_WARN_DISABLE("-Wsign-compare")
179+# elif defined(_MSC_VER)
180+# define IUTEST_PRAGMA_WARN_DISABLE_SIGN_COMPARE() IUTEST_PRAGMA_MSC_WARN_DISABLE(4389 4018)
181+# else
182+# define IUTEST_PRAGMA_WARN_DISABLE_SIGN_COMPARE()
183+# endif
183184 #endif
184185
185-#if defined(__clang__)
186-# define IUTEST_PRAGMA_WARN_DISABLE_EMPTY_BODY() IUTEST_PRAGMA_CLANG_WARN_DISABLE("-Wempty-body")
187-#elif defined(__GNUC__)
188-# define IUTEST_PRAGMA_WARN_DISABLE_EMPTY_BODY() IUTEST_PRAGMA_GCC_WARN_DISABLE("-Wempty-body")
189-#elif defined(_MSC_VER)
190-# define IUTEST_PRAGMA_WARN_DISABLE_EMPTY_BODY() IUTEST_PRAGMA_MSC_WARN_DISABLE(4390)
191-#else
192-# define IUTEST_PRAGMA_WARN_DISABLE_EMPTY_BODY()
186+#if !defined(IUTEST_PRAGMA_WARN_DISABLE_EMPTY_BODY)
187+# if defined(__clang__)
188+# define IUTEST_PRAGMA_WARN_DISABLE_EMPTY_BODY() IUTEST_PRAGMA_CLANG_WARN_DISABLE("-Wempty-body")
189+# elif defined(__GNUC__)
190+# define IUTEST_PRAGMA_WARN_DISABLE_EMPTY_BODY() IUTEST_PRAGMA_GCC_WARN_DISABLE("-Wempty-body")
191+# elif defined(_MSC_VER)
192+# define IUTEST_PRAGMA_WARN_DISABLE_EMPTY_BODY() IUTEST_PRAGMA_MSC_WARN_DISABLE(4390)
193+# else
194+# define IUTEST_PRAGMA_WARN_DISABLE_EMPTY_BODY()
195+# endif
193196 #endif
194197
195-#if defined(__clang__)
196-# define IUTEST_PRAGMA_WARN_FLOAT_EQUAL() IUTEST_PRAGMA_CLANG_WARN_DISABLE("-Wfloat-equal")
197-#elif defined(__GNUC__)
198-# define IUTEST_PRAGMA_WARN_FLOAT_EQUAL() IUTEST_PRAGMA_GCC_WARN_DISABLE("-Wfloat-equal")
199-#elif defined(_MSC_VER)
200-# define IUTEST_PRAGMA_WARN_FLOAT_EQUAL() // IUTEST_PRAGMA_MSC_WARN_DISABLE(?)
201-#else
202-# define IUTEST_PRAGMA_WARN_FLOAT_EQUAL()
198+#if !defined(IUTEST_PRAGMA_WARN_FLOAT_EQUAL)
199+# if defined(__clang__)
200+# define IUTEST_PRAGMA_WARN_FLOAT_EQUAL() IUTEST_PRAGMA_CLANG_WARN_DISABLE("-Wfloat-equal")
201+# elif defined(__GNUC__)
202+# define IUTEST_PRAGMA_WARN_FLOAT_EQUAL() IUTEST_PRAGMA_GCC_WARN_DISABLE("-Wfloat-equal")
203+# elif defined(_MSC_VER)
204+# define IUTEST_PRAGMA_WARN_FLOAT_EQUAL() // IUTEST_PRAGMA_MSC_WARN_DISABLE(?)
205+# else
206+# define IUTEST_PRAGMA_WARN_FLOAT_EQUAL()
207+# endif
203208 #endif
204209
205-#if defined(__clang__)
206-# define IUTEST_PRAGMA_WARN_FORMAT_NONLITERAL() IUTEST_PRAGMA_CLANG_WARN_DISABLE("-Wformat-nonliteral")
207-#elif defined(__GNUC__)
208-# define IUTEST_PRAGMA_WARN_FORMAT_NONLITERAL() IUTEST_PRAGMA_GCC_WARN_DISABLE("-Wformat-nonliteral")
209-#elif defined(_MSC_VER)
210-# define IUTEST_PRAGMA_WARN_FORMAT_NONLITERAL() // IUTEST_PRAGMA_MSC_WARN_DISABLE(?)
211-#else
212-# define IUTEST_PRAGMA_WARN_FORMAT_NONLITERAL()
210+#if !defined(IUTEST_PRAGMA_WARN_FORMAT_NONLITERAL)
211+# if defined(__clang__)
212+# define IUTEST_PRAGMA_WARN_FORMAT_NONLITERAL() IUTEST_PRAGMA_CLANG_WARN_DISABLE("-Wformat-nonliteral")
213+# elif defined(__GNUC__)
214+# define IUTEST_PRAGMA_WARN_FORMAT_NONLITERAL() IUTEST_PRAGMA_GCC_WARN_DISABLE("-Wformat-nonliteral")
215+# elif defined(_MSC_VER)
216+# define IUTEST_PRAGMA_WARN_FORMAT_NONLITERAL() // IUTEST_PRAGMA_MSC_WARN_DISABLE(?)
217+# else
218+# define IUTEST_PRAGMA_WARN_FORMAT_NONLITERAL()
219+# endif
213220 #endif
214221
215-#if defined(__clang__)
216-# define IUTEST_PRAGMA_WARN_CAST_ALIGN() IUTEST_PRAGMA_CLANG_WARN_DISABLE("-Wcast-align")
217-#elif defined(__GNUC__)
218-# define IUTEST_PRAGMA_WARN_CAST_ALIGN() IUTEST_PRAGMA_GCC_WARN_DISABLE("-Wcast-align")
219-#elif defined(_MSC_VER)
220-# define IUTEST_PRAGMA_WARN_CAST_ALIGN() // IUTEST_PRAGMA_MSC_WARN_DISABLE(?)
221-#else
222-# define IUTEST_PRAGMA_WARN_CAST_ALIGN()
222+#if !defined(IUTEST_PRAGMA_WARN_CAST_ALIGN)
223+# if defined(__clang__)
224+# define IUTEST_PRAGMA_WARN_CAST_ALIGN() IUTEST_PRAGMA_CLANG_WARN_DISABLE("-Wcast-align")
225+# elif defined(__GNUC__)
226+# define IUTEST_PRAGMA_WARN_CAST_ALIGN() IUTEST_PRAGMA_GCC_WARN_DISABLE("-Wcast-align")
227+# elif defined(_MSC_VER)
228+# define IUTEST_PRAGMA_WARN_CAST_ALIGN() // IUTEST_PRAGMA_MSC_WARN_DISABLE(?)
229+# else
230+# define IUTEST_PRAGMA_WARN_CAST_ALIGN()
231+# endif
223232 #endif
224233
225-#if defined(__clang__)
226-# define IUTEST_PRAGMA_WARN_CXX14_CONSTEXPR_NOT_IMPLY_CONST()
227-#elif defined(__GNUC__)
228-# define IUTEST_PRAGMA_WARN_CXX14_CONSTEXPR_NOT_IMPLY_CONST()
229-#elif defined(_MSC_VER)
230-# define IUTEST_PRAGMA_WARN_CXX14_CONSTEXPR_NOT_IMPLY_CONST() IUTEST_PRAGMA_MSC_WARN_DISABLE(4814)
231-#else
232-# define IUTEST_PRAGMA_WARN_CXX14_CONSTEXPR_NOT_IMPLY_CONST()
234+#if !defined(IUTEST_PRAGMA_WARN_CXX14_CONSTEXPR_NOT_IMPLY_CONST)
235+# if defined(__clang__)
236+# define IUTEST_PRAGMA_WARN_CXX14_CONSTEXPR_NOT_IMPLY_CONST()
237+# elif defined(__GNUC__)
238+# define IUTEST_PRAGMA_WARN_CXX14_CONSTEXPR_NOT_IMPLY_CONST()
239+# elif defined(_MSC_VER)
240+# define IUTEST_PRAGMA_WARN_CXX14_CONSTEXPR_NOT_IMPLY_CONST() IUTEST_PRAGMA_MSC_WARN_DISABLE(4814)
241+# else
242+# define IUTEST_PRAGMA_WARN_CXX14_CONSTEXPR_NOT_IMPLY_CONST()
243+# endif
233244 #endif
234245
235-#if defined(__clang__)
236-# if (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ > 0))
237-# define IUTEST_PRAGMA_WARN_DISABLE_DANGLING_ELSE() IUTEST_PRAGMA_CLANG_WARN_DISABLE("-Wdangling-else")
246+#if !defined(IUTEST_PRAGMA_WARN_DISABLE_DANGLING_ELSE)
247+# if defined(__clang__)
248+# if (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ > 0))
249+# define IUTEST_PRAGMA_WARN_DISABLE_DANGLING_ELSE() IUTEST_PRAGMA_CLANG_WARN_DISABLE("-Wdangling-else")
250+# endif
251+# elif defined(__GNUC__)
252+# if (__GNUC__ > 6)
253+# define IUTEST_PRAGMA_WARN_DISABLE_DANGLING_ELSE() IUTEST_PRAGMA_GCC_WARN_DISABLE("-Wdangling-else")
254+# endif
255+# elif defined(_MSC_VER)
256+# define IUTEST_PRAGMA_WARN_DISABLE_DANGLING_ELSE()
238257 # endif
239-#elif defined(__GNUC__)
240-# if (__GNUC__ > 6)
241-# define IUTEST_PRAGMA_WARN_DISABLE_DANGLING_ELSE() IUTEST_PRAGMA_GCC_WARN_DISABLE("-Wdangling-else")
242-# endif
243-#elif defined(_MSC_VER)
244-# define IUTEST_PRAGMA_WARN_DISABLE_DANGLING_ELSE()
245258 #endif
246259
247260 #if !defined(IUTEST_PRAGMA_WARN_DISABLE_DANGLING_ELSE)
@@ -248,8 +261,8 @@
248261 # define IUTEST_PRAGMA_WARN_DISABLE_DANGLING_ELSE()
249262 #endif
250263
251-#if defined(__GNUC__)
252-# if (__GNUC__ > 6)
264+#if !defined(IUTEST_PRAGMA_WARN_DISABLE_NOEXCEPT_TPYE)
265+# if defined(__GNUC__) && (__GNUC__ > 6)
253266 # define IUTEST_PRAGMA_WARN_DISABLE_NOEXCEPT_TPYE() IUTEST_PRAGMA_GCC_WARN_DISABLE("-Wnoexcept-type")
254267 # endif
255268 #endif
--- trunk/include/internal/iutest_stdlib.hpp (revision 1417)
+++ trunk/include/internal/iutest_stdlib.hpp (revision 1418)
@@ -279,7 +279,7 @@
279279 #endif
280280
281281 #if _MSC_VER >= 1916
282-# if !defined(IUTEST_HAS_CXX_HDR_CHARCONV)
282+# if !defined(IUTEST_HAS_CXX_HDR_CHARCONV) && IUTEST_HAS_CXX17
283283 # define IUTEST_HAS_CXX_HDR_CHARCONV 1
284284 # endif
285285 #endif
@@ -475,7 +475,7 @@
475475
476476 #if !defined(IUTEST_HAS_STD_TO_CHARS)
477477 # if defined(__cpp_lib_to_chars) && __cpp_lib_to_chars >= 201611
478-# define IUTEST_HAS_STD_TO_CHARS 1
478+# define IUTEST_HAS_STD_TO_CHARS 1
479479 # endif
480480 #endif
481481
--- trunk/include/iutest.hpp (revision 1417)
+++ trunk/include/iutest.hpp (revision 1418)
@@ -471,6 +471,8 @@
471471 # define IUTEST_ASSERT_STRCASENE(v1, v2) IUTEST_TEST_STRCASENE(v1, v2, IUTEST_ASSERT_FAILURE)
472472 #endif
473473
474+#if defined(IUTEST_OS_WINDOWS)
475+
474476 /**
475477 * @ingroup IUTEST_ASSERT_
476478 * @brief HRESULT の成功 テスト
@@ -496,6 +498,8 @@
496498 # endif
497499 #endif
498500
501+#endif
502+
499503 #if IUTEST_HAS_EXCEPTIONS
500504
501505 /**
@@ -867,6 +871,8 @@
867871 # define IUTEST_EXPECT_STRCASENE(v1, v2) IUTEST_TEST_STRCASENE(v1, v2, IUTEST_EXPECT_FAILURE)
868872 #endif
869873
874+#if defined(IUTEST_OS_WINDOWS)
875+
870876 /**
871877 * @ingroup IUTEST_EXPECT_
872878 * @brief HRESULT の成功 テスト
@@ -892,6 +898,8 @@
892898 # endif
893899 #endif
894900
901+#endif
902+
895903 #if IUTEST_HAS_EXCEPTIONS
896904
897905 /**
@@ -1273,6 +1281,8 @@
12731281 # define IUTEST_INFORM_STRCASENE(v1, v2) IUTEST_TEST_STRCASENE(v1, v2, IUTEST_INFORM_FAILURE)
12741282 #endif
12751283
1284+#if defined(IUTEST_OS_WINDOWS)
1285+
12761286 /**
12771287 * @ingroup IUTEST_INFORM_
12781288 * @brief HRESULT の成功 テスト
@@ -1298,6 +1308,8 @@
12981308 # endif
12991309 #endif
13001310
1311+#endif
1312+
13011313 #if IUTEST_HAS_EXCEPTIONS
13021314
13031315 /**
@@ -1661,6 +1673,8 @@
16611673 # define IUTEST_ASSUME_STRCASENE(v1, v2) IUTEST_TEST_STRCASENE(v1, v2, IUTEST_ASSUME_FAILURE)
16621674 #endif
16631675
1676+#if defined(IUTEST_OS_WINDOWS)
1677+
16641678 /**
16651679 * @ingroup IUTEST_ASSUME_
16661680 * @brief HRESULT の成功 テスト
@@ -1686,6 +1700,8 @@
16861700 # endif
16871701 #endif
16881702
1703+#endif
1704+
16891705 #if IUTEST_HAS_EXCEPTIONS
16901706
16911707 /**
--- trunk/include/iutest_config.hpp (revision 1417)
+++ trunk/include/iutest_config.hpp (revision 1418)
@@ -340,11 +340,7 @@
340340
341341 #if !defined(IUTEST_HAS_SPI_LAMBDA_SUPPORT)
342342 //! spi マクロで lambda を使って変数にアクセス可能かどうか
343-# if IUTEST_HAS_LAMBDA_STATEMENTS
344-# define IUTEST_HAS_SPI_LAMBDA_SUPPORT 1
345-# else
346-# define IUTEST_HAS_SPI_LAMBDA_SUPPORT 0
347-# endif
343+# define IUTEST_HAS_SPI_LAMBDA_SUPPORT IUTEST_HAS_LAMBDA_STATEMENTS
348344 #endif
349345
350346 #if !defined(IUTEST_HAS_CATCH_SEH_EXCEPTION_ASSERTION)
--- trunk/include/iutest_ver.hpp (revision 1417)
+++ trunk/include/iutest_ver.hpp (revision 1418)
@@ -17,11 +17,11 @@
1717
1818 //======================================================================
1919 // define
20-#define IUTEST_VER 0x01170011u //!< iutest version 1.17.0.11
20+#define IUTEST_VER 0x01170012u //!< iutest version 1.17.0.12
2121 #define IUTEST_MAJORVER 0x01u //!< Major Version
2222 #define IUTEST_MINORVER 0x17u //!< Minor Version
2323 #define IUTEST_MICROVER 0x00u //!< Micro Version
24-#define IUTEST_REVISION 0x11u //!< Revision
24+#define IUTEST_REVISION 0x12u //!< Revision
2525
2626 #define IUTEST_BUILD IUTEST_MICROVER //!< @deprecated
2727
@@ -124,9 +124,14 @@
124124 <li>v1.17.1.0
125125 <ul>
126126 <li>GTEST_SKIP 対応</li>
127+ <li>IUTEST_*_NE_RANGE アサーションを追加</li>
128+ <li>IUTEST_*_NE_COLLECTIONS アサーションを追加</li>
127129 <li>::std::wstring_view / ::std::u16string_view / ::std::u32string_view 対応</li>
128130 <li>アサーションに operator &lt;&lt; したときの出力を PrintToString したものと同じになるように変更</li>
129131 <li>テストをリピートした際のレポート出力ファイル名の書式を printf 書式から {I} に変更({I} にリピート回数が置換されます)</li>
132+ <li>iuwandbox: Wandbox 向けにサイズ圧縮したヘッダーをデフォルトで使用するように変更</li>
133+ <li>iuwandbox: 上記に伴いフルバージョンのヘッダーを使うオプション(--no-iutest-use-wandbox-min)を追加</li>
134+ <li>deprecated: iuwandbox: --iutest-use-wandbox-min</li>
130135 <li>Python2 のサポート終了</li>
131136 <li>C++20 で削除された basic_ostream::operator &lt;&lt; に対応</li>
132137 <li>IUTEST_AP が同じ名前空間に複数定義できない問題を修正</li>
--- trunk/include/util/iutest_util_assertion.hpp (revision 1417)
+++ trunk/include/util/iutest_util_assertion.hpp (revision 1418)
@@ -68,6 +68,51 @@
6868
6969 /**
7070 * @ingroup IUTEST_ASSERT_
71+ * @brief == テスト(collection)
72+ * @param b1 = 期待値の先頭
73+ * @param e1 = 期待値の終端
74+ * @param b2 = 検査対象の先頭
75+ * @param e2 = 検査対象の終端
76+*/
77+#ifndef IUTEST_ASSERT_NE_COLLECTIONS
78+# define IUTEST_ASSERT_NE_COLLECTIONS(b1, e1, b2, e2) IUTEST_TEST_NE_COLLECTIONS(b1, e1, b2, e2, IUTEST_ASSERT_FAILURE)
79+#endif
80+/**
81+ * @ingroup IUTEST_EXPECT_
82+ * @brief == テスト(collection)
83+ * @param b1 = 期待値の先頭
84+ * @param e1 = 期待値の終端
85+ * @param b2 = 検査対象の先頭
86+ * @param e2 = 検査対象の終端
87+*/
88+#ifndef IUTEST_EXPECT_NE_COLLECTIONS
89+# define IUTEST_EXPECT_NE_COLLECTIONS(b1, e1, b2, e2) IUTEST_TEST_NE_COLLECTIONS(b1, e1, b2, e2, IUTEST_EXPECT_FAILURE)
90+#endif
91+/**
92+ * @ingroup IUTEST_INFORM_
93+ * @brief == テスト(collection)
94+ * @param b1 = 期待値の先頭
95+ * @param e1 = 期待値の終端
96+ * @param b2 = 検査対象の先頭
97+ * @param e2 = 検査対象の終端
98+*/
99+#ifndef IUTEST_INFORM_NE_COLLECTIONS
100+# define IUTEST_INFORM_NE_COLLECTIONS(b1, e1, b2, e2) IUTEST_TEST_NE_COLLECTIONS(b1, e1, b2, e2, IUTEST_INFORM_FAILURE)
101+#endif
102+/**
103+ * @ingroup IUTEST_ASSUME_
104+ * @brief == テスト(collection)
105+ * @param b1 = 期待値の先頭
106+ * @param e1 = 期待値の終端
107+ * @param b2 = 検査対象の先頭
108+ * @param e2 = 検査対象の終端
109+*/
110+#ifndef IUTEST_ASSUME_NE_COLLECTIONS
111+# define IUTEST_ASSUME_NE_COLLECTIONS(b1, e1, b2, e2) IUTEST_TEST_NE_COLLECTIONS(b1, e1, b2, e2, IUTEST_ASSUME_FAILURE)
112+#endif
113+
114+/**
115+ * @ingroup IUTEST_ASSERT_
71116 * @brief == テスト(range)
72117 * @param expected = 期待値
73118 * @param actual = 検査対象
@@ -105,6 +150,43 @@
105150
106151 /**
107152 * @ingroup IUTEST_ASSERT_
153+ * @brief == テスト(range)
154+ * @param expected = 期待値
155+ * @param actual = 検査対象
156+*/
157+#ifndef IUTEST_ASSERT_NE_RANGE
158+# define IUTEST_ASSERT_NE_RANGE(expected, actual) IUTEST_TEST_NE_RANGE(expected, actual, IUTEST_ASSERT_FAILURE)
159+#endif
160+/**
161+ * @ingroup IUTEST_EXPECT_
162+ * @brief == テスト(range)
163+ * @param expected = 期待値
164+ * @param actual = 検査対象
165+*/
166+#ifndef IUTEST_EXPECT_NE_RANGE
167+# define IUTEST_EXPECT_NE_RANGE(expected, actual) IUTEST_TEST_NE_RANGE(expected, actual, IUTEST_EXPECT_FAILURE)
168+#endif
169+/**
170+ * @ingroup IUTEST_INFORM_
171+ * @brief == テスト(range)
172+ * @param expected = 期待値
173+ * @param actual = 検査対象
174+*/
175+#ifndef IUTEST_INFORM_NE_RANGE
176+# define IUTEST_INFORM_NE_RANGE(expected, actual) IUTEST_TEST_NE_RANGE(expected, actual, IUTEST_INFORM_FAILURE)
177+#endif
178+/**
179+ * @ingroup IUTEST_ASSUME_
180+ * @brief == テスト(range)
181+ * @param expected = 期待値
182+ * @param actual = 検査対象
183+*/
184+#ifndef IUTEST_ASSUME_NE_RANGE
185+# define IUTEST_ASSUME_NE_RANGE(expected, actual) IUTEST_TEST_NE_RANGE(expected, actual, IUTEST_ASSUME_FAILURE)
186+#endif
187+
188+/**
189+ * @ingroup IUTEST_ASSERT_
108190 * @brief 文字列長の一致 テスト
109191 * @param len = 期待文字列長
110192 * @param v2 = 検査対象
@@ -394,25 +476,33 @@
394476 #ifndef IUTEST_NO_UTIL_ASSERTION_GTEST_COMPATIBLE
395477
396478 #define ASSERT_EQ_COLLECTIONS IUTEST_ASSERT_EQ_COLLECTIONS
479+#define ASSERT_NE_COLLECTIONS IUTEST_ASSERT_NE_COLLECTIONS
397480 #define ASSERT_EQ_RANGE IUTEST_ASSERT_EQ_RANGE
481+#define ASSERT_NE_RANGE IUTEST_ASSERT_NE_RANGE
398482 #define ASSERT_STRLNEQ IUTEST_ASSERT_STRLNEQ
399483 #define ASSERT_STRIN IUTEST_ASSERT_STRIN
400484 #define ASSERT_STRNOTIN IUTEST_ASSERT_STRNOTIN
401485
402486 #define EXPECT_EQ_COLLECTIONS IUTEST_EXPECT_EQ_COLLECTIONS
487+#define EXPECT_NE_COLLECTIONS IUTEST_EXPECT_NE_COLLECTIONS
403488 #define EXPECT_EQ_RANGE IUTEST_EXPECT_EQ_RANGE
489+#define EXPECT_NE_RANGE IUTEST_EXPECT_NE_RANGE
404490 #define EXPECT_STRLNEQ IUTEST_EXPECT_STRLNEQ
405491 #define EXPECT_STRIN IUTEST_EXPECT_STRIN
406492 #define EXPECT_STRNOTIN IUTEST_EXPECT_STRNOTIN
407493
408494 #define INFORM_EQ_COLLECTIONS IUTEST_INFORM_EQ_COLLECTIONS
495+#define INFORM_NE_COLLECTIONS IUTEST_INFORM_NE_COLLECTIONS
409496 #define INFORM_EQ_RANGE IUTEST_INFORM_EQ_RANGE
497+#define INFORM_NE_RANGE IUTEST_INFORM_NE_RANGE
410498 #define INFORM_STRLNEQ IUTEST_INFORM_STRLNEQ
411499 #define INFORM_STRIN IUTEST_INFORM_STRIN
412500 #define INFORM_STRNOTIN IUTEST_INFORM_STRNOTIN
413501
414502 #define ASSUME_EQ_COLLECTIONS IUTEST_ASSUME_EQ_COLLECTIONS
503+#define ASSUME_NE_COLLECTIONS IUTEST_ASSUME_NE_COLLECTIONS
415504 #define ASSUME_EQ_RANGE IUTEST_ASSUME_EQ_RANGE
505+#define ASSUME_NE_RANGE IUTEST_ASSUME_NE_RANGE
416506 #define ASSUME_STRLNEQ IUTEST_ASSUME_STRLNEQ
417507 #define ASSUME_STRIN IUTEST_ASSUME_STRIN
418508 #define ASSUME_STRNOTIN IUTEST_ASSUME_STRNOTIN
@@ -452,7 +542,9 @@
452542 * @{
453543 */
454544 #define IUTEST_TEST_EQ_COLLECTIONS(b1, e1, b2, e2, on_failure) IUTEST_PRED_FORMAT4_( ::iuutil::CmpHelperEqCollections, b1, e1, b2, e2, on_failure)
545+#define IUTEST_TEST_NE_COLLECTIONS(b1, e1, b2, e2, on_failure) IUTEST_PRED_FORMAT4_( ::iuutil::CmpHelperNeCollections, b1, e1, b2, e2, on_failure)
455546 #define IUTEST_TEST_EQ_RANGE(expected, actual, on_failure) IUTEST_PRED_FORMAT2_( ::iuutil::CmpHelperEqRange, expected, actual, on_failure)
547+#define IUTEST_TEST_NE_RANGE(expected, actual, on_failure) IUTEST_PRED_FORMAT2_( ::iuutil::CmpHelperNeRange, expected, actual, on_failure)
456548
457549 #define IUTEST_TEST_STRLNEQ(len, v2, on_failure) IUTEST_PRED_FORMAT2_( ::iuutil::CmpHelperSTRLNEQ, len, v2, on_failure )
458550 #define IUTEST_TEST_STRIN(substr, actual, on_failure) IUTEST_PRED_FORMAT2_( ::iuutil::CmpHelperSTRIN, substr, actual, on_failure )
@@ -517,6 +609,35 @@
517609 return ::iutest::AssertionSuccess();
518610 }
519611
612+template<typename T1, typename T2>
613+::iutest::AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelperNeIterator(T1 b1, T1 e1, T2 b2, T2 e2)
614+{
615+ int elem=0;
616+ bool result = false;
617+ ::iutest::Message ar;
618+ for(elem=0; b1 != e1 && b2 != e2; ++b1, ++b2, ++elem)
619+ {
620+ if(!::iutest::internal::backward::NeHelper<false>::Compare("", "", *b1, *b2))
621+ {
622+ ar << ::iutest::internal::FormatForComparisonFailureMessage(*b1, *b2);
623+ }
624+ else
625+ {
626+ result = true;
627+ }
628+ }
629+ if( (b1 != e1) || (b2 != e2) )
630+ {
631+ result = true;
632+ }
633+ if( !result )
634+ {
635+ return ::iutest::AssertionFailure() << ar;
636+ }
637+ return ::iutest::AssertionSuccess();
638+}
639+
640+
520641 /**
521642 * @brief Equal Collection Helper
522643 */
@@ -536,6 +657,25 @@
536657 }
537658 }
538659
660+/**
661+ * @brief Equal Collection Helper
662+*/
663+template<typename T1, typename T2>
664+::iutest::AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelperNeCollections(const char* expr1b, const char* expr1e
665+ , const char* expr2b, const char* expr2e
666+ , T1 b1, T1 e1, T2 b2, T2 e2)
667+{
668+ if( ::iutest::AssertionResult ar = CmpHelperNeIterator(b1, e1, b2, e2) )
669+ {
670+ return ::iutest::AssertionSuccess();
671+ }
672+ else
673+ {
674+ return ::iutest::AssertionFailure() << "error: Expected: { " << expr1b << ", " << expr1e << " } != { "
675+ << expr2b << ", " << expr2e << " }\n Actual:" << GetAssertionResultMessage(ar);
676+ }
677+}
678+
539679 namespace detail
540680 {
541681
@@ -569,6 +709,26 @@
569709 }
570710
571711 /**
712+ * @brief Not Equal Range Helper
713+*/
714+template<typename T1, typename T2>
715+::iutest::AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelperNeRange(const char* expected_expr, const char* actual_expr
716+ , const T1& expected, const T2& actual)
717+{
718+ IUTEST_USING_BEGIN_END();
719+ if( ::iutest::AssertionResult ar =
720+ CmpHelperNeIterator(begin(expected), end(expected), begin(actual), end(actual)))
721+ {
722+ return ::iutest::AssertionSuccess();
723+ }
724+ else
725+ {
726+ return ::iutest::AssertionFailure() << "error: Expected: " << expected_expr << " != " << actual_expr
727+ << " \n Actual:" << ::iutest::internal::FormatForComparisonFailureMessage(expected, actual);
728+ }
729+}
730+
731+/**
572732 * @brief 文字列長アサーションフォーマッター
573733 */
574734 inline ::iutest::AssertionResult IUTEST_ATTRIBUTE_UNUSED_ CmpHelperSTRLNEQ(const char* expr1, const char* expr2
--- trunk/peak_flow.yml (revision 1417)
+++ trunk/peak_flow.yml (revision 1418)
@@ -5,4 +5,5 @@
55 - clang --version || true
66 script:
77 - make -C test -j4 CXXFLAGS=-ftime-report
8- # - make -C test test
8+ - make -C test test
9+ - make -C test report
--- trunk/samples/assertion.cpp (revision 1417)
+++ trunk/samples/assertion.cpp (revision 1418)
@@ -71,12 +71,6 @@
7171 ::std::vector<int> v1, v2;
7272 IUTEST_EXPECT_EQ(v1, v2);
7373 }
74- // EQ_COLLECTIONS
75- {
76- int a[] = { 0, 1, 2, 3 };
77- int b[] = { 0, 1, 2, 3 };
78- IUTEST_ASSERT_EQ_COLLECTIONS(a, a+4, b, b+4);
79- }
8074
8175 // NE
8276 {
@@ -142,13 +136,23 @@
142136 }
143137 // EQ_COLLECTIONS/EQ_RANGE
144138 {
145- int aa[] ={ 0, 1, 2, 3, 4 };
146- int ab[] ={ 0, 1, 2, 3, 4 };
139+ int aa[] ={ 0, 1, 2, 3, 4 };
140+ int ab[] ={ 0, 1, 2, 3, 4 };
147141 IUTEST_EXPECT_EQ_COLLECTIONS(aa, aa+(sizeof(aa)/sizeof(aa[0])), ab, ab+(sizeof(ab)/sizeof(ab[0])));
148142 #if !defined(IUTEST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
149143 IUTEST_EXPECT_EQ_RANGE(aa, ab);
150144 #endif
151145 }
146+ // NE_COLLECTIONS/NE_RANGE
147+ // NE_COLLECTIONS
148+ {
149+ int aa[] ={ 0, 1, 2, 3, 4 };
150+ int ab[] ={ 9, 1, 2, 3, 4 };
151+ IUTEST_EXPECT_NE_COLLECTIONS(aa, aa+(sizeof(aa)/sizeof(aa[0])), ab, ab+(sizeof(ab)/sizeof(ab[0])));
152+#if !defined(IUTEST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
153+ IUTEST_EXPECT_NE_RANGE(aa, ab);
154+#endif
155+ }
152156 }
153157
154158 #if !defined(IUTEST_USE_GTEST)
--- trunk/shippable.yml (revision 1417)
+++ trunk/shippable.yml (revision 1418)
@@ -19,12 +19,4 @@
1919 - make showcxxversion
2020 - make -j2
2121 - make test
22-
23-integrations:
24- notifications:
25- - integrationName: email
26- type: email
27- recipients:
28- - zumix.cpp@gmail.com
29- on_success: change
30- on_failure: always
22+ - make report
--- trunk/test/spi_tests.cpp (revision 1417)
+++ trunk/test/spi_tests.cpp (revision 1418)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2012-2019, Takazumi Shirayanagi\n
9+ * Copyright (C) 2012-2020, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -39,6 +39,7 @@
3939 const float fa;
4040 const double da;
4141 int aa[5];
42+ int aa2[5];
4243 int ab[6];
4344 char ac[5];
4445 const ::std::string sa;
@@ -60,7 +61,7 @@
6061 const char ac_[5] = { 0, 0, 2, 3, 5 };
6162 for( int i=0; i < 5; ++i )
6263 {
63- aa[i] = ab[i] = i;
64+ aa[i] = aa2[i] = ab[i] = i;
6465 ac[i] = ac_[i];
6566 }
6667 ab[5] = 5;
@@ -76,6 +77,7 @@
7677 const char* null_str = NULL;
7778 const int a=0, b=0;
7879 const int aa[] = { 0, 1, 2, 3, 4 };
80+const int aa2[] = { 0, 1, 2, 3, 4 };
7981 const int ab[] = { 0, 1, 2, 3, 4, 5 };
8082 const char ac[] = { 0, 0, 2, 3, 5 };
8183 const ::std::string sa="a";
--- trunk/test/spi_tests_decl.cpp (revision 1417)
+++ trunk/test/spi_tests_decl.cpp (revision 1418)
@@ -118,10 +118,14 @@
118118 FAILURE_MACRO( FLAVOR(_EQ_COLLECTIONS)(ab, ab+(sizeof(ab)/sizeof(ab[0])), aa, aa+(sizeof(aa)/sizeof(aa[0]))), "Mismatch element" );
119119 FAILURE_MACRO( FLAVOR(_EQ_COLLECTIONS)(aa, aa+(sizeof(aa)/sizeof(aa[0])), ac, ac+(sizeof(ac)/sizeof(ac[0]))), "Mismatch in a position" );
120120
121+ FAILURE_MACRO( FLAVOR(_NE_COLLECTIONS)(aa, aa+(sizeof(aa)/sizeof(aa[0])), aa2, aa2+(sizeof(aa2)/sizeof(aa2[0]))), "!=" );
122+
121123 FAILURE_MACRO( FLAVOR(_EQ_RANGE)(aa, ab), "Mismatch element" );
122124 FAILURE_MACRO( FLAVOR(_EQ_RANGE)(ab, aa), "Mismatch element" );
123125 FAILURE_MACRO( FLAVOR(_EQ_RANGE)(aa, ac), "Mismatch in a position" );
124126
127+ FAILURE_MACRO( FLAVOR(_NE_RANGE)(aa, aa2), "!=" );
128+
125129 #if IUTEST_HAS_REGEX
126130 FAILURE_MACRO( FLAVOR(_MATCHES_REGEXEQ)("te[0-9]*st", "te0123sta"), "Matches Regex (\"te[0-9]*st\")" );
127131 FAILURE_MACRO( FLAVOR(_MATCHES_REGEXEQ)("te[0-9]*st", null_str), "Matches Regex (\"te[0-9]*st\")" );
--- trunk/test/syntax_gtest_tests.cpp (revision 1417)
+++ trunk/test/syntax_gtest_tests.cpp (revision 1418)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2014-2018 Takazumi Shirayanagi\n
9+ * Copyright (C) 2014-2020 Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -61,8 +61,8 @@
6161
6262 TEST(GTestSyntaxTest, EQ_COLLECTIONS)
6363 {
64- int a[] = { 0, 1, 2, 3, 4 };
65- int b[] = { 0, 1, 2, 3, 4 };
64+ int a[] = { 0, 1, 2, 3, 4 };
65+ int b[] = { 0, 1, 2, 3, 4 };
6666
6767 if( int size = (sizeof(a)/sizeof(a[0])) )
6868 ASSERT_EQ_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0]))) << size;
@@ -74,10 +74,25 @@
7474 ASSUME_EQ_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0]))) << size;
7575 }
7676
77+TEST(GTestSyntaxTest, NE_COLLECTIONS)
78+{
79+ int a[] = { 0, 1, 2, 3, 4 };
80+ int b[] = { 0, 2, 2, 3, 4 };
81+
82+ if( int size = (sizeof(a)/sizeof(a[0])) )
83+ ASSERT_NE_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0]))) << size;
84+ if( int size = (sizeof(a)/sizeof(a[0])) )
85+ EXPECT_NE_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0]))) << size;
86+ if( int size = (sizeof(a)/sizeof(a[0])) )
87+ INFORM_NE_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0]))) << size;
88+ if( int size = (sizeof(a)/sizeof(a[0])) )
89+ ASSUME_NE_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0]))) << size;
90+}
91+
7792 TEST(GTestSyntaxTest, EQ_RANGE)
7893 {
79- int a[] = { 0, 1, 2, 3, 4 };
80- int b[] = { 0, 1, 2, 3, 4 };
94+ int a[] = { 0, 1, 2, 3, 4 };
95+ int b[] = { 0, 1, 2, 3, 4 };
8196
8297 if( int size = (sizeof(a)/sizeof(a[0])) )
8398 ASSERT_EQ_RANGE(a, b) << size;
@@ -89,6 +104,21 @@
89104 ASSUME_EQ_RANGE(a, b) << size;
90105 }
91106
107+TEST(GTestSyntaxTest, NE_RANGE)
108+{
109+ int a[] = { 0, 1, 2, 3, 4 };
110+ int b[] = { 0, 1, 2, 1, 4 };
111+
112+ if( int size = (sizeof(a)/sizeof(a[0])) )
113+ ASSERT_NE_RANGE(a, b) << size;
114+ if( int size = (sizeof(a)/sizeof(a[0])) )
115+ EXPECT_NE_RANGE(a, b) << size;
116+ if( int size = (sizeof(a)/sizeof(a[0])) )
117+ INFORM_NE_RANGE(a, b) << size;
118+ if( int size = (sizeof(a)/sizeof(a[0])) )
119+ ASSUME_NE_RANGE(a, b) << size;
120+}
121+
92122 TEST(GTestSyntaxTest, NE)
93123 {
94124 if( int x = 1 )
--- trunk/test/syntax_tests.cpp (revision 1417)
+++ trunk/test/syntax_tests.cpp (revision 1418)
@@ -102,8 +102,8 @@
102102
103103 IUTEST(SyntaxTest, EQ_COLLECTIONS)
104104 {
105- int a[] = { 0, 1, 2, 3, 4 };
106- int b[] = { 0, 1, 2, 3, 4 };
105+ int a[] = { 0, 1, 2, 3, 4 };
106+ int b[] = { 0, 1, 2, 3, 4 };
107107
108108 if( int size = (sizeof(a)/sizeof(a[0])) )
109109 IUTEST_ASSERT_EQ_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0]))) << size;
@@ -115,10 +115,25 @@
115115 IUTEST_ASSUME_EQ_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0]))) << size;
116116 }
117117
118+IUTEST(SyntaxTest, NE_COLLECTIONS)
119+{
120+ int a[] = { 0, 1, 2, 3, 4 };
121+ int b[] = { 0, 1, 5, 3, 4 };
122+
123+ if( int size = (sizeof(a)/sizeof(a[0])) )
124+ IUTEST_ASSERT_NE_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0]))) << size;
125+ if( int size = (sizeof(a)/sizeof(a[0])) )
126+ IUTEST_EXPECT_NE_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0]))) << size;
127+ if( int size = (sizeof(a)/sizeof(a[0])) )
128+ IUTEST_INFORM_NE_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0]))) << size;
129+ if( int size = (sizeof(a)/sizeof(a[0])) )
130+ IUTEST_ASSUME_NE_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0]))) << size;
131+}
132+
118133 IUTEST(SyntaxTest, EQ_RANGE)
119134 {
120- int a[] = { 0, 1, 2, 3, 4 };
121- int b[] = { 0, 1, 2, 3, 4 };
135+ int a[] = { 0, 1, 2, 3, 4 };
136+ int b[] = { 0, 1, 2, 3, 4 };
122137
123138 if( int size = (sizeof(a)/sizeof(a[0])) )
124139 IUTEST_ASSERT_EQ_RANGE(a, b) << size;
@@ -130,6 +145,21 @@
130145 IUTEST_ASSUME_EQ_RANGE(a, b) << size;
131146 }
132147
148+IUTEST(SyntaxTest, NE_RANGE)
149+{
150+ int a[] = { 0, 1, 2, 3, 4 };
151+ int b[] = { 0, 1, 0, 3, 4 };
152+
153+ if( int size = (sizeof(a)/sizeof(a[0])) )
154+ IUTEST_ASSERT_NE_RANGE(a, b) << size;
155+ if( int size = (sizeof(a)/sizeof(a[0])) )
156+ IUTEST_EXPECT_NE_RANGE(a, b) << size;
157+ if( int size = (sizeof(a)/sizeof(a[0])) )
158+ IUTEST_INFORM_NE_RANGE(a, b) << size;
159+ if( int size = (sizeof(a)/sizeof(a[0])) )
160+ IUTEST_ASSUME_NE_RANGE(a, b) << size;
161+}
162+
133163 IUTEST(SyntaxTest, NE)
134164 {
135165 if( int x = 1 )
--- trunk/test/unit_misc_tests.cpp (revision 1417)
+++ trunk/test/unit_misc_tests.cpp (revision 1418)
@@ -2,11 +2,11 @@
22 //-----------------------------------------------------------------------
33 /**
44 * @file unit_misc_tests.cpp
5- * @brief iutest test
5+ * @brief iutest misc test
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2013-2019, Takazumi Shirayanagi\n
9+ * Copyright (C) 2013-2020, Takazumi Shirayanagi\n
1010 * The new BSD License is applied to this software.
1111 * see LICENSE
1212 */
@@ -37,3 +37,19 @@
3737 ::iutest::any a = "test";
3838 IUTEST_EXPECT_EQ("test", ::iutest::any_cast< ::std::string >(a));
3939 }
40+
41+IUTEST(UnitRandomTest, Size64)
42+{
43+ ::iutest::detail::iuRandom r;
44+ iutest::UInt64 x[10];
45+ for( int i=0; i < 10; ++i)
46+ {
47+ x[i] = r.genrand<iutest::UInt64>() >> 32;
48+ }
49+ iutest::UInt64 y[10];
50+ for( int i=0; i < 10; ++i)
51+ {
52+ y[i] = r.genrand<iutest::UInt64>() >> 32;
53+ }
54+ IUTEST_EXPECT_NE_RANGE(x, y);
55+}
--- trunk/test/util_tests.cpp (revision 1417)
+++ trunk/test/util_tests.cpp (revision 1418)
@@ -6,7 +6,7 @@
66 *
77 * @author t.shirayanagi
88 * @par copyright
9- * Copyright (C) 2012-2016, Takazumi Shirayanagi\n
9+ * Copyright (C) 2012-2020, Takazumi Shirayanagi\n
1010 * This software is released under the new BSD License,
1111 * see LICENSE
1212 */
@@ -51,110 +51,162 @@
5151 IUTEST_EXPECT_STREQ( "TestCase" , ::iuutil::TestCaseNameRemoveInstantiateAndIndexName("prefix/TestCase/0") );
5252 }
5353
54-IUTEST(AssertionTest, EQ_COLLECTIONS)
54+IUTEST(AssertionTest, EQ_COLLECTIONS_Array)
5555 {
56- {
57- int a[] = { 0, 1, 2, 3, 4 };
58- int b[] = { 0, 1, 2, 3, 4 };
59- char c[] = { 0, 1, 2, 3, 4 };
56+ int a[] = { 0, 1, 2, 3, 4 };
57+ int b[] = { 0, 1, 2, 3, 4 };
58+ char c[] = { 0, 1, 2, 3, 4 };
6059
61- IUTEST_ASSERT_EQ_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0])));
62- IUTEST_EXPECT_EQ_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0])));
63- IUTEST_INFORM_EQ_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0])));
64- IUTEST_ASSUME_EQ_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0])));
60+ IUTEST_ASSERT_EQ_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0])));
61+ IUTEST_EXPECT_EQ_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0])));
62+ IUTEST_INFORM_EQ_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0])));
63+ IUTEST_ASSUME_EQ_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0])));
6564
66- IUTEST_ASSERT_EQ_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), c, c+(sizeof(c)/sizeof(c[0])));
67- IUTEST_EXPECT_EQ_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), c, c+(sizeof(c)/sizeof(c[0])));
68- IUTEST_INFORM_EQ_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), c, c+(sizeof(c)/sizeof(c[0])));
69- IUTEST_ASSUME_EQ_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), c, c+(sizeof(c)/sizeof(c[0])));
70- }
65+ IUTEST_ASSERT_EQ_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), c, c+(sizeof(c)/sizeof(c[0])));
66+ IUTEST_EXPECT_EQ_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), c, c+(sizeof(c)/sizeof(c[0])));
67+ IUTEST_INFORM_EQ_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), c, c+(sizeof(c)/sizeof(c[0])));
68+ IUTEST_ASSUME_EQ_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), c, c+(sizeof(c)/sizeof(c[0])));
69+}
7170
71+IUTEST(AssertionTest, EQ_COLLECTIONS_Vector)
72+{
73+ int d[] = { 0, 1, 2, 3, 4 };
74+ const int COUNT=sizeof(d)/sizeof(d[0]);
75+ ::std::vector<int> a, b;
76+ ::std::vector<char> c;
77+ for( int i=0; i < COUNT; ++i )
7278 {
73- int d[] = { 0, 1, 2, 3, 4 };
74- const int COUNT=sizeof(d)/sizeof(d[0]);
75- ::std::vector<int> a, b;
76- ::std::vector<char> c;
77- for( int i=0; i < COUNT; ++i )
78- {
79- a.push_back(i);
80- b.push_back(i);
81- c.push_back(static_cast<char>(i));
82- }
83- IUTEST_ASSERT_EQ_COLLECTIONS(a.begin(), a.end(), b.begin(), b.end());
84- IUTEST_EXPECT_EQ_COLLECTIONS(a.begin(), a.end(), b.begin(), b.end());
85- IUTEST_INFORM_EQ_COLLECTIONS(a.begin(), a.end(), b.begin(), b.end());
86- IUTEST_ASSUME_EQ_COLLECTIONS(a.begin(), a.end(), b.begin(), b.end());
79+ a.push_back(i);
80+ b.push_back(i);
81+ c.push_back(static_cast<char>(i));
82+ }
83+ IUTEST_ASSERT_EQ_COLLECTIONS(a.begin(), a.end(), b.begin(), b.end());
84+ IUTEST_EXPECT_EQ_COLLECTIONS(a.begin(), a.end(), b.begin(), b.end());
85+ IUTEST_INFORM_EQ_COLLECTIONS(a.begin(), a.end(), b.begin(), b.end());
86+ IUTEST_ASSUME_EQ_COLLECTIONS(a.begin(), a.end(), b.begin(), b.end());
8787
88- IUTEST_ASSERT_EQ_COLLECTIONS(a.begin(), a.end(), c.begin(), c.end());
89- IUTEST_EXPECT_EQ_COLLECTIONS(a.begin(), a.end(), c.begin(), c.end());
90- IUTEST_INFORM_EQ_COLLECTIONS(a.begin(), a.end(), c.begin(), c.end());
91- IUTEST_ASSUME_EQ_COLLECTIONS(a.begin(), a.end(), c.begin(), c.end());
88+ IUTEST_ASSERT_EQ_COLLECTIONS(a.begin(), a.end(), c.begin(), c.end());
89+ IUTEST_EXPECT_EQ_COLLECTIONS(a.begin(), a.end(), c.begin(), c.end());
90+ IUTEST_INFORM_EQ_COLLECTIONS(a.begin(), a.end(), c.begin(), c.end());
91+ IUTEST_ASSUME_EQ_COLLECTIONS(a.begin(), a.end(), c.begin(), c.end());
9292
93- IUTEST_ASSERT_EQ_COLLECTIONS(a.begin(), a.end(), d, d+(sizeof(d)/sizeof(d[0])));
94- IUTEST_EXPECT_EQ_COLLECTIONS(a.begin(), a.end(), d, d+(sizeof(d)/sizeof(d[0])));
95- IUTEST_INFORM_EQ_COLLECTIONS(a.begin(), a.end(), d, d+(sizeof(d)/sizeof(d[0])));
96- IUTEST_ASSUME_EQ_COLLECTIONS(a.begin(), a.end(), d, d+(sizeof(d)/sizeof(d[0])));
97- }
93+ IUTEST_ASSERT_EQ_COLLECTIONS(a.begin(), a.end(), d, d+(sizeof(d)/sizeof(d[0])));
94+ IUTEST_EXPECT_EQ_COLLECTIONS(a.begin(), a.end(), d, d+(sizeof(d)/sizeof(d[0])));
95+ IUTEST_INFORM_EQ_COLLECTIONS(a.begin(), a.end(), d, d+(sizeof(d)/sizeof(d[0])));
96+ IUTEST_ASSUME_EQ_COLLECTIONS(a.begin(), a.end(), d, d+(sizeof(d)/sizeof(d[0])));
9897 }
9998
100-IUTEST(AssertionTest, EQ_RANGE)
99+IUTEST(AssertionTest, NE_COLLECTIONS)
101100 {
102- {
103- int a[] = { 0, 1, 2, 3, 4 };
104- int b[] = { 0, 1, 2, 3, 4 };
105- char c[] = { 0, 1, 2, 3, 4 };
101+ int a[] = { 0, 1, 2, 3, 4 };
102+ int b[] = { 0, 1, 2, 3, 4, 5 };
103+ char c[] = { 0, 1, 2, 1, 4 };
104+ ::std::vector<int> d(b+1, b+(sizeof(b)/sizeof(b[0])));
106105
107- IUTEST_ASSERT_EQ_RANGE(a, b);
108- IUTEST_EXPECT_EQ_RANGE(a, b);
109- IUTEST_INFORM_EQ_RANGE(a, b);
110- IUTEST_ASSUME_EQ_RANGE(a, b);
106+ IUTEST_ASSERT_NE_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0])));
107+ IUTEST_EXPECT_NE_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0])));
108+ IUTEST_INFORM_NE_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0])));
109+ IUTEST_ASSUME_NE_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), b, b+(sizeof(b)/sizeof(b[0])));
111110
112- IUTEST_ASSERT_EQ_RANGE(a, c);
113- IUTEST_EXPECT_EQ_RANGE(a, c);
114- IUTEST_INFORM_EQ_RANGE(a, c);
115- IUTEST_ASSUME_EQ_RANGE(a, c);
111+ IUTEST_ASSERT_NE_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), c, c+(sizeof(c)/sizeof(c[0])));
112+ IUTEST_EXPECT_NE_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), c, c+(sizeof(c)/sizeof(c[0])));
113+ IUTEST_INFORM_NE_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), c, c+(sizeof(c)/sizeof(c[0])));
114+ IUTEST_ASSUME_NE_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), c, c+(sizeof(c)/sizeof(c[0])));
115+
116+ IUTEST_ASSERT_NE_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), d.begin(), d.end());
117+ IUTEST_EXPECT_NE_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), d.begin(), d.end());
118+ IUTEST_INFORM_NE_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), d.begin(), d.end());
119+ IUTEST_ASSUME_NE_COLLECTIONS(a, a+(sizeof(a)/sizeof(a[0])), d.begin(), d.end());
120+}
121+
122+IUTEST(AssertionTest, EQ_RANGE_Array)
123+{
124+ int a[] = { 0, 1, 2, 3, 4 };
125+ int b[] = { 0, 1, 2, 3, 4 };
126+ char c[] = { 0, 1, 2, 3, 4 };
127+
128+ IUTEST_ASSERT_EQ_RANGE(a, b);
129+ IUTEST_EXPECT_EQ_RANGE(a, b);
130+ IUTEST_INFORM_EQ_RANGE(a, b);
131+ IUTEST_ASSUME_EQ_RANGE(a, b);
132+
133+ IUTEST_ASSERT_EQ_RANGE(a, c);
134+ IUTEST_EXPECT_EQ_RANGE(a, c);
135+ IUTEST_INFORM_EQ_RANGE(a, c);
136+ IUTEST_ASSUME_EQ_RANGE(a, c);
116137 #if IUTEST_HAS_INITIALIZER_LIST
117- IUTEST_ASSERT_EQ_RANGE(::std::initializer_list<int>({0, 1, 2, 3, 4}), a);
138+ IUTEST_ASSERT_EQ_RANGE(::std::initializer_list<int>({0, 1, 2, 3, 4}), a);
118139 #if IUTEST_HAS_AUTO
119- auto il = {0, 1, 2, 3, 4};
120- IUTEST_ASSERT_EQ_RANGE(il, a);
140+ auto il = {0, 1, 2, 3, 4};
141+ IUTEST_ASSERT_EQ_RANGE(il, a);
121142 #endif
122143 #endif
123- }
144+}
124145
146+IUTEST(AssertionTest, EQ_RANGE_Vector)
147+{
148+ int d[] = { 0, 1, 2, 3, 4 };
149+ const int COUNT=sizeof(d)/sizeof(d[0]);
150+ ::std::vector<int> a, b;
151+ ::std::vector<char> c;
152+ for( int i=0; i < COUNT; ++i )
125153 {
126- int d[] = { 0, 1, 2, 3, 4 };
127- const int COUNT=sizeof(d)/sizeof(d[0]);
128- ::std::vector<int> a, b;
129- ::std::vector<char> c;
130- for( int i=0; i < COUNT; ++i )
131- {
132- a.push_back(i);
133- b.push_back(i);
134- c.push_back(static_cast<char>(i));
135- }
136- IUTEST_ASSERT_EQ_RANGE(a, b);
137- IUTEST_EXPECT_EQ_RANGE(a, b);
138- IUTEST_INFORM_EQ_RANGE(a, b);
139- IUTEST_ASSUME_EQ_RANGE(a, b);
154+ a.push_back(i);
155+ b.push_back(i);
156+ c.push_back(static_cast<char>(i));
157+ }
158+ IUTEST_ASSERT_EQ_RANGE(a, b);
159+ IUTEST_EXPECT_EQ_RANGE(a, b);
160+ IUTEST_INFORM_EQ_RANGE(a, b);
161+ IUTEST_ASSUME_EQ_RANGE(a, b);
140162
141- IUTEST_ASSERT_EQ_RANGE(a, c);
142- IUTEST_EXPECT_EQ_RANGE(a, c);
143- IUTEST_INFORM_EQ_RANGE(a, c);
144- IUTEST_ASSUME_EQ_RANGE(a, c);
163+ IUTEST_ASSERT_EQ_RANGE(a, c);
164+ IUTEST_EXPECT_EQ_RANGE(a, c);
165+ IUTEST_INFORM_EQ_RANGE(a, c);
166+ IUTEST_ASSUME_EQ_RANGE(a, c);
145167
146- IUTEST_ASSERT_EQ_RANGE(a, d);
147- IUTEST_EXPECT_EQ_RANGE(a, d);
148- IUTEST_INFORM_EQ_RANGE(a, d);
149- IUTEST_ASSUME_EQ_RANGE(a, d);
168+ IUTEST_ASSERT_EQ_RANGE(a, d);
169+ IUTEST_EXPECT_EQ_RANGE(a, d);
170+ IUTEST_INFORM_EQ_RANGE(a, d);
171+ IUTEST_ASSUME_EQ_RANGE(a, d);
150172
151- IUTEST_ASSERT_EQ_RANGE(d, c);
152- IUTEST_EXPECT_EQ_RANGE(d, c);
153- IUTEST_INFORM_EQ_RANGE(d, c);
154- IUTEST_ASSUME_EQ_RANGE(d, c);
155- }
173+ IUTEST_ASSERT_EQ_RANGE(d, c);
174+ IUTEST_EXPECT_EQ_RANGE(d, c);
175+ IUTEST_INFORM_EQ_RANGE(d, c);
176+ IUTEST_ASSUME_EQ_RANGE(d, c);
156177 }
157178
179+IUTEST(AssertionTest, NE_RANGE)
180+{
181+ int a[] = { 0, 1, 2, 3, 4 };
182+ int b[] = { 0, 1, 2, 3, 4, 5 };
183+ char c[] = { 0, 1, 2, 0, 4 };
184+ ::std::vector<int> d(b+1, b+(sizeof(b)/sizeof(b[0])));
185+
186+ IUTEST_ASSERT_NE_RANGE(a, b);
187+ IUTEST_EXPECT_NE_RANGE(a, b);
188+ IUTEST_INFORM_NE_RANGE(a, b);
189+ IUTEST_ASSUME_NE_RANGE(a, b);
190+
191+ IUTEST_ASSERT_NE_RANGE(a, c);
192+ IUTEST_EXPECT_NE_RANGE(a, c);
193+ IUTEST_INFORM_NE_RANGE(a, c);
194+ IUTEST_ASSUME_NE_RANGE(a, c);
195+
196+ IUTEST_ASSERT_NE_RANGE(a, d);
197+ IUTEST_EXPECT_NE_RANGE(a, d);
198+ IUTEST_INFORM_NE_RANGE(a, d);
199+ IUTEST_ASSUME_NE_RANGE(a, d);
200+
201+#if IUTEST_HAS_INITIALIZER_LIST
202+ IUTEST_ASSERT_NE_RANGE(::std::initializer_list<int>({0, 1, 2, 3, 0}), a);
203+#if IUTEST_HAS_AUTO
204+ auto il = {1, 1, 2, 3, 4};
205+ IUTEST_ASSERT_NE_RANGE(il, a);
206+#endif
207+#endif
208+}
209+
158210 IUTEST(AssertionTest, STRIN)
159211 {
160212 const char test[] = "test";
--- trunk/tools/fused/iutest_pp_strip.py (revision 1417)
+++ trunk/tools/fused/iutest_pp_strip.py (revision 1418)
@@ -436,11 +436,11 @@
436436 'II_DECL_TUPLE_PRINTTO': 'II_D_T_PT',
437437 'II_DECL_ANYOF_AND_ALLOF': 'II_D_AAA',
438438 'II_DECL_COMPARE_HELPER_': 'II_D_C_H_',
439- 'II_DECL_COMBINE_': 'II_D_C_',
440- 'II_DECL_VALUES_': 'II_D_V_',
441- 'II_DECL_TYPES_': 'II_D_T_',
439+ 'II_DECL_COMBINE_': 'II_D_C_',
440+ 'II_DECL_VALUES_': 'II_D_V_',
441+ 'II_DECL_TYPES_': 'II_D_T_',
442442 'II_DECL_TEMPLATES_': 'II_D_TPL_',
443- 'II_DECL_TYPELIST_': 'II_D_TL_',
443+ 'II_DECL_TYPELIST_': 'II_D_TL_',
444444 'II_DECL_TEMPLATETYPELIST_': 'II_D_TTL_',
445445 'II_DECL_PEEP_MEMBER_FUNC_': 'II_D_PE_M_F_',
446446 'II_DECL_COMPARE_MATCHER': 'II_D_COMP_M',
@@ -460,7 +460,7 @@
460460 'II_CONCAT_PACKAGE': 'II_CC_PKG',
461461 'II_PACKAGE_': 'II_PKG_',
462462 'II_PKG_CURRENT_NAMESPACE_': 'II_PKG_C_NS_',
463- 'II_PKG_PARENT_NAMESPACE_': 'II_PKG_P_NS_',
463+ 'II_PKG_PARENT_NAMESPACE_': 'II_PKG_P_NS_',
464464 'II_TEST_CLASS_NAME_': 'II_T_C_N_',
465465 'II_TEST_INSTANCE_NAME_': 'II_T_INST_N_',
466466 'II_TO_VARNAME_': 'II_TO_VN_',
@@ -469,8 +469,8 @@
469469 'II_PMZ_TEST_CLASS_NAME_': 'II_PMZ_T_C_N_',
470470 'II_GETTESTCASEPATTERNHOLDER': 'II_GTCPH',
471471 'II_INSTANTIATE_TEST_CASE_P_': 'II_INST_TC_P_',
472- 'II_TEST_P_EVALGENERATOR_NAME_': 'II_T_P_EGEN_N_',
473- 'II_TEST_P_PARAMGENERATOR_NAME_': 'II_T_P_PGEN_N_',
472+ 'II_TEST_P_EVALGENERATOR_NAME_': 'II_T_P_EGEN_N_',
473+ 'II_TEST_P_PARAMGENERATOR_NAME_': 'II_T_P_PGEN_N_',
474474 'II_TEST_P_INSTANTIATIONREGISTER_': 'II_T_P_INST_R_',
475475 'II_TEST_P_FIXTURE_DECL_': 'II_T_P_FX_D_',
476476 'II_TEST_P_BASE_FIXTURE': 'II_T_P_B_FX',
@@ -486,12 +486,13 @@
486486 'II_T_T_P_NAMESPACE_': 'II_T_T_P_NS_',
487487 'II_T_T_P_ADDTESTNAME': 'II_T_T_P_ADD_TN',
488488 'II_T_T_PARAMS_': 'II_T_T_PRMS_',
489- 'II_REGISTER_TYPED_TEST_CASE_P_': 'II_R_T_TC_P_',
489+ 'II_REGISTER_TYPED_TEST_CASE_P_': 'II_R_T_TC_P_',
490490 'II_INSTANTIATE_TYPED_TEST_CASE_P_': 'II_INST_T_TC_P_',
491- 'II_PEEP_TAG_NAME_': 'II_PE_T_N_',
491+ 'II_PEEP_TAG_NAME_': 'II_PE_T_N_',
492492 'II_PEEP_SETTER_NAME_': 'II_PE_S_N_',
493493 'II_GeTypeNameSpecialization': 'II_GTNS',
494494 'II_WORKAROUND_GENRAND': 'II_WA_GENRAND',
495+ 'II_FILESYSTEM_INSTANTIATE_': 'II_FS_I_',
495496 }
496497 line = line.replace('IIUT_', 'II_')
497498 line = line.replace('II_PP_', 'IP_')
@@ -499,15 +500,28 @@
499500 line = line.replace('statement', 'st')
500501 line = line.replace('expected_exception', 'exp_e')
501502 line = line.replace('exp_e_value', 'exp_e_v')
502- line = line.replace('expected_str', 'exp_s')
503+ line = line.replace('expected_str', 'exp_s')
503504 line = line.replace('expected_value', 'exp_v')
504- line = line.replace('actual_str', 'act_s')
505- line = line.replace('regex_str', 'regex_s')
506- line = line.replace('pred_formatter', 'pd_fmt')
507- line = line.replace('on_failure', 'on_f')
508- line = line.replace('testcasename_', 'tcn_')
509- line = line.replace('testname_', 'tn_')
510- line = line.replace('testfixture_', 'tf_')
505+ line = line.replace('actual_str', 'act_s')
506+ line = line.replace('regex_str', 'regex_s')
507+ line = line.replace('pred_formatter', 'pd_fmt')
508+ line = line.replace('on_failure', 'on_f')
509+ line = line.replace('testcasename_', 'tcn_')
510+ line = line.replace('testcase_', 't_c_')
511+ line = line.replace('testname_', 'tn_')
512+ line = line.replace('testfixture_', 'tf_')
513+ line = line.replace('result_type_', 'rt_')
514+ line = line.replace('parent_class_', 'p_c_')
515+ line = line.replace('type_id_', 'tid_')
516+ line = line.replace('methodName', 'mN_')
517+ line = line.replace('method_', 'mtd_')
518+ line = line.replace('prefix_', 'pfx_')
519+ line = line.replace('paramname_generator_', 'pn_gen_')
520+ line = line.replace('generator_', 'gen_')
521+ line = line.replace('dummy', 'dmy')
522+ # line = line.replace('value', 'val')
523+ line = line.replace('macro', 'mcr')
524+ line = line.replace('EXTEND_POINT_', 'EX_P_')
511525 for k,v in reduction_macros.items():
512526 if collections.Counter(reduction_macros.values())[v] > 1:
513527 print('error: duplicated ' + v)
--- trunk/tools/fused/iuwandbox_pp.py (revision 1417)
+++ trunk/tools/fused/iuwandbox_pp.py (revision 1418)
@@ -10,6 +10,8 @@
1010 import os
1111 import sys
1212 import codecs
13+import re
14+import collections
1315 from iutest_pp_strip import IutestPreprocessor
1416
1517 predefined_macros = {
@@ -23,6 +25,7 @@
2325 '__MINGW__': None,
2426 '__MINGW32__': None,
2527 '__MINGW64__': None,
28+ '__linux__': '1',
2629 '__arm__': None,
2730 'IUTEST_OS_ARM': None,
2831 '__ARMCC_VERSION': None,
@@ -46,6 +49,7 @@
4649 '_WIN32': None,
4750 'WIN32': None,
4851 '__WIN32__': None,
52+ 'UNICODE': None,
4953 'WINAPI_FAMILY': None,
5054 '__AFX_H__': None,
5155 '__MWERKS__': None,
@@ -52,6 +56,12 @@
5256 '__FreeBSD__': None,
5357 'sun': None,
5458 '__sun': None,
59+ '__MAC_OS_X_VERSION_MIN_REQUIRED': None,
60+ '_STLPORT_VERSION': None,
61+ '_BSD_SOURCE': None,
62+ '__USE_MINGW_ANSI_STDIO': None,
63+ 'MAX_PATH': None,
64+ 'PATH_MAX': None,
5565 'IUTEST_OS_WINDOWS': None,
5666 'IUTEST_OS_WINDOWS_MINGW': None,
5767 'IUTEST_OS_WINDOWS_MOBILE': None,
@@ -78,9 +88,11 @@
7888 'IUTEST_NO_SETENV': None,
7989 'IUTEST_NO_GETCWD': None,
8090 'IUTEST_NOT_SUPPORT_STOPWATCH': None,
91+ 'IUTEST_HAS_CXX_HDR_CHARCONV': '0',
8192 'IUTEST_HAS_WANT_SECURE_LIB': '0',
8293 'IUTEST_HAS_MS_EXTENSIONS': '0',
8394 'IUTEST_HAS_MS_CXX_MODULE': '0',
95+ 'IUTEST_HAS_CATCH_SEH_EXCEPTION_ASSERTION': '0',
8496 'MS_CPP_UNITTESTFRAMEWORK': None,
8597 'IUTEST_EXPLICIT_INSTANTIATION_ACCESS_PRIVATE_MEMBER_FUNCTION': '1',
8698 'IUTEST_EXPLICIT_INSTANTIATION_ACCESS_PRIVATE_STATIC_MEMBER_FUNCTION': '1',
@@ -87,11 +99,219 @@
8799 '__native_client__': None,
88100 'IUTEST_OS_NACL': None,
89101 'IUTEST_HAS_INVALID_PARAMETER_HANDLER': '0',
102+ '__clang_analyzer__': None,
103+ 'IUTEST_ANALYSIS_ASSUME_DELEGATE': None,
104+ 'IUTEST_MBS_CODE': '0',
105+ 'IUTEST_USE_EXTERNAL_STD_TUPLE': '0',
106+ 'IUTEST_USE_EXTERNAL_TR1_TUPLE': '0',
107+ 'IUTEST_USE_CXX_FILESYSTEM': '0',
108+ 'IUTEST_CXX_NOEXCEPT': 'unused',
109+ 'IUTEST_CXX_NOEXCEPT_AS': 'unused',
110+ 'IUTEST_CXX_NOTHROW': 'unused',
111+ 'IUTEST_PRAGMA_WARN_DISABLE_EMPTY_BODY': 'unused',
112+ 'IUTEST_PRAGMA_WARN_FORMAT_NONLITERAL': 'unused',
113+ 'IUTEST_PRAGMA_WARN_CXX14_CONSTEXPR_NOT_IMPLY_CONST': 'unused',
114+ 'IUTEST_MAKE_ASSERTIONRESULT_': 'unused',
115+ # no overridable
116+ 'IUTEST_SUCCEED': None,
117+ 'IUTEST_FAIL': None,
118+ 'IUTEST_ADD_FAILURE': None,
119+ 'IUTEST_ADD_FAILURE_AT': None,
120+ 'IUTEST_SKIP': None,
121+ 'IUTEST_ASSERT': None,
122+ 'IUTEST_ASSERT_NOT': None,
123+ 'IUTEST_ASSERT_THAT': None,
124+ 'IUTEST_ASSERT_EQ': None,
125+ 'IUTEST_ASSERT_ALMOST_EQ': None,
126+ 'IUTEST_ASSERT_NE': None,
127+ 'IUTEST_ASSERT_LT': None,
128+ 'IUTEST_ASSERT_LE': None,
129+ 'IUTEST_ASSERT_GT': None,
130+ 'IUTEST_ASSERT_GE': None,
131+ 'IUTEST_ASSERT_TRUE': None,
132+ 'IUTEST_ASSERT_FALSE': None,
133+ 'IUTEST_ASSERT_NULL': None,
134+ 'IUTEST_ASSERT_NOTNULL': None,
135+ 'IUTEST_ASSERT_SAME': None,
136+ 'IUTEST_ASSERT_FLOAT_EQ': None,
137+ 'IUTEST_ASSERT_DOUBLE_EQ': None,
138+ 'IUTEST_ASSERT_LONG_DOUBLE_EQ': None,
139+ 'IUTEST_ASSERT_NEAR': None,
140+ 'IUTEST_ASSERT_STREQ': None,
141+ 'IUTEST_ASSERT_STRNE': None,
142+ 'IUTEST_ASSERT_STRCASEEQ': None,
143+ 'IUTEST_ASSERT_STRCASENE': None,
144+ 'IUTEST_ASSERT_THROW': None,
145+ 'IUTEST_ASSERT_THROW_VALUE_EQ': None,
146+ 'IUTEST_ASSERT_THROW_VALUE_NE': None,
147+ 'IUTEST_ASSERT_THROW_VALUE_STREQ': None,
148+ 'IUTEST_ASSERT_THROW_VALUE_STRCASEEQ': None,
149+ 'IUTEST_ASSERT_ANY_THROW': None,
150+ 'IUTEST_ASSERT_NO_THROW': None,
151+ 'IUTEST_ASSERT_NO_FAILURE': None,
152+ 'IUTEST_ASSERT_NO_FATAL_FAILURE': None,
153+ 'IUTEST_ASSERT_FAIL': None,
154+ 'IUTEST_ASSERT_EQ_COLLECTIONS': None,
155+ 'IUTEST_ASSERT_NE_COLLECTIONS': None,
156+ 'IUTEST_ASSERT_EQ_RANGE': None,
157+ 'IUTEST_ASSERT_NE_RANGE': None,
158+ 'IUTEST_ASSERT_STRLNEQ': None,
159+ 'IUTEST_ASSERT_STRIN': None,
160+ 'IUTEST_ASSERT_STRNOTIN': None,
161+ 'IUTEST_ASSERT_MATCHES_REGEXEQ': None,
162+ 'IUTEST_ASSERT_MATCHES_REGEXNE': None,
163+ 'IUTEST_ASSERT_CONTAINS_REGEXEQ': None,
164+ 'IUTEST_ASSERT_CONTAINS_REGEXNE': None,
165+ 'IUTEST_EXPECT': None,
166+ 'IUTEST_EXPECT_NOT': None,
167+ 'IUTEST_EXPECT_THAT': None,
168+ 'IUTEST_EXPECT_EQ': None,
169+ 'IUTEST_EXPECT_ALMOST_EQ': None,
170+ 'IUTEST_EXPECT_NE': None,
171+ 'IUTEST_EXPECT_LT': None,
172+ 'IUTEST_EXPECT_LE': None,
173+ 'IUTEST_EXPECT_GT': None,
174+ 'IUTEST_EXPECT_GE': None,
175+ 'IUTEST_EXPECT_TRUE': None,
176+ 'IUTEST_EXPECT_FALSE': None,
177+ 'IUTEST_EXPECT_NULL': None,
178+ 'IUTEST_EXPECT_NOTNULL': None,
179+ 'IUTEST_EXPECT_SAME': None,
180+ 'IUTEST_EXPECT_FLOAT_EQ': None,
181+ 'IUTEST_EXPECT_DOUBLE_EQ': None,
182+ 'IUTEST_EXPECT_LONG_DOUBLE_EQ': None,
183+ 'IUTEST_EXPECT_NEAR': None,
184+ 'IUTEST_EXPECT_STREQ': None,
185+ 'IUTEST_EXPECT_STRNE': None,
186+ 'IUTEST_EXPECT_STRCASEEQ': None,
187+ 'IUTEST_EXPECT_STRCASENE': None,
188+ 'IUTEST_EXPECT_THROW': None,
189+ 'IUTEST_EXPECT_THROW_VALUE_EQ': None,
190+ 'IUTEST_EXPECT_THROW_VALUE_NE': None,
191+ 'IUTEST_EXPECT_THROW_VALUE_STREQ': None,
192+ 'IUTEST_EXPECT_THROW_VALUE_STRCASEEQ': None,
193+ 'IUTEST_EXPECT_ANY_THROW': None,
194+ 'IUTEST_EXPECT_NO_THROW': None,
195+ 'IUTEST_EXPECT_NO_FAILURE': None,
196+ 'IUTEST_EXPECT_NO_FATAL_FAILURE': None,
197+ 'IUTEST_EXPECT_FAIL': None,
198+ 'IUTEST_EXPECT_EQ_COLLECTIONS': None,
199+ 'IUTEST_EXPECT_NE_COLLECTIONS': None,
200+ 'IUTEST_EXPECT_EQ_RANGE': None,
201+ 'IUTEST_EXPECT_NE_RANGE': None,
202+ 'IUTEST_EXPECT_STRLNEQ': None,
203+ 'IUTEST_EXPECT_STRIN': None,
204+ 'IUTEST_EXPECT_STRNOTIN': None,
205+ 'IUTEST_EXPECT_MATCHES_REGEXEQ': None,
206+ 'IUTEST_EXPECT_MATCHES_REGEXNE': None,
207+ 'IUTEST_EXPECT_CONTAINS_REGEXEQ': None,
208+ 'IUTEST_EXPECT_CONTAINS_REGEXNE': None,
209+ 'IUTEST_INFORM': None,
210+ 'IUTEST_INFORM_NOT': None,
211+ 'IUTEST_INFORM_THAT': None,
212+ 'IUTEST_INFORM_EQ': None,
213+ 'IUTEST_INFORM_ALMOST_EQ': None,
214+ 'IUTEST_INFORM_NE': None,
215+ 'IUTEST_INFORM_LT': None,
216+ 'IUTEST_INFORM_LE': None,
217+ 'IUTEST_INFORM_GT': None,
218+ 'IUTEST_INFORM_GE': None,
219+ 'IUTEST_INFORM_TRUE': None,
220+ 'IUTEST_INFORM_FALSE': None,
221+ 'IUTEST_INFORM_NULL': None,
222+ 'IUTEST_INFORM_NOTNULL': None,
223+ 'IUTEST_INFORM_SAME': None,
224+ 'IUTEST_INFORM_FLOAT_EQ': None,
225+ 'IUTEST_INFORM_DOUBLE_EQ': None,
226+ 'IUTEST_INFORM_LONG_DOUBLE_EQ': None,
227+ 'IUTEST_INFORM_NEAR': None,
228+ 'IUTEST_INFORM_STREQ': None,
229+ 'IUTEST_INFORM_STRNE': None,
230+ 'IUTEST_INFORM_STRCASEEQ': None,
231+ 'IUTEST_INFORM_STRCASENE': None,
232+ 'IUTEST_INFORM_THROW': None,
233+ 'IUTEST_INFORM_THROW_VALUE_EQ': None,
234+ 'IUTEST_INFORM_THROW_VALUE_NE': None,
235+ 'IUTEST_INFORM_THROW_VALUE_STREQ': None,
236+ 'IUTEST_INFORM_THROW_VALUE_STRCASEEQ': None,
237+ 'IUTEST_INFORM_ANY_THROW': None,
238+ 'IUTEST_INFORM_NO_THROW': None,
239+ 'IUTEST_INFORM_NO_FAILURE': None,
240+ 'IUTEST_INFORM_NO_FATAL_FAILURE': None,
241+ 'IUTEST_INFORM_FAIL': None,
242+ 'IUTEST_INFORM_EQ_COLLECTIONS': None,
243+ 'IUTEST_INFORM_NE_COLLECTIONS': None,
244+ 'IUTEST_INFORM_EQ_RANGE': None,
245+ 'IUTEST_INFORM_NE_RANGE': None,
246+ 'IUTEST_INFORM_STRLNEQ': None,
247+ 'IUTEST_INFORM_STRIN': None,
248+ 'IUTEST_INFORM_STRNOTIN': None,
249+ 'IUTEST_INFORM_MATCHES_REGEXEQ': None,
250+ 'IUTEST_INFORM_MATCHES_REGEXNE': None,
251+ 'IUTEST_INFORM_CONTAINS_REGEXEQ': None,
252+ 'IUTEST_INFORM_CONTAINS_REGEXNE': None,
253+ 'IUTEST_ASSUME': None,
254+ 'IUTEST_ASSUME_NOT': None,
255+ 'IUTEST_ASSUME_THAT': None,
256+ 'IUTEST_ASSUME_EQ': None,
257+ 'IUTEST_ASSUME_ALMOST_EQ': None,
258+ 'IUTEST_ASSUME_NE': None,
259+ 'IUTEST_ASSUME_LT': None,
260+ 'IUTEST_ASSUME_LE': None,
261+ 'IUTEST_ASSUME_GT': None,
262+ 'IUTEST_ASSUME_GE': None,
263+ 'IUTEST_ASSUME_TRUE': None,
264+ 'IUTEST_ASSUME_FALSE': None,
265+ 'IUTEST_ASSUME_NULL': None,
266+ 'IUTEST_ASSUME_NOTNULL': None,
267+ 'IUTEST_ASSUME_SAME': None,
268+ 'IUTEST_ASSUME_FLOAT_EQ': None,
269+ 'IUTEST_ASSUME_DOUBLE_EQ': None,
270+ 'IUTEST_ASSUME_LONG_DOUBLE_EQ': None,
271+ 'IUTEST_ASSUME_NEAR': None,
272+ 'IUTEST_ASSUME_STREQ': None,
273+ 'IUTEST_ASSUME_STRNE': None,
274+ 'IUTEST_ASSUME_STRCASEEQ': None,
275+ 'IUTEST_ASSUME_STRCASENE': None,
276+ 'IUTEST_ASSUME_THROW': None,
277+ 'IUTEST_ASSUME_THROW_VALUE_EQ': None,
278+ 'IUTEST_ASSUME_THROW_VALUE_NE': None,
279+ 'IUTEST_ASSUME_THROW_VALUE_STREQ': None,
280+ 'IUTEST_ASSUME_THROW_VALUE_STRCASEEQ': None,
281+ 'IUTEST_ASSUME_ANY_THROW': None,
282+ 'IUTEST_ASSUME_NO_THROW': None,
283+ 'IUTEST_ASSUME_NO_FAILURE': None,
284+ 'IUTEST_ASSUME_NO_FATAL_FAILURE': None,
285+ 'IUTEST_ASSUME_FAIL': None,
286+ 'IUTEST_ASSUME_EQ_COLLECTIONS': None,
287+ 'IUTEST_ASSUME_NE_COLLECTIONS': None,
288+ 'IUTEST_ASSUME_EQ_RANGE': None,
289+ 'IUTEST_ASSUME_NE_RANGE': None,
290+ 'IUTEST_ASSUME_STRLNEQ': None,
291+ 'IUTEST_ASSUME_STRIN': None,
292+ 'IUTEST_ASSUME_STRNOTIN': None,
293+ 'IUTEST_ASSUME_MATCHES_REGEXEQ': None,
294+ 'IUTEST_ASSUME_MATCHES_REGEXNE': None,
295+ 'IUTEST_ASSUME_CONTAINS_REGEXEQ': None,
296+ 'IUTEST_ASSUME_CONTAINS_REGEXNE': None,
90297 }
91298
92299 iutest_config_macro = {
93300 'IUTEST_HAS_LIB': '0',
301+ 'IUTEST_HAS_PARAM_TEST': '1',
302+ 'IUTEST_HAS_TYPED_TEST': '1',
303+ 'IUTEST_HAS_TYPED_TEST_P': '1',
304+ 'IUTEST_TYPED_TEST_P_STRICT': '1',
305+ 'IUTEST_HAS_MATCHERS': '1',
306+ 'IUTEST_HAS_VALUESGEN': '1',
307+ 'IUTEST_HAS_RANDOMVALUES': '1',
308+ 'IUTEST_HAS_CONCAT': '1',
309+ 'IUTEST_HAS_CSVPARAMS': '1',
94310 'IUTEST_HAS_TESTNAME_ALIAS_JP': '0',
311+ 'IUTEST_HAS_TESTFIXTURE_ALIAS_BY_TUPLE': '1',
312+ 'IUTEST_HAS_AUTOFIXTURE_PARAM_TEST': '1',
313+ 'IUTEST_HAS_ANY_PARAM_TEST': '1',
314+ 'IUTEST_HAS_PARAM_TEST_PARAM_NAME_GENERATOR': '1',
95315 'IUTEST_HAS_IF_EXISTS': '0',
96316 'IUTEST_HAS_ANALYSIS_ASSUME': '0',
97317 'IUTEST_HAS_IGNORE_TEST': '0',
@@ -111,6 +331,25 @@
111331 'IUTEST_HAS_THREAD_SANITIZER': '0',
112332 'IUTEST_HAS_SEH': '0',
113333 'IUTEST_USE_OWN_LIST': '0',
334+ 'IUTEST_HAS_MATCHER_FLOATINGPOINT_NEAR': '1',
335+ 'IUTEST_HAS_MATCHER_EACH': '1',
336+ 'IUTEST_HAS_MATCHER_POINTWISE': '1',
337+ 'IUTEST_HAS_GENRAND': '1',
338+ 'IUTEST_HAS_PACKAGE': '1',
339+ 'IUTEST_HAS_PEEP': '1',
340+ 'IUTEST_HAS_SOCKET': '1',
341+ 'IUTEST_HAS_PRINT_TO': '1',
342+ 'IUTEST_HAS_ARITHMETIC_EXPRESSION_DECOMPOSE': '1',
343+ 'IUTEST_HAS_STATIC_ASSERT_TYPEEQ': '1',
344+ 'IUTEST_HAS_ASSERTION_RETURN': '1',
345+ 'IUTEST_HAS_ASSERTION_NOEQUALTO_OBJECT': '1',
346+ 'IUTEST_HAS_TESTNAME_ALIAS': '1',
347+ 'IUTEST_HAS_REPORT_SKIPPED': '1',
348+ 'IUTEST_HAS_STREAM_BUFFER': '1',
349+ # 'IUTEST_HAS_STREAM_RESULT': '1',
350+ 'IUTEST_HAS_BIGGESTINT_OSTREAM': '1',
351+ 'IUTEST_CHECK_STRICT': '1',
352+ 'IUTEST_HAS_COLORCONSOLE': '0',
114353 }
115354
116355 expands_macros = [
@@ -137,6 +376,13 @@
137376 'IUTEST_PRAGMA_MSC_WARN_PUSH',
138377 'IUTEST_PRAGMA_MSC_WARN_DISABLE',
139378 'IUTEST_PRAGMA_MSC_WARN_POP',
379+ 'IUTEST_PRAGMA_UNUSED_LOCAL_TYPEDEFS_WARN_DISABLE_BEGIN',
380+ 'IUTEST_PRAGMA_UNUSED_LOCAL_TYPEDEFS_WARN_DISABLE_END',
381+ 'IUTEST_PRAGMA_UNREACHCODE_WARN_DISABLE_BEGIN',
382+ 'IUTEST_PRAGMA_UNREACHCODE_WARN_DISABLE_END',
383+ 'IUTEST_PRAGMA_WARN_DISABLE_EMPTY_BODY',
384+ 'IUTEST_PRAGMA_WARN_FORMAT_NONLITERAL',
385+ 'IUTEST_PRAGMA_WARN_CXX14_CONSTEXPR_NOT_IMPLY_CONST',
140386 'IUTEST_WORKAROUND_MSC_STLSTREAM_C4250',
141387 'IUTEST_EXPLICIT_TEMPLATE_TYPE_',
142388 'IUTEST_IF_EXISTS',
@@ -145,6 +391,12 @@
145391 'IUTEST_STATIC_ASSERT_IF_EXISTS',
146392 'IUTEST_STATIC_ASSERT_IF_NOT_EXISTS',
147393 'IUTEST_ANALYSIS_ASSUME',
394+ 'IUTEST_PP_ENUM_CASE_RETURN_STRING',
395+ 'IUTEST_CLASS_INITIALIZE',
396+ 'IUTEST_CLASS_CLEANUP',
397+ 'IUTEST_METHOD_INITIALIZE',
398+ 'IUTEST_METHOD_CLEANUP',
399+ # 'IUTEST_MAKE_ASSERTIONRESULT_',
148400 ]
149401
150402 #
@@ -154,6 +406,114 @@
154406 has_include = {
155407 }
156408
409+rename_macro = {
410+ 'IUTEST_ASSERT_FAILURE': 'II_A_FAIL',
411+ 'IUTEST_EXPECT_FAILURE': 'II_E_FAIL',
412+ 'IUTEST_INFORM_FAILURE': 'II_I_FAIL',
413+ 'IUTEST_ASSUME_FAILURE': 'II_M_FAIL',
414+ 'IUTEST_ASSERT_FAILURE_AT': 'II_A_FAIL_AT',
415+ 'IUTEST_EXPECT_FAILURE_AT': 'II_E_FAIL_AT',
416+ 'IUTEST_INFORM_FAILURE_AT': 'II_I_FAIL_AT',
417+ 'IUTEST_ASSUME_FAILURE_AT': 'II_M_FAIL_AT',
418+ 'IUTEST_ATTRIBUTE_UNUSED_': 'II_ATR_U',
419+ 'IUTEST_ATTRIBUTE_NORETURN_': 'II_ATR_NR',
420+ 'IUTEST_ATTRIBUTE_FORMAT_PRINTF': 'II_ATR_F_P',
421+ 'IUTEST_ATTRIBUTE_FORMAT': 'II_ATR_F',
422+ 'IUTEST_CXX_OVERRIDE': 'II_CXX_O',
423+ 'IUTEST_CXX_NOEXCEPT_SPEC': 'II_CXX_NEX_S',
424+ 'IUTEST_CXX_DEFAULT_FUNCTION': 'II_CXX_DF_F',
425+ 'IUTEST_CXX_DELETED_FUNCTION': 'II_CXX_DL_F',
426+ 'IUTEST_CXX_FINAL': 'II_CXX_F',
427+ 'IUTEST_CXX_EXPLICIT_CONVERSION': 'II_CXX_E_C',
428+ 'IUTEST_CXX_CONSTEXPR': 'II_CXX_CE',
429+ 'IUTEST_CXX14_CONSTEXPR': 'II_CXX14_CE',
430+ 'IUTEST_CXX_CONSTEXPR_OR_CONST': 'II_CXX_C_O_C',
431+ 'IUTEST_AMBIGUOUS_ELSE_BLOCKER_': 'II_AMB_E_B',
432+ 'IUTEST_SUPPRESS_UNREACHABLE_CODE_WARNING': 'II_S_UR_C_W',
433+ 'IUTEST_APPEND_EXPLICIT_TEMPLATE_TYPE_': 'II_A_E_TT',
434+ 'IUTEST_PRAGMA_ASSIGNMENT_OPERATOR_COULD_NOT_GENERATE_WARN_DISABLE_BEGIN': 'II_PGM_A_O_CN_G_W_D_B',
435+ 'IUTEST_PRAGMA_ASSIGNMENT_OPERATOR_COULD_NOT_GENERATE_WARN_DISABLE_END': 'II_PGM_A_O_CN_G_W_D_E',
436+ 'IUTEST_PRAGMA_WARN_FLOAT_EQUAL': 'II_PGM_W_FE',
437+ 'IUTEST_PRAGMA_WARN_CAST_ALIGN': 'II_PGM_W_CA',
438+ 'IUTEST_PRAGMA_WARN_DISABLE_NOEXCEPT_TPYE': 'II_PGM_W_D_NE_T',
439+ 'IUTEST_PRAGMA_WARN_DISABLE_SIGN_COMPARE': 'II_PGM_W_D_S_C',
440+ 'IUTEST_PRAGMA_WARN_DISABLE_DANGLING_ELSE': 'II_PGM_W_D_D_E',
441+ 'IUTEST_PRAGMA_CLANG_WARN_PUSH': 'II_PGM_C_W_PU',
442+ 'IUTEST_PRAGMA_CLANG_WARN_DISABLE': 'II_PGM_C_W_D',
443+ 'IUTEST_PRAGMA_CLANG_WARN_POP': 'II_PGM_C_W_PP',
444+ 'IUTEST_PRAGMA_GCC_WARN_PUSH': 'II_PGM_G_W_PU',
445+ 'IUTEST_PRAGMA_GCC_WARN_DISABLE': 'II_PGM_G_W_D',
446+ 'IUTEST_PRAGMA_GCC_WARN_POP': 'II_PGM_G_W_PP',
447+ 'IUTEST_PRAGMA_WARN_PUSH': 'II_PGM_W_PU',
448+ # 'IUTEST_PRAGMA_WARN_DISABLE': 'II_PGM_W_D',
449+ 'IUTEST_PRAGMA_WARN_POP': 'II_PGM_W_PP',
450+ 'IUTEST_PP_DISALLOW_COPY_AND_ASSIGN': 'IP_DIS_C_A_A',
451+ 'IUTEST_PP_DISALLOW_ASSIGN': 'IP_DIS_A',
452+ 'IUTEST_PP_DISALLOW_MOVE_AND_COPY_AND_ASSIGN': 'IP_DIS_M_A_C_A_A',
453+ 'IUTEST_PP_NAMESPACE_ENUM_CASE_RETURN_STRING': 'IP_NS_E_C_R_S',
454+ 'IUTEST_PP_INC': 'IP_INC',
455+ 'IUTEST_PP_DEC': 'IP_DEC',
456+ 'IUTEST_PP_CAT': 'IP_CAT',
457+ 'IUTEST_PP_EMPTY': 'IP_EMPTY',
458+ 'IUTEST_PP_IS_BEGIN_PARENS': 'IP_IS_B_PAR',
459+ 'IUTEST_LIBSTDCXX_VERSION': 'II_LSTDCXX_V',
460+ 'IUTEST_PRED_FORMAT_': 'II_PRD_FMT_',
461+ 'IUTEST_PRED_FORMAT1_': 'II_PRD_FMT1_',
462+ 'IUTEST_PRED_FORMAT2_': 'II_PRD_FMT2_',
463+ 'IUTEST_PRED_FORMAT3_': 'II_PRD_FMT3_',
464+ 'IUTEST_PRED_FORMAT4_': 'II_PRD_FMT4_',
465+ 'IUTEST_PRED_FORMAT5_': 'II_PRD_FMT5_',
466+ 'IUTEST_THROW_PRED_FORMAT2_': 'II_T_PRD_FMT2_',
467+ 'IUTEST_PRED_': 'II_PRD_',
468+ 'IUTEST_PRED1_': 'II_PRD1_',
469+ 'IUTEST_PRED2_': 'II_PRD2_',
470+ 'IUTEST_PRED3_': 'II_PRD3_',
471+ 'IUTEST_PRED4_': 'II_PRD4_',
472+ 'IUTEST_PRED5_': 'II_PRD5_',
473+ 'IUTEST_TEST_ASSERT_': 'II_T_ASRT_',
474+ 'IUTEST_TEST_CLASS_NAME_': 'II_T_CLS_N_',
475+ 'IUTEST_TEST_INSTANCE_NAME_': 'II_T_INST_N_',
476+ 'IUTEST_PMZ_TEST_CLASS_NAME_': 'II_P_T_CLS_N_',
477+ 'IUTEST_MESSAGE_AT': 'II_MSG_AT',
478+ 'IUTEST_MESSAGE': 'II_MSG',
479+ 'IUTEST_IS_NULLLITERAL': 'II_IS_NL',
480+ 'IUTEST_ALIAS_TESTNAME_F_': 'II_ALS_TN_F_',
481+ 'IUTEST_ALIAS_TESTNAME_F': 'II_ALS_TN_F',
482+ 'IUTEST_ALIAS_TESTNAME_': 'II_ALS_TN',
483+ 'IUTEST_THROUGH_ANALYSIS_ASSUME_': 'II_TRGH_A_A_',
484+ 'IUTEST_PP_ENUM_SHIFTED_BINARY_PARAMS': 'IP_ENM_S_B_P',
485+ 'IUTEST_PP_ENUM_SHIFTED_BINARY': 'IP_ENM_S_B',
486+ 'IUTEST_PP_ENUM_SHIFTED_PARAMS': 'IP_ENM_S_P',
487+ 'IUTEST_PP_ENUM_BINARY_PARAMS': 'IP_ENM_B_P',
488+ 'IUTEST_PP_ENUM_SHIFTED': 'IP_ENM_S',
489+ 'IUTEST_PP_ENUM_BINARY': 'IP_ENM_B',
490+ 'IUTEST_PP_ENUM_PARAMS': 'IP_ENM_P',
491+ 'IUTEST_PP_ENUM': 'IP_ENM',
492+ 'IUTEST_TEST_EQ_COLLECTIONS': 'II_T_EQ_CLCT',
493+ 'IUTEST_TEST_NE_COLLECTIONS': 'II_T_NE_CLCT',
494+ 'IUTEST_TEST_EQ_RANGE': 'II_T_EQ_RNG',
495+ 'IUTEST_TEST_NE_RANGE': 'II_T_NE_RNG',
496+ 'IUTEST_TEST_STRLNEQ': 'II_T_SLN',
497+ 'IUTEST_TEST_STRIN': 'II_T_SIN',
498+ 'IUTEST_TEST_STRNOTIN': 'II_T_SNIN',
499+ 'IUTEST_TEST_MATCHES_REGEXEQ': 'II_T_M_RGE',
500+ 'IUTEST_TEST_MATCHES_REGEXNE': 'II_T_M_RGN',
501+ 'IUTEST_TEST_CONTAINS_REGEXEQ': 'II_T_C_RGE',
502+ 'IUTEST_TEST_CONTAINS_REGEXNE': 'II_T_C_RGN',
503+}
504+
505+rename_text = {
506+ 'backward': 'bkw',
507+ # 'CmpHelper': 'CHlpr',
508+ 'IUTEST_MAKE_ASSERTIONRESULT_': '',
509+ 'II_DECL_STREQ_COMPARE_HELPER_': 'II_DECL_SE_C_H_',
510+ 'II_INSTANTIATE_TEST_CASE_AP_': 'II_INST_TC_AP_',
511+ 'II_TEST_AP_FIXTURE_NAME_': 'II_T_AP_FIX_N_',
512+ 'II_ALIAS_TESTNAME_AP_': 'II_ALS_TN_AP_',
513+ 'IUTEST_GET_PACKAGENAME_': 'II_GET_PKGN_',
514+ 'IUTEST_CONCAT_PACKAGE_': 'II_CC_PKG_',
515+}
516+
157517 debug = False
158518
159519 class WandboxPreprocessor:
@@ -171,7 +531,72 @@
171531 def remove_empty_ppif(self, code):
172532 return self.pp.remove_empty_ppif(code)
173533
534+ def remove_redudant(self, code):
535+ dst = ""
536+ for line in code.splitlines():
537+ if '#define IP_D_' in line:
538+ v = line.split()
539+ try:
540+ if int(v[2]) > 50:
541+ continue
542+ except ValueError:
543+ pass
544+ elif '#define IP_I_' in line:
545+ v = line.split()
546+ try:
547+ if int(v[2]) > 51:
548+ continue
549+ except ValueError:
550+ pass
551+ elif '#define IP_B_' in line:
552+ v = line.split()
553+ v2 = v[1].split('_')
554+ try:
555+ if int(v2[2]) > 51:
556+ continue
557+ except ValueError:
558+ pass
559+ elif 'IUTEST_MBS_CODE' in line:
560+ continue
561+ line += "\n"
562+ dst += line
563+ return dst
174564
565+ def rename_macros(self, code):
566+ dst = ""
567+ global rename_macro
568+ found_macros = {}
569+ for k, v in rename_macro.items():
570+ if collections.Counter(rename_macro.values())[v] > 1:
571+ print('error: duplicated ' + v)
572+ return
573+ RE_DEFINE = re.compile(r'#\s*define\s([\w_]+)(.*)$')
574+ for line in code.splitlines():
575+ m = RE_DEFINE.match(line)
576+ if m:
577+ d = m.group(1)
578+ if d in rename_macro:
579+ alias = rename_macro[d]
580+ found_macros[d] = alias
581+ del rename_macro[d]
582+ if len(rename_macro) == 0:
583+ break
584+ for line in code.splitlines():
585+ for k, v in found_macros.items():
586+ line = re.sub(k + r'(?=[\W]|$)', v, line)
587+ # line = line.replace(k, v)
588+ for k, v in rename_text.items():
589+ line = line.replace(k, v)
590+ for k, v in found_macros.items():
591+ if k in line:
592+ print(k)
593+ line += "\n"
594+ dst += line
595+ for k, v in found_macros.items():
596+ dst += "#define " + k + " " + v + "\n"
597+ return dst
598+
599+
175600 def default_pp():
176601 output_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../fused-src")
177602 output = "iutest.wandbox.min.hpp"
@@ -182,6 +607,8 @@
182607 pp = WandboxPreprocessor()
183608 code = pp.preprocess(code, None)
184609 code = pp.remove_empty_ppif(code)
610+ code = pp.remove_redudant(code)
611+ code = pp.rename_macros(code)
185612 output_file.write(code)
186613 output_file.close()
187614
--- trunk/tools/wandbox/Makefile (revision 1417)
+++ trunk/tools/wandbox/Makefile (revision 1418)
@@ -42,6 +42,9 @@
4242 experimental: ../../test/syntax_tests.cpp Makefile
4343 python iuwandbox.py $< -c $(WANDBOX_COMPILER) -f"-DIUTEST_USE_MAIN" --encoding utf-8-sig $(EXPAND_INCLUDE) --iutest-use-wandbox-min
4444
45+full: ../../test/syntax_tests.cpp Makefile
46+ python iuwandbox.py $< -c $(WANDBOX_COMPILER) -f"-DIUTEST_USE_MAIN" --encoding utf-8-sig $(EXPAND_INCLUDE) --no-iutest-use-wandbox-min
47+
4548 test-gcc: ../../test/syntax_tests.cpp Makefile
4649 python iuwandbox.py $< -c gcc-head -f"-DIUTEST_USE_MAIN" -x "warning,gnu++1y" -f"-Wsuggest-override" --encoding utf-8-sig $(EXPAND_INCLUDE)
4750
--- trunk/tools/wandbox/iuwandbox.py (revision 1417)
+++ trunk/tools/wandbox/iuwandbox.py (revision 1418)
@@ -27,7 +27,7 @@
2727 workaround = True
2828 api_retries = 3
2929 api_retry_wait = 60
30-fused_src = IUTEST_FUSED_SRC
30+fused_src = IUTEST_WANDBOX_FUSED_SRC
3131
3232
3333 # command line option
@@ -41,7 +41,7 @@
4141 '-v',
4242 '--version',
4343 action='version',
44- version=u'%(prog)s version 6.3'
44+ version=u'%(prog)s version 7.0'
4545 )
4646 parser.add_argument(
4747 '--list-compiler',
@@ -202,9 +202,15 @@
202202 parser.add_argument(
203203 '--iutest-use-wandbox-min',
204204 action='store_true',
205- help='use iutest.wandbox.min.hpp (experimental).'
205+ default=True,
206+ help='!this option is deprecated! use iutest.wandbox.min.hpp (default true).'
206207 )
207208 parser.add_argument(
209+ '--no-iutest-use-wandbox-min',
210+ action='store_true',
211+ help='not use iutest.wandbox.min.hpp (experimental).'
212+ )
213+ parser.add_argument(
208214 '--verbose',
209215 action='store_true',
210216 help='verbose.'
@@ -223,8 +229,8 @@
223229 options = parser.parse_args()
224230 api_retries = options.retry
225231 api_retry_wait = options.retry_wait
226- if options.iutest_use_wandbox_min:
227- fused_src = IUTEST_WANDBOX_FUSED_SRC
232+ if options.no_iutest_use_wandbox_min:
233+ fused_src = IUTEST_FUSED_SRC
228234 return options, parser
229235
230236
--- trunk/tools/wandbox/tests/test_iuwandbox.py (revision 1417)
+++ trunk/tools/wandbox/tests/test_iuwandbox.py (revision 1418)
@@ -26,12 +26,13 @@
2626 root = os.path.normpath(os.path.dirname(os.path.abspath(__file__)) + '/../../../')
2727 fused_src = root + '/fused-src'
2828 test_src = root + '/test/syntax_tests.cpp'
29-test_opt_default = ['--encoding', 'utf-8-sig', '--iutest-use-wandbox-min']
29+test_opt_default = ['--encoding', 'utf-8-sig']
3030 test_opt_nomain = test_opt_default
3131 test_opt = ['-f"-DIUTEST_USE_MAIN"']
3232 test_opt.extend(test_opt_default)
3333 test_opt_verbose = ['--verbose']
3434 test_opt_dryrun = ['--dryrun']
35+test_opt_no_min = ['--iutest-use-wandbox-min']
3536
3637
3738 def eprint(*args, **kwargs):
@@ -154,7 +155,7 @@
154155 iuwandbox.main()
155156 output = self.dump()
156157 self.assertEqual(cm.exception.code, 0, output)
157- self.assertRegex(output, '\[ \s+OK \]')
158+ self.assertRegex(output, r'\[ \s+OK \]')
158159 self.assertFalse('-Wmisleading-indentation' in output)
159160
160161 def test_same_filename(self):
@@ -167,6 +168,18 @@
167168 self.assertEqual(cm.exception.code, 0, output)
168169 self.assertRegex(output, '.*OK.*')
169170
171+ def test_no_min_run(self):
172+ sys.argv[1:] = [test_src]
173+ sys.argv.extend(test_opt)
174+ sys.argv.extend(test_opt_no_min)
175+ print(sys.argv)
176+ with self.assertRaises(SystemExit) as cm:
177+ iuwandbox.main()
178+ output = self.dump()
179+ self.assertEqual(cm.exception.code, 0, output)
180+ self.assertRegex(output, r'\[ \s+OK \]')
181+ self.assertFalse('-Wmisleading-indentation' in output)
170182
183+
171184 if __name__ == "__main__":
172185 unittest.main()
--- trunk/tools/wandbox/wandbox.py (revision 1417)
+++ trunk/tools/wandbox/wandbox.py (revision 1418)
@@ -176,6 +176,13 @@
176176 return False
177177 return e.response.status_code in [500, 502, 503, 504]
178178
179+ def is_limit(e):
180+ if e is None:
181+ return False
182+ if e.response is None:
183+ return False
184+ return e.response.status_code in [400]
185+
179186 retries -= 1
180187 if is_retry(e) and retries > 0:
181188 try:
@@ -185,6 +192,18 @@
185192 print('wait {0}sec...'.format(retry_wait))
186193 sleep(retry_wait)
187194 return Wandbox.Call(action, retries, retry_wait)
195+ elif is_limit(e) and retries > 0:
196+ try:
197+ print(e.message)
198+ except Exception:
199+ pass
200+ limit_wait = 10
201+ print('wait {0}min'.format(limit_wait), end='', flush=True)
202+ for x in range(limit_wait):
203+ print('.', end='', flush=True)
204+ sleep(60)
205+ print('.')
206+ return Wandbox.Call(action, retries, retry_wait)
188207 else:
189208 raise
190209 except Exception:
Show on old repository browser