[詳解]
15 #ifndef INCG_IRIS_IUTEST_RESULT_HPP_D27B1599_F42F_4E2D_B3EB_FACE24C2B921_
16 #define INCG_IRIS_IUTEST_RESULT_HPP_D27B1599_F42F_4E2D_B3EB_FACE24C2B921_
30 class DefaultGlobalTestPartResultReporter;
39 class TestPartResultReporterInterface
77 : detail::iuCodeMessage(file, line, message), m_type(
type) {}
134 const char*
summary()
const {
return message(); }
146 inline iu_ostream& operator << (iu_ostream& os,
const TestPartResult& result)
148 return os << result.make_message();
163 TestProperty(const ::std::string& key, const ::std::string& value)
164 : m_key(key), m_value(value) {}
170 void SetValue(const ::std::string& value) { m_value = value; }
171 const char* key()
const {
return m_key.c_str(); }
172 const char* value()
const {
return m_value.c_str(); }
180 bool Validate(
const char** ban_list,
size_t size)
const
189 template<
typename Ite>
190 static bool ValidateName(const ::std::string& name, Ite begin, Ite end)
192 return ::std::find(begin, end, name) == end;
194 #if !defined(IUTEST_NO_FUNCTION_TEMPLATE_ORDERING)
196 template<
typename T,
size_t N>
197 static bool ValidateName(const ::std::string& name, T (&ar)[N])
206 ::std::string m_value;
214 typedef ::std::vector<TestPartResult> TestPartResults;
215 typedef ::std::vector<TestProperty> TestPropertys;
231 for( TestPartResults::const_iterator it=m_test_part_results.begin()
232 , end=m_test_part_results.end(); it != end; ++it )
247 for( TestPartResults::const_iterator it=m_test_part_results.begin()
248 , end=m_test_part_results.end(); it != end; ++it )
250 if( it->skipped() || it->assume_failed() )
292 int total_part_count()
const {
return static_cast<int>(m_test_part_results.size()); }
322 for( TestPartResults::const_iterator it=m_test_part_results.begin()
323 , end=m_test_part_results.end(); it != end; ++it )
334 void AddTestPartResult(
const TestPartResult& result) { m_test_part_results.push_back(result); }
338 void RecordProperty(
const TestProperty& prop)
340 for( TestPropertys::iterator it=m_test_propertys.begin()
341 , end=m_test_propertys.end(); it != end; ++it )
343 if( detail::IsStringEqual(it->key(), prop.key()) )
345 it->m_value = prop.m_value;
349 m_test_propertys.push_back(prop);
354 m_test_part_results.clear();
358 m_test_part_results.clear();
359 m_test_propertys.clear();
364 for( TestPartResults::const_iterator it=m_test_part_results.begin()
365 , end=m_test_part_results.end(); it != end; ++it )
367 if( it->type() == eType )
375 friend class UnitTestImpl;
376 friend class TestInfo;
377 friend class TestCase;
378 friend class detail::DefaultGlobalTestPartResultReporter;
380 TestPartResults m_test_part_results;
381 TestPropertys m_test_propertys;
389 #endif // INCG_IRIS_IUTEST_RESULT_HPP_D27B1599_F42F_4E2D_B3EB_FACE24C2B921_
テスト結果を示すクラス
Definition: iutest_result.hpp:213
void SetValue(const ::std::string &value)
値の設定
Definition: iutest_result.hpp:171
iris unit test メッセージ ファイル
virtual void ReportTestPartResult(const TestPartResult &result)=0
テスト結果通知受け取り関数
テスト結果の通知処理インターフェイス
Definition: iutest_result.hpp:40
bool HasNonfatalFailure() const
致命的でないエラーがあるかどうか
Definition: iutest_result.hpp:269
TestProperty(const ::std::string &key, const ::std::string &value)
コンストラクタ
Definition: iutest_result.hpp:164
TimeInMillisec elapsed_time() const IUTEST_CXX_NOEXCEPT_SPEC
テストの実行時間の取得
Definition: iutest_result.hpp:287
@ kNonFatalFailure
致命的ではない失敗
Definition: iutest_result.hpp:66
bool nonfatally_failed() const IUTEST_CXX_NOEXCEPT_SPEC
致命的ではない失敗かどうか
Definition: iutest_result.hpp:125
const char * summary() const
理由
Definition: iutest_result.hpp:135
#define IUTEST_CXX_NOEXCEPT_SPEC
noexcept specification definition
Definition: iutest_compiler.hpp:734
Type
結果のタイプ
Definition: iutest_result.hpp:60
iutest root namespace
Definition: iutest_charcode.hpp:31
static bool ValidateName(const ::std::string &name, T(&ar)[N])
Definition: iutest_result.hpp:198
@ kWarning
警告
Definition: iutest_result.hpp:64
static bool type_is_failed(Type type) IUTEST_CXX_NOEXCEPT_SPEC
失敗かどうか
Definition: iutest_result.hpp:84
bool HasWarning() const
警告があるかどうか
Definition: iutest_result.hpp:281
#define IUTEST_FLAG(name)
フラグセット
Definition: iutest_env.hpp:55
bool Failed() const
失敗したかどうか
Definition: iutest_result.hpp:230
int test_property_count() const
プロパティ総数の取得
Definition: iutest_result.hpp:299
const TestPartResult & GetTestPartResult(int index) const
テスト結果の取得
Definition: iutest_result.hpp:306
bool HasAssumeFailure() const
前提条件エラーがあるかどうか
Definition: iutest_result.hpp:275
TestPartResult(const char *file, int line, const char *message, Type type)
コンストラクタ
Definition: iutest_result.hpp:77
bool fatally_failed() const IUTEST_CXX_NOEXCEPT_SPEC
致命的な失敗かどうか
Definition: iutest_result.hpp:130
#define IUTEST_PP_DISALLOW_COPY_AND_ASSIGN(TypeName)
コピー禁止定義
Definition: iutest_pp.hpp:25
Type type() const IUTEST_CXX_NOEXCEPT_SPEC
結果のタイプ取得
Definition: iutest_result.hpp:140
@ kAssumeFailure
前提条件エラー
Definition: iutest_result.hpp:62
bool succeeded() const IUTEST_CXX_NOEXCEPT_SPEC
成功かどうか(警告を除く)
Definition: iutest_result.hpp:120
@ kSkip
スキップ
Definition: iutest_result.hpp:63
detail::type_least_t< 8 >::UInt TimeInMillisec
ミリ秒単位を扱う型
Definition: iutest_defs.hpp:445
bool HasFatalFailure() const
致命的なエラーがあるかどうか
Definition: iutest_result.hpp:263
bool assume_failed() const IUTEST_CXX_NOEXCEPT_SPEC
前提条件エラーかどうか
Definition: iutest_result.hpp:116
テストプロパティ
Definition: iutest_result.hpp:156
bool skipped() const IUTEST_CXX_NOEXCEPT_SPEC
スキップかどうか
Definition: iutest_result.hpp:112
static bool ValidateName(const ::std::string &name, Ite begin, Ite end)
有効なキーかどうかチェック
Definition: iutest_result.hpp:191
@ kFatalFailure
致命的な失敗
Definition: iutest_result.hpp:67
bool passed() const IUTEST_CXX_NOEXCEPT_SPEC
成功かどうか
Definition: iutest_result.hpp:104
const TestProperty & GetTestProperty(int index) const
プロパティの取得
Definition: iutest_result.hpp:313
bool failed() const IUTEST_CXX_NOEXCEPT_SPEC
失敗かどうか
Definition: iutest_result.hpp:100
bool Validate(const char **ban_list, size_t size) const
有効なキーかどうかチェック
Definition: iutest_result.hpp:181
@ kSuccess
成功
Definition: iutest_result.hpp:65
bool Skipped() const
スキップしたかどうか
Definition: iutest_result.hpp:246
テスト結果を示すクラス
Definition: iutest_result.hpp:54
int total_error_count() const
失敗の数を取得
Definition: iutest_result.hpp:320
bool warning() const IUTEST_CXX_NOEXCEPT_SPEC
警告かどうか
Definition: iutest_result.hpp:108
int total_part_count() const
結果の数を取得
Definition: iutest_result.hpp:293
bool Passed() const
成功したかどうか
Definition: iutest_result.hpp:225