15 #ifndef INCG_IRIS_IUTEST_RESULT_HPP_D27B1599_F42F_4E2D_B3EB_FACE24C2B921_
16 #define INCG_IRIS_IUTEST_RESULT_HPP_D27B1599_F42F_4E2D_B3EB_FACE24C2B921_
32 class DefaultGlobalTestPartResultReporter;
41 class TestPartResultReporterInterface
79 : detail::iuCodeMessage(file, line, message), m_type(
type) {}
136 const char*
summary()
const {
return message(); }
148 inline iu_ostream& operator << (iu_ostream& os,
const TestPartResult& result)
150 return os << result.make_message();
173 const char*
key()
const {
return m_key.c_str(); }
174 const char*
value()
const {
return m_value.c_str(); }
182 bool Validate(
const char** ban_list,
size_t size)
const
191 template<
typename Ite>
192 static bool ValidateName(const ::std::string& name, Ite begin, Ite end)
194 return ::std::find(begin, end, name) == end;
196 #if !defined(IUTEST_NO_FUNCTION_TEMPLATE_ORDERING)
198 template<
typename T,
size_t N>
199 static bool ValidateName(const ::std::string& name, T (&ar)[N])
208 ::std::string m_value;
216 typedef ::std::vector<TestPartResult> TestPartResults;
217 typedef ::std::vector<TestProperty> TestPropertys;
233 for( TestPartResults::const_iterator it=m_test_part_results.begin()
234 , end=m_test_part_results.end(); it != end; ++it )
249 for( TestPartResults::const_iterator it=m_test_part_results.begin()
250 , end=m_test_part_results.end(); it != end; ++it )
252 if( it->skipped() || it->assume_failed() )
294 int total_part_count()
const {
return static_cast<int>(m_test_part_results.size()); }
324 for( TestPartResults::const_iterator it=m_test_part_results.begin()
325 , end=m_test_part_results.end(); it != end; ++it )
336 void AddTestPartResult(
const TestPartResult& result) { m_test_part_results.push_back(result); }
340 void RecordProperty(
const TestProperty& prop)
342 for( TestPropertys::iterator it=m_test_propertys.begin()
343 , end=m_test_propertys.end(); it != end; ++it )
345 if( detail::IsStringEqual(it->key(), prop.key()) )
347 it->m_value = prop.m_value;
351 m_test_propertys.push_back(prop);
356 m_test_part_results.clear();
360 m_test_part_results.clear();
361 m_test_propertys.clear();
366 for( TestPartResults::const_iterator it=m_test_part_results.begin()
367 , end=m_test_part_results.end(); it != end; ++it )
369 if( it->type() == eType )
377 friend class UnitTestImpl;
378 friend class TestInfo;
379 friend class TestSuite;
380 friend class detail::DefaultGlobalTestPartResultReporter;
382 TestPartResults m_test_part_results;
383 TestPropertys m_test_propertys;
テスト結果を示すクラス
Definition: iutest_result.hpp:57
const char * summary() const
理由
Definition: iutest_result.hpp:137
bool failed() const IUTEST_CXX_NOEXCEPT_SPEC
失敗かどうか
Definition: iutest_result.hpp:102
bool skipped() const IUTEST_CXX_NOEXCEPT_SPEC
スキップかどうか
Definition: iutest_result.hpp:114
Type
結果のタイプ
Definition: iutest_result.hpp:63
@ kNonFatalFailure
致命的ではない失敗
Definition: iutest_result.hpp:68
@ kSkip
スキップ
Definition: iutest_result.hpp:65
@ kAssumeFailure
前提条件エラー
Definition: iutest_result.hpp:64
@ kSuccess
成功
Definition: iutest_result.hpp:67
@ kWarning
警告
Definition: iutest_result.hpp:66
@ kFatalFailure
致命的な失敗
Definition: iutest_result.hpp:69
bool nonfatally_failed() const IUTEST_CXX_NOEXCEPT_SPEC
致命的ではない失敗かどうか
Definition: iutest_result.hpp:127
bool succeeded() const IUTEST_CXX_NOEXCEPT_SPEC
成功かどうか(警告を除く)
Definition: iutest_result.hpp:122
bool fatally_failed() const IUTEST_CXX_NOEXCEPT_SPEC
致命的な失敗かどうか
Definition: iutest_result.hpp:132
bool assume_failed() const IUTEST_CXX_NOEXCEPT_SPEC
前提条件エラーかどうか
Definition: iutest_result.hpp:118
bool passed() const IUTEST_CXX_NOEXCEPT_SPEC
成功かどうか
Definition: iutest_result.hpp:106
TestPartResult(const char *file, int line, const char *message, Type type)
コンストラクタ
Definition: iutest_result.hpp:79
Type type() const IUTEST_CXX_NOEXCEPT_SPEC
結果のタイプ取得
Definition: iutest_result.hpp:142
bool warning() const IUTEST_CXX_NOEXCEPT_SPEC
警告かどうか
Definition: iutest_result.hpp:110
static bool type_is_failed(Type type) IUTEST_CXX_NOEXCEPT_SPEC
失敗かどうか
Definition: iutest_result.hpp:86
テスト結果の通知処理インターフェイス
Definition: iutest_result.hpp:43
virtual void ReportTestPartResult(const TestPartResult &result)=0
テスト結果通知受け取り関数
テストプロパティ
Definition: iutest_result.hpp:159
const char * key() const
キーの取得
Definition: iutest_result.hpp:174
TestProperty(const ::std::string &key, const ::std::string &value)
コンストラクタ
Definition: iutest_result.hpp:166
bool Validate(const char **ban_list, size_t size) const
有効なキーかどうかチェック
Definition: iutest_result.hpp:183
static bool ValidateName(const ::std::string &name, Ite begin, Ite end)
有効なキーかどうかチェック
Definition: iutest_result.hpp:193
void SetValue(const ::std::string &value)
値の設定
Definition: iutest_result.hpp:173
const char * value() const
値の取得
Definition: iutest_result.hpp:175
テスト結果を示すクラス
Definition: iutest_result.hpp:216
bool HasAssumeFailure() const
前提条件エラーがあるかどうか
Definition: iutest_result.hpp:277
int test_property_count() const
プロパティ総数の取得
Definition: iutest_result.hpp:301
TimeInMillisec elapsed_time() const IUTEST_CXX_NOEXCEPT_SPEC
テストの実行時間の取得
Definition: iutest_result.hpp:289
int total_part_count() const
結果の数を取得
Definition: iutest_result.hpp:295
bool Passed() const
成功したかどうか
Definition: iutest_result.hpp:227
const TestProperty & GetTestProperty(int index) const
プロパティの取得
Definition: iutest_result.hpp:315
bool HasWarning() const
警告があるかどうか
Definition: iutest_result.hpp:283
int total_error_count() const
失敗の数を取得
Definition: iutest_result.hpp:322
bool HasFatalFailure() const
致命的なエラーがあるかどうか
Definition: iutest_result.hpp:265
const TestPartResult & GetTestPartResult(int index) const
テスト結果の取得
Definition: iutest_result.hpp:308
bool Failed() const
失敗したかどうか
Definition: iutest_result.hpp:232
bool Skipped() const
スキップしたかどうか
Definition: iutest_result.hpp:248
bool HasNonfatalFailure() const
致命的でないエラーがあるかどうか
Definition: iutest_result.hpp:271
#define IUTEST_FLAG(name)
フラグセット
Definition: iutest_env.hpp:57
#define IUTEST_CXX_NOEXCEPT_SPEC
noexcept specification definition
Definition: iutest_compiler.hpp:811
iris unit test メッセージ ファイル
#define IUTEST_PP_DISALLOW_COPY_AND_ASSIGN(TypeName)
コピー禁止定義
Definition: iutest_pp.hpp:31
iutest root namespace
Definition: iutest_charcode.hpp:33
detail::type_least_t< 8 >::UInt TimeInMillisec
ミリ秒単位を扱う型
Definition: iutest_defs.hpp:526