Merge branch 'develop'
git@eb82265f96e76133d5e0d8b79e588c7dc38ebffc
https://github.com/srz-zumix/iutest/commit/eb82265f96e76133d5e0d8b79e588c7dc38ebffc
@@ -1,87 +1,47 @@ | ||
1 | 1 | version: 1.0.{build} |
2 | -os: | |
3 | -- Visual Studio 2015 | |
4 | -- Visual Studio 2013 | |
2 | +environment: | |
3 | + matrix: | |
4 | + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 | |
5 | + PROJECT_DIR: msvc12 | |
6 | + CMAKE_GENERATOR_NAME: Visual Studio 12 2013 | |
7 | + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 | |
8 | + PROJECT_DIR: msvc14 | |
9 | + CMAKE_GENERATOR_NAME: Visual Studio 14 2015 | |
10 | + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 | |
11 | + PROJECT_DIR: msvc15 | |
12 | + CMAKE_GENERATOR_NAME: Visual Studio 15 2017 | |
13 | + | |
5 | 14 | configuration: |
6 | -- Debug | |
7 | -- Release | |
8 | -init: | |
9 | -- cmd: | |
15 | + - Debug | |
16 | + - Release | |
17 | + | |
18 | +before_build: | |
19 | + - cmd: >- | |
20 | + mkdir build && cd build | |
21 | + | |
22 | + cmake ../projects/cmake -G "%CMAKE_GENERATOR_NAME%" -Dbuild_gtest_samples=ON | |
23 | + | |
24 | + cd .. | |
25 | + | |
10 | 26 | build: |
11 | - project: projects\msvc12\iutest.sln | |
27 | + project: build\iutest.sln | |
12 | 28 | parallel: true |
13 | 29 | verbosity: minimal |
30 | + | |
14 | 31 | after_build: |
15 | -- cmd: >- | |
16 | - "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 | |
32 | + - cmd: >- | |
33 | + xcopy /S /Y /Q test\testdata build\%Configuration%\testdata\ | |
17 | 34 | |
18 | - | |
19 | - cd test | |
20 | - | |
21 | - nmake | |
22 | - | |
23 | - cd ../ | |
24 | 35 | test_script: |
25 | -- cmd: >- | |
26 | - cd projects/msvc12 | |
36 | + - cmd: >- | |
37 | + cd build\%Configuration% | |
27 | 38 | |
28 | - %Configuration%\iutest_sample.exe | |
39 | + for %%a in (*.exe) do %%a || exit /b 1 | |
29 | 40 | |
30 | - if errorlevel 1 exit /b 1 | |
31 | - | |
32 | - | |
33 | - cd %Configuration% | |
34 | - | |
35 | - gtest1.exe | |
36 | - | |
37 | - if errorlevel 1 exit /b 1 | |
38 | - | |
39 | - gtest2.exe | |
40 | - | |
41 | - if errorlevel 1 exit /b 1 | |
42 | - | |
43 | - gtest3.exe | |
44 | - | |
45 | - if errorlevel 1 exit /b 1 | |
46 | - | |
47 | - gtest4.exe | |
48 | - | |
49 | - if errorlevel 1 exit /b 1 | |
50 | - | |
51 | - gtest5.exe | |
52 | - | |
53 | - if errorlevel 1 exit /b 1 | |
54 | - | |
55 | - gtest6.exe | |
56 | - | |
57 | - if errorlevel 1 exit /b 1 | |
58 | - | |
59 | - gtest7.exe | |
60 | - | |
61 | - if errorlevel 1 exit /b 1 | |
62 | - | |
63 | - gtest8.exe | |
64 | - | |
65 | - if errorlevel 1 exit /b 1 | |
66 | - | |
67 | - gtest9.exe --terse_output | |
68 | - | |
69 | - if errorlevel 1 exit /b 1 | |
70 | - | |
71 | - gtest10.exe | |
72 | - | |
73 | - if errorlevel 1 exit /b 1 | |
74 | - | |
75 | - cd ../../../ | |
76 | - | |
77 | - | |
78 | - cd test | |
79 | - | |
80 | - nmake test | |
81 | 41 | notifications: |
82 | -- provider: Email | |
83 | - to: | |
84 | - - zumix.cpp@gmail.com | |
85 | - on_build_success: false | |
86 | - on_build_failure: true | |
87 | - on_build_status_changed: true | |
\ No newline at end of file | ||
42 | + - provider: Email | |
43 | + to: | |
44 | + - zumix.cpp@gmail.com | |
45 | + on_build_success: false | |
46 | + on_build_failure: true | |
47 | + on_build_status_changed: true |
@@ -6,7 +6,7 @@ | ||
6 | 6 | * |
7 | 7 | * @author t.shirayanagi |
8 | 8 | * @par copyright |
9 | - * Copyright (C) 2011-2016, Takazumi Shirayanagi\n | |
9 | + * Copyright (C) 2011-2017, Takazumi Shirayanagi\n | |
10 | 10 | * This software is released under the new BSD License, |
11 | 11 | * see LICENSE |
12 | 12 | */ |
@@ -57,18 +57,34 @@ | ||
57 | 57 | * @param [in] num = 入力バッファサイズ |
58 | 58 | * @return マルチバイト文字列 |
59 | 59 | */ |
60 | +::std::string WideStringToUTF8(const char16_t* str, int num=-1); | |
61 | + | |
62 | +/** | |
63 | + * @brief ワイド文字列からマルチバイトへ変換 | |
64 | + * @param [in] str = 入力 | |
65 | + * @param [in] num = 入力バッファサイズ | |
66 | + * @return マルチバイト文字列 | |
67 | +*/ | |
60 | 68 | ::std::string WideStringToMultiByteString(const char16_t* str, int num=-1); |
61 | 69 | |
62 | 70 | #endif |
63 | 71 | |
64 | -#if IUTEST_HAS_CHAR32_T && (IUTEST_HAS_CXX_HDR_CUCHAR || IUTEST_HAS_CXX_HDR_CODECVT) | |
72 | +#if IUTEST_HAS_CHAR32_T | |
65 | 73 | |
66 | 74 | /** |
67 | -* @brief ワイド文字列からマルチバイトへ変換 | |
68 | -* @param [in] str = 入力 | |
69 | -* @param [in] num = 入力バッファサイズ | |
70 | -* @return マルチバイト文字列 | |
75 | + * @brief ワイド文字列からマルチバイトへ変換 | |
76 | + * @param [in] str = 入力 | |
77 | + * @param [in] num = 入力バッファサイズ | |
78 | + * @return マルチバイト文字列 | |
71 | 79 | */ |
80 | +::std::string WideStringToUTF8(const char32_t* str, int num = -1); | |
81 | + | |
82 | +/** | |
83 | + * @brief ワイド文字列からマルチバイトへ変換 | |
84 | + * @param [in] str = 入力 | |
85 | + * @param [in] num = 入力バッファサイズ | |
86 | + * @return マルチバイト文字列 | |
87 | +*/ | |
72 | 88 | ::std::string WideStringToMultiByteString(const char32_t* str, int num = -1); |
73 | 89 | |
74 | 90 | #endif |
@@ -858,7 +858,7 @@ | ||
858 | 858 | |
859 | 859 | //! explicit instantiation access checking |
860 | 860 | #if !defined(IUTEST_EXPLICIT_INSTANTIATION_ACCESS_PRIVATE_MEMBER_FUNCTION) |
861 | -# if defined(_MSC_VER) && ((_MSC_VER < 1600) || (_MSC_VER == 1900 && defined(_MSC_FULL_VER) && _MSC_FULL_VER < 190024210)) | |
861 | +# if defined(_MSC_VER) && ((_MSC_VER < 1600) || (_MSC_VER == 1900)) | |
862 | 862 | // VS2008 以前では、private なメンバー関数に explicit instantiation でもアクセスできない |
863 | 863 | # define IUTEST_EXPLICIT_INSTANTIATION_ACCESS_PRIVATE_MEMBER_FUNCTION 0 |
864 | 864 | # else |
@@ -868,7 +868,7 @@ | ||
868 | 868 | |
869 | 869 | //! explicit instantiation access checking (static member function) |
870 | 870 | #if !defined(IUTEST_EXPLICIT_INSTANTIATION_ACCESS_PRIVATE_STATIC_MEMBER_FUNCTION) |
871 | -# if defined(_MSC_VER) && ((_MSC_VER < 1900) || (defined(_MSC_FULL_VER) && _MSC_FULL_VER < 190024210)) | |
871 | +# if defined(_MSC_VER) && (_MSC_VER < 1910) | |
872 | 872 | // Visual Studio では、private な static メンバー関数に explicit instantiation でもアクセスできない |
873 | 873 | # define IUTEST_EXPLICIT_INSTANTIATION_ACCESS_PRIVATE_STATIC_MEMBER_FUNCTION 0 |
874 | 874 | # else |
@@ -17,11 +17,11 @@ | ||
17 | 17 | |
18 | 18 | //====================================================================== |
19 | 19 | // define |
20 | -#define IUTEST_VER 0x01160113u //!< iutest version 1.16.1.13 | |
20 | +#define IUTEST_VER 0x01160115u //!< iutest version 1.16.1.15 | |
21 | 21 | #define IUTEST_MAJORVER 0x01u //!< Major Version |
22 | 22 | #define IUTEST_MINORVER 0x16u //!< Minor Version |
23 | 23 | #define IUTEST_MICROVER 0x01u //!< Micro Version |
24 | -#define IUTEST_REVISION 0x13u //!< Revision | |
24 | +#define IUTEST_REVISION 0x15u //!< Revision | |
25 | 25 | |
26 | 26 | #define IUTEST_BUILD IUTEST_MICROVER //!< @deprecated |
27 | 27 |
@@ -66,14 +66,14 @@ | ||
66 | 66 | # gtest サンプル |
67 | 67 | # |
68 | 68 | if (build_gtest_samples) |
69 | - cxx_executable_gtest_sample(sample1_unittest ../../samples/gtest sample1.cc) | |
70 | - cxx_executable_gtest_sample(sample2_unittest ../../samples/gtest sample2.cc) | |
71 | - cxx_executable_gtest_sample(sample3_unittest ../../samples/gtest ) | |
72 | - cxx_executable_gtest_sample(sample4_unittest ../../samples/gtest sample4.cc) | |
73 | - cxx_executable_gtest_sample(sample5_unittest ../../samples/gtest sample1.cc) | |
74 | - cxx_executable_gtest_sample(sample6_unittest ../../samples/gtest ) | |
75 | - cxx_executable_gtest_sample(sample7_unittest ../../samples/gtest ) | |
76 | - cxx_executable_gtest_sample(sample8_unittest ../../samples/gtest ) | |
69 | + cxx_executable_gtest_sample(sample1_unittest ../../samples/gtest sample1.cc main.cc) | |
70 | + cxx_executable_gtest_sample(sample2_unittest ../../samples/gtest sample2.cc main.cc) | |
71 | + cxx_executable_gtest_sample(sample3_unittest ../../samples/gtest main.cc) | |
72 | + cxx_executable_gtest_sample(sample4_unittest ../../samples/gtest sample4.cc main.cc) | |
73 | + cxx_executable_gtest_sample(sample5_unittest ../../samples/gtest sample1.cc main.cc) | |
74 | + cxx_executable_gtest_sample(sample6_unittest ../../samples/gtest main.cc) | |
75 | + cxx_executable_gtest_sample(sample7_unittest ../../samples/gtest main.cc) | |
76 | + cxx_executable_gtest_sample(sample8_unittest ../../samples/gtest main.cc) | |
77 | 77 | cxx_executable_gtest_sample(sample9_unittest ../../samples/gtest ) |
78 | 78 | cxx_executable_gtest_sample(sample10_unittest ../../samples/gtest ) |
79 | 79 | endif() |
@@ -3,6 +3,7 @@ | ||
3 | 3 | SET VCVERSION=14 |
4 | 4 | SET DIRNAME=vc%VCVERSION% |
5 | 5 | |
6 | +pushd . | |
6 | 7 | if not exist tmp mkdir tmp |
7 | 8 | cd tmp |
8 | 9 | if errorlevel 1 goto end |
@@ -10,7 +11,8 @@ | ||
10 | 11 | cd %DIRNAME% |
11 | 12 | if errorlevel 1 goto end |
12 | 13 | |
13 | -cmake -G "Visual Studio %VCVERSION%" ../../ | |
14 | +cmake -G "Visual Studio %VCVERSION%" ../../ %* | |
14 | 15 | |
15 | 16 | :end |
17 | +popd | |
16 | 18 | pause |
@@ -6,7 +6,7 @@ | ||
6 | 6 | * |
7 | 7 | * @author t.shirayanagi |
8 | 8 | * @par copyright |
9 | - * Copyright (C) 2014-2016, Takazumi Shirayanagi\n | |
9 | + * Copyright (C) 2014-2017, Takazumi Shirayanagi\n | |
10 | 10 | * This software is released under the new BSD License, |
11 | 11 | * see LICENSE |
12 | 12 | */ |
@@ -14,7 +14,6 @@ | ||
14 | 14 | //====================================================================== |
15 | 15 | #include "../include/iutest.hpp" |
16 | 16 | |
17 | - | |
18 | 17 | /* --------------------------------------------------- |
19 | 18 | * PrintTo |
20 | 19 | *//*--------------------------------------------------*/ |
@@ -83,6 +83,15 @@ | ||
83 | 83 | @echo } >> $@ |
84 | 84 | |
85 | 85 | |
86 | +# Compile error test. | |
87 | + | |
88 | +IUTEST_COMPILE_ERROR_TEST_OPTION=-c $(CXX) | |
89 | +!if "$(CI)" == "true" | |
90 | +IUTEST_COMPILE_ERROR_TEST_OPTION+= --verbose | |
91 | +!endif | |
92 | + | |
93 | + | |
94 | + | |
86 | 95 | # |
87 | 96 | # Builds a sample test. |
88 | 97 |
@@ -99,5 +108,5 @@ | ||
99 | 108 | |
100 | 109 | $(COMPILEERROR_TARGETS) : $(IUTEST_HEADERS) Makefile |
101 | 110 | # -$(CXX) $(IUTEST_INCLUDE) $(CXXFLAGS) /Fe$@ $@.cpp $(LDFLAGS) |
102 | - $(CXX) $(IUTEST_INCLUDE) $(CXXFLAGS) /Fe$@ $@.cpp $(LDFLAGS) | python ../tools/python/iutest_compile_error_test.py -c $(CXX) --verbose | |
111 | + $(CXX) $(IUTEST_INCLUDE) $(CXXFLAGS) /Fe$@ $@.cpp $(LDFLAGS) | python ../tools/python/iutest_compile_error_test.py $(IUTEST_COMPILE_ERROR_TEST_OPTION) | |
103 | 112 |
@@ -1,3 +1,20 @@ | ||
1 | +# iutest root directory | |
2 | +IUTEST_DIR = ../.. | |
3 | +IUTEST_INCLUDE = -I$(IUTEST_DIR)/include | |
4 | + | |
5 | +# All iutest headers. Usually you shouldn't change this | |
6 | +# definition. | |
7 | +IUTEST_HEADERS = $(IUTEST_DIR)/include/*.hpp \ | |
8 | + $(IUTEST_DIR)/include/impl/*.ipp \ | |
9 | + $(IUTEST_DIR)/include/internal/*.hpp \ | |
10 | + $(IUTEST_DIR)/include/listener/*.hpp \ | |
11 | + $(IUTEST_DIR)/include/util/*.hpp \ | |
12 | + $(IUTEST_DIR)/include/gtest/*.hpp \ | |
13 | + $(IUTEST_DIR)/include/gtest/switch/*.hpp | |
14 | + | |
15 | +TESTS_SOURCES = ../*.cpp \ | |
16 | + ../*.hpp | |
17 | + | |
1 | 18 | MAKE_OPTION=--no-print-directory -C ../ -j4 |
2 | 19 | |
3 | 20 | DISABLE_FEATURE_CONFIG= \ |
@@ -108,7 +125,7 @@ | ||
108 | 125 | $(MAKE) $(MAKE_OPTION) clean |
109 | 126 | $(RM) $(TARGETS) |
110 | 127 | |
111 | -%.dis : | |
128 | +%.dis : $(IUTEST_HEADERS) $(TESTS_SOURCES) $(MAKEFILE) | |
112 | 129 | @echo $(@:%.dis=%) |
113 | 130 | $(MAKE) $(MAKE_OPTION) clean |
114 | 131 | $(MAKE) $(MAKE_OPTION) DEFS=-D$(@:%.dis=%)=0 |
@@ -115,7 +132,7 @@ | ||
115 | 132 | $(MAKE) $(MAKE_OPTION) run DEFS=-D$(@:%.dis=%)=0 |
116 | 133 | @echo ok > $@ |
117 | 134 | |
118 | -%.no : | |
135 | +%.no : $(IUTEST_HEADERS) $(TESTS_SOURCES) $(MAKEFILE) | |
119 | 136 | @echo $(@:%.no=%) |
120 | 137 | $(MAKE) $(MAKE_OPTION) clean |
121 | 138 | $(MAKE) $(MAKE_OPTION) DEFS=-D$(@:%.no=%) |
@@ -122,12 +139,12 @@ | ||
122 | 139 | $(MAKE) $(MAKE_OPTION) run DEFS=-D$(@:%.no=%) |
123 | 140 | @echo ok > $@ |
124 | 141 | |
125 | -no_parame_and_type_test: | |
142 | +no_parame_and_type_test: $(IUTEST_HEADERS) $(TESTS_SOURCES) $(MAKEFILE) | |
126 | 143 | $(MAKE) $(MAKE_OPTION) clean |
127 | 144 | $(MAKE) $(MAKE_OPTION) DEFS="-DIUTEST_HAS_TYPED_TEST=0 -DIUTEST_HAS_PARAM_TEST=0 -DIUTEST_HAS_TYPED_TEST_P=0 -DIUTEST_HAS_VARIADIC_PRED=0" |
128 | 145 | $(MAKE) $(MAKE_OPTION) run DEFS="-DIUTEST_HAS_TYPED_TEST=0 -DIUTEST_HAS_PARAM_TEST=0 -DIUTEST_HAS_TYPED_TEST_P=0 -DIUTEST_HAS_VARIADIC_PRED=0" |
129 | 146 | |
130 | -strstream: | |
147 | +strstream: $(IUTEST_HEADERS) $(TESTS_SOURCES) $(MAKEFILE) | |
131 | 148 | $(MAKE) $(MAKE_OPTION) clean |
132 | 149 | $(MAKE) $(MAKE_OPTION) DEFS="-DIUTEST_HAS_STRINGSTREAM=0 -DIUTEST_HAS_STRSTREAM=1" CXXFLAGS="-Wno-deprecated" |
133 | 150 | $(MAKE) $(MAKE_OPTION) run DEFS="-DIUTEST_HAS_STRINGSTREAM=0 -DIUTEST_HAS_STRSTREAM=1" CXXFLAGS="-Wno-deprecated" |