iutest  1.17.1.0
disabledtest.cpp
//======================================================================
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
//======================================================================
#include "../include/iutest.hpp"
/* ---------------------------------------------------
* Diabled テスト
*//*--------------------------------------------------*/
// このテストは無効テスト
IUTEST(TestDisabled, DISABLED_Test1)
{
}
IUTEST(TestDisabled, Test2)
{
}
// テストケースすべてを無効にする
IUTEST(DISABLED_TestCaseDisabled, Test1)
{
}
IUTEST(DISABLED_TestCaseDisabled, Test2)
{
}
// DISABLED Test Tips.
#define DISABLED_MacroTest EnabledTest
#define MacroTest DISABLED_Test
IUTEST(DISABLED_MacroTest, Enable)
{
}
IUTEST(EnabledTest, Count)
{
const ::iutest::TestCase* testcase = ::iutest::UnitTest::GetInstance()->current_test_case();
IUTEST_ASSERT_EQ(2, testcase->total_test_count());
IUTEST_ASSERT_EQ(2, testcase->test_to_run_count());
IUTEST_ASSERT_EQ(0, testcase->disabled_test_count());
IUTEST_ASSERT_TRUE(testcase->Passed());
IUTEST_ASSERT_FALSE(testcase->Failed());
}
IUTEST(MacroTest, NotRun)
{
}
class EnabledTestFixed : public ::iutest::Test {};
typedef EnabledTestFixed DISABLED_TestFixed;
#define MacroTestF DISABLED_TestFixed
#define DISABLED_MacroTestF EnabledTestFixed
IUTEST_F(MacroTestF, NotRun)
{
}
IUTEST_F(DISABLED_MacroTestF, Run)
{
}
IUTEST_F(EnabledTestFixed, Count)
{
const ::iutest::TestCase* testcase = ::iutest::UnitTest::GetInstance()->current_test_case();
IUTEST_ASSERT_EQ(2, testcase->total_test_count());
IUTEST_ASSERT_EQ(2, testcase->test_to_run_count());
IUTEST_ASSERT_EQ(0, testcase->disabled_test_count());
IUTEST_ASSERT_TRUE(testcase->Passed());
IUTEST_ASSERT_FALSE(testcase->Failed());
}
iutest::Test
テストベース
Definition: iutest_body.hpp:43
iutest::UnitTest::GetInstance
static UnitTest * GetInstance()
UnitTest インスタンスの取得
Definition: iutest_core.hpp:41
iutest::UnitTest::current_test_case
const TestCase * current_test_case() const
テスト中の TestCase の取得
Definition: iutest_core.hpp:47
IUTEST_ASSERT_EQ
#define IUTEST_ASSERT_EQ(expected, actual)
== テスト
Definition: iutest.hpp:281
IUTEST_ASSERT_TRUE
#define IUTEST_ASSERT_TRUE(...)
TRUE テスト
Definition: iutest.hpp:342
IUTEST_F
#define IUTEST_F(testfixture_, testname_)
ユーザー指定テスト関数定義マクロ
Definition: iutest.hpp:75
IUTEST
#define IUTEST(testcase_, testname_)
テスト関数定義マクロ
Definition: iutest.hpp:66
IUTEST_ASSERT_FALSE
#define IUTEST_ASSERT_FALSE(...)
FALSE テスト
Definition: iutest.hpp:354
IUTEST_ASSERT_NOTNULL
#define IUTEST_ASSERT_NOTNULL(...)
NOT NULL テスト
Definition: iutest.hpp:379