UnitTest.hpp

This File On Github
Ask A Question

API: latest
module: oatpp
#include "oatpp-test/UnitTest.hpp"

UnitTest

Base class for unit tests.

namespace oatpp { namespace test { 
  class UnitTest {}
}}

Methods

Return Type Name Summary
[none] UnitTest Constructor.
[none] ~UnitTest Default virtual destructor.
void run Multiple implementations:
  1. Run this test repeatedly for specified number of times.
  2. Run this test.
void onRun Override this method. It should contain test logic.
void runTest Run this test repeatedly for specified number of times.

UnitTest::UnitTest

Constructor.

  • @param testTAG - tag used for logs.

UnitTest(const char* testTAG)
  : TAG(testTAG)

UnitTest::~UnitTest

Default virtual destructor.

virtual ~UnitTest() = default

UnitTest::run

  1. Run this test repeatedly for specified number of times.
    • @param times - number of times to run this test.
    void run(v_int32 times)
    
  2. Run this test.
    void run()
    

UnitTest::onRun

Override this method. It should contain test logic.

virtual void onRun() = 0

UnitTest::runTest

Run this test repeatedly for specified number of times.

  • @tparam T - Test class.
  • @param times - number of times to run this test.

template<class T>
static void runTest(v_int32 times)

OATPP_RUN_TEST

Convenience macro to run test.
Usage Example:
OATPP_RUN_TEST(oatpp::test::web::FullTest);

#define OATPP_RUN_TEST(TEST)