OKlibrary  0.2.1.6
OKlib::TestSystem::TestBase Class Reference

Base class for tests with auto-insertion. Derived from Test; from this class test classes are to be derived, which shall be executed on their own. More...

#include <TestBaseClass.hpp>

Inheritance diagram for OKlib::TestSystem::TestBase:
OKlib::TestSystem::Test OKlib::TestSystem::Test OKlib::Concepts::ResultElement_basic_test< Res > OKlib::Concepts::ResultElementWithName_basic_test< Res > OKlib::Concepts::ResultElementWithOrder_basic_test< Res > OKlib::Concepts::tests::AtomicCondition_basic< AC > OKlib::Concepts::tests::Literals_basic< Lit > OKlib::Concepts::Variables_basic_test< Var > OKlib::Concepts::VariablesAsIndex_basic_test< Var > OKlib::Concepts::VariablesWithIndex_basic_test< Var > OKlib::DPv::Test_DimacsParser_ClauseSet< DimacsParser > OKlib::DPv::Test_ParserLiteral< ParserLiteral > OKlib::GeneralInputOutput::Test_BasicCounter< BasicCounter > OKlib::GeneralInputOutput::Test_BasicIndentLines< BasicIndentLines > OKlib::GeneralInputOutput::Test_DirectoryIterator< DirectoryIterator > OKlib::GeneralInputOutput::Test_NullStream< NullStream > OKlib::GeneralInputOutput::Test_OStreamDescriptor< OStreamDescriptor > OKlib::GeneralInputOutput::Test_OStreamMultiplexer< OStreamMultiplexer > OKlib::GraphDecomposition::Test_Width_elimination_sequence< Width_elimination_sequence, Graph > OKlib::InputOutput::Test_StandardDIMACSInput< StandardDIMACSInput > OKlib::Iterators::Test_counting_iterator< counting_iterator > OKlib::Parallelism::Test_Counter< Counter > OKlib::Programming::Sequences::tests::CommonPart< CP, ImpPol > OKlib::Refactoring::Test_BoostFilesystemFix OKlib::Refactoring::Test_ExtendIncludeDirectives< ExtendIncludeDirectives > OKlib::Refactoring::Test_ExtendIncludeDirectivesTwoDirectories< ExtendIncludeDirectivesTwoDirectories > OKlib::Refactoring::Test_ExtendIncludeDirectivesTwoRanges< ExtendIncludeDirectivesTwoRanges > OKlib::Refactoring::Test_IncludeDirective< Include_Directive > OKlib::Refactoring::Test_IncludeParsingGrammar< Include_Parsing_Grammar > OKlib::Refactoring::Test_Parsing< Program_Representation_Includes, StreamExtractor > OKlib::Refactoring::Test_ProgramRepresentationIncludes< Program_Representation_Includes > OKlib::SATCompetition::Test_Copy_results_ParserResult_Result OKlib::SATCompetition::Test_Copy_results_ParserResultRandomSat_ResultRandomSat OKlib::SATCompetition::Test_ElementaryAnalysis< ElementaryAnalysis > OKlib::SATCompetition::Test_LexicographicalEvaluation< LexicographicalEvaluation > OKlib::SATCompetition::Test_LexicographicalEvaluationRandom< LexicographicalEvaluationRandom > OKlib::SATCompetition::Test_ParserResult_Result< Result > OKlib::SATCompetition::Test_ParserResult_ResultRandomSat< ResultRandomSat > OKlib::SATCompetition::Test_ParserResultElement_AverageTime< AverageTime > OKlib::SATCompetition::Test_ParserResultElement_Benchmark< Benchmark > OKlib::SATCompetition::Test_ParserResultElement_RandomKSat< RandomKSat > OKlib::SATCompetition::Test_ParserResultElement_RandomKSat_n< RandomKSat_n > OKlib::SATCompetition::Test_ParserResultElement_SATStatus< SATStatus > OKlib::SATCompetition::Test_ParserResultElement_Series< Series > OKlib::SATCompetition::Test_ParserResultElement_Solver< Solver > OKlib::SATCompetition::Test_ParserResultElement_SuperSeries< SuperSeries > OKlib::SATCompetition::Test_ParserResultElement_TimeOut< TimeOut > OKlib::SATCompetition::Test_PurseScoring< PurseScoring > OKlib::SATCompetition::Test_RepresentationSolverSeries< LexicographicalEvaluation > OKlib::SATCompetition::Test_ResultDatabase_ResultIterator< ResultDatabase > OKlib::Satisfiability::FiniteFunctions::tests::Test_QuineMcCluskey< QuineMcCluskey > OKlib::SearchDataStructures::Test_AssociativePrefixContainer< PrefixContainer > OKlib::SetAlgorithms::Test_Intersection< Intersection > OKlib::SetAlgorithms::Test_MapValue< MapValue > OKlib::SetAlgorithms::Test_Subsumption_elimination< Subsumption_elimination > OKlib::SetAlgorithms::Test_Sum_sizes< Sum_sizes > OKlib::SetAlgorithms::Test_Union< Union > OKlib::SetAlgorithms::tests::Test_Subsumption_hypergraph< Subsumption_hypergraph > OKlib::TestExecutionTools::Test_AllCombinations< AllCombinations > OKlib::TestExecutionTools::Test_AllVariations< AllVariations > OKlib::TestExecutionTools::Test_Empty< Empty > OKlib::TestExecutionTools::Test_Id< Id > OKlib::TestExecutionTools::Test_TestAntisymmetry< TestAntisymmetry > OKlib::TestExecutionTools::Test_TestAsymmetry< TestAsymmetry > OKlib::TestExecutionTools::Test_TestCounter< TestCounter > OKlib::TestExecutionTools::Test_TestEquivalence< TestEquivalence > OKlib::TestExecutionTools::Test_TestIrreflexivity< TestIrreflexivity > OKlib::TestExecutionTools::Test_TestQuasiorder< TestQuasiorder > OKlib::TestExecutionTools::Test_TestReflexivity< TestReflexivity > OKlib::TestExecutionTools::Test_TestSymmetry< TestSymmetry > OKlib::TestExecutionTools::Test_TestTotality< TestTotality > OKlib::TestExecutionTools::Test_TestTransitivity< TestTransitivity > OKlib::TestExecutionTools::Test_TestTrichotomy< TestTrichotomy > OKlib::TestExecutionTools::Test_Total< Total > OKlib::TestSystem::tests::Test1 OKlib::TestSystem::tests::Test2 OKlib::TestSystem::tests::Test3 OKlib::TestSystem::tests::TestSystem OKlib::Van_der_Waerden_hypergraph::Test_Arithmetic_progression_Integer< Arithmetic_progression > OKlib::Van_der_Waerden_hypergraph::Test_Iterator_arithmetic_progression_Integer< Iterator_arithmetic_progression > Test1

List of all members.

Public Member Functions

 TestBase ()
virtual ~TestBase ()
TestBaseset_depth (const ::OKlib::TestSystem::depth_number_type d)
 Changing the (assumed) test-function-nesting-level.

Static Public Member Functions

static int run_tests_default (std::ostream &out)

Protected Member Functions

void insert (TestBase *const p) const
 TestBase (::OKlib::Messages::Utilities::FileIdentification *const file_name,::OKlib::Messages::Utilities::LineIdentification *const line_number, const char *const test_function)
 The only constructor.
::OKlib::TestSystem::depth_number_type depth () const
 Accessor function for current nesting-depth.
void log (const ::OKlib::Messages::MessagesBase &m)
 Test-meta-functions create short log-messages via this member function.
void log (const ::OKlib::Messages::MessagesBase &m,::OKlib::Messages::Utilities::LineIdentification *const line,::OKlib::Messages::Utilities::FileIdentification *const file) const
 Test-meta-functions create full log-messages via this member function:
std::ostream & log_stream ()
 Access to the log-stream.
::OKlib::TestSystem::messages::BasicTestDescription description () const
 The basic description of the test class.

Protected Attributes

const
::OKlib::TestSystem::TestLevel
level_p
 Pointer to the test-level object (a static constant, so no ownership issues)
const char *const test_function_type_name
 Name of the test-meta-function (which is simply the (complete) type).

Detailed Description

Base class for tests with auto-insertion. Derived from Test; from this class test classes are to be derived, which shall be executed on their own.

Derived from class Test, to be used as base class for test-meta-functions (by the user of the test system).

Adds protected member function insert (for the self-insertion of the test object) and static member function run_tests_default.

Todo:
Use Messages.

Test-meta-functions F are derived from TestBase; the construction of F passes information about the identity of F to the base class, and private member functions F::test, overloaded on the (static) test level, are responsible for performing the test (F::test receives the log-stream as second parameter, passed to the base class, which is responsible for managing the log-stream).

The public members are:

  • the (virtual) destructor
  • member function set_depth.

In principle the nesting level could be set (once and for all) during construction, however in our way it is easier to have parameterised tests, where the parameters are passed to the constructor of the test-object. So for example we can use OKLIB_TEST_RETHROW(::OKlib::Module::tests::Test(x)); where x is a parameter: OKLIB_TEST_RETHROW doesn't need to assume anything on the construction of the test-object, but can assume it has been constructed, and then changes the nesting-level *afterwards*. It would need more complex macro-programming to enable syntax like OKLIB_TEST_RETHROW(::OKlib::Module::tests::Test); OKLIB_TEST_RETHROW(::OKlib::Module::tests::Test, x); OKLIB_TEST_RETHROW(::OKlib::Module::tests::Test, x, y); set_depth is used by OKLIB_TEST_RETHROW to (re)set the new testobject, and thus must be public (although it does not really belong to the interface of TestBase).

Definition at line 86 of file TestBaseClass.hpp.


Constructor & Destructor Documentation

OKlib::TestSystem::TestBase::TestBase ( ) [inline]

Definition at line 128 of file TestBaseClass.hpp.

virtual OKlib::TestSystem::TestBase::~TestBase ( ) [inline, virtual]

Definition at line 130 of file TestBaseClass.hpp.

OKlib::TestSystem::TestBase::TestBase ( ::OKlib::Messages::Utilities::FileIdentification *const  file_name,
::OKlib::Messages::Utilities::LineIdentification *const  line_number,
const char *const  test_function 
) [inline, protected]

The only constructor.

Definition at line 118 of file TestBaseClass_DesignStudy.hpp.


Member Function Documentation

Accessor function for current nesting-depth.

Used when constructing a nested test, which must be informed about its new nesting-depth (which is depth()+1).

Definition at line 136 of file TestBaseClass_DesignStudy.hpp.

The basic description of the test class.

Definition at line 237 of file TestBaseClass_DesignStudy.hpp.

References level_p, and test_function_type_name.

Referenced by log().

void OKlib::TestSystem::TestBase::insert ( TestBase *const  p) const [inline, protected]

Definition at line 98 of file TestBaseClass.hpp.

Referenced by OKlib::Concepts::ResultElement_basic_test< Res >::ResultElement_basic_test(), OKlib::Concepts::ResultElementWithName_basic_test< Res >::ResultElementWithName_basic_test(), OKlib::Concepts::ResultElementWithOrder_basic_test< Res >::ResultElementWithOrder_basic_test(), Test1::Test1(), OKlib::TestExecutionTools::Test_AllCombinations< AllCombinations >::Test_AllCombinations(), OKlib::TestExecutionTools::Test_AllVariations< AllVariations >::Test_AllVariations(), OKlib::Van_der_Waerden_hypergraph::Test_Arithmetic_progression_Integer< Arithmetic_progression >::Test_Arithmetic_progression_Integer(), OKlib::GeneralInputOutput::Test_BasicCounter< BasicCounter >::Test_BasicCounter(), OKlib::GeneralInputOutput::Test_BasicIndentLines< BasicIndentLines >::Test_BasicIndentLines(), OKlib::SATCompetition::Test_Copy_results_ParserResult_Result::Test_Copy_results_ParserResult_Result(), OKlib::SATCompetition::Test_Copy_results_ParserResultRandomSat_ResultRandomSat::Test_Copy_results_ParserResultRandomSat_ResultRandomSat(), OKlib::Parallelism::Test_Counter< Counter >::Test_Counter(), OKlib::Iterators::Test_counting_iterator< counting_iterator >::Test_counting_iterator(), OKlib::DPv::Test_DimacsParser_ClauseSet< DimacsParser >::Test_DimacsParser_ClauseSet(), OKlib::SATCompetition::Test_ElementaryAnalysis< ElementaryAnalysis >::Test_ElementaryAnalysis(), OKlib::TestExecutionTools::Test_Empty< Empty >::Test_Empty(), OKlib::TestExecutionTools::Test_Id< Id >::Test_Id(), OKlib::SetAlgorithms::Test_Intersection< Intersection >::Test_Intersection(), OKlib::Van_der_Waerden_hypergraph::Test_Iterator_arithmetic_progression_Integer< Iterator_arithmetic_progression >::Test_Iterator_arithmetic_progression_Integer(), OKlib::SATCompetition::Test_LexicographicalEvaluation< LexicographicalEvaluation >::Test_LexicographicalEvaluation(), OKlib::SetAlgorithms::Test_MapValue< MapValue >::Test_MapValue(), OKlib::GeneralInputOutput::Test_NullStream< NullStream >::Test_NullStream(), OKlib::GeneralInputOutput::Test_OStreamDescriptor< OStreamDescriptor >::Test_OStreamDescriptor(), OKlib::GeneralInputOutput::Test_OStreamMultiplexer< OStreamMultiplexer >::Test_OStreamMultiplexer(), OKlib::DPv::Test_ParserLiteral< ParserLiteral >::Test_ParserLiteral(), OKlib::SATCompetition::Test_ParserResult_Result< Result >::Test_ParserResult_Result(), OKlib::SATCompetition::Test_ParserResult_ResultRandomSat< ResultRandomSat >::Test_ParserResult_ResultRandomSat(), OKlib::SATCompetition::Test_ParserResultElement_AverageTime< AverageTime >::Test_ParserResultElement_AverageTime(), OKlib::SATCompetition::Test_ParserResultElement_Benchmark< Benchmark >::Test_ParserResultElement_Benchmark(), OKlib::SATCompetition::Test_ParserResultElement_RandomKSat< RandomKSat >::Test_ParserResultElement_RandomKSat(), OKlib::SATCompetition::Test_ParserResultElement_RandomKSat_n< RandomKSat_n >::Test_ParserResultElement_RandomKSat_n(), OKlib::SATCompetition::Test_ParserResultElement_SATStatus< SATStatus >::Test_ParserResultElement_SATStatus(), OKlib::SATCompetition::Test_ParserResultElement_Series< Series >::Test_ParserResultElement_Series(), OKlib::SATCompetition::Test_ParserResultElement_Solver< Solver >::Test_ParserResultElement_Solver(), OKlib::SATCompetition::Test_ParserResultElement_SuperSeries< SuperSeries >::Test_ParserResultElement_SuperSeries(), OKlib::SATCompetition::Test_ParserResultElement_TimeOut< TimeOut >::Test_ParserResultElement_TimeOut(), OKlib::SATCompetition::Test_PurseScoring< PurseScoring >::Test_PurseScoring(), OKlib::SATCompetition::Test_RepresentationSolverSeries< LexicographicalEvaluation >::Test_RepresentationSolverSeries(), OKlib::SATCompetition::Test_ResultDatabase_ResultIterator< ResultDatabase >::Test_ResultDatabase_ResultIterator(), OKlib::InputOutput::Test_StandardDIMACSInput< StandardDIMACSInput >::Test_StandardDIMACSInput(), OKlib::SetAlgorithms::Test_Sum_sizes< Sum_sizes >::Test_Sum_sizes(), OKlib::TestExecutionTools::Test_TestAntisymmetry< TestAntisymmetry >::Test_TestAntisymmetry(), OKlib::TestExecutionTools::Test_TestAsymmetry< TestAsymmetry >::Test_TestAsymmetry(), OKlib::TestExecutionTools::Test_TestCounter< TestCounter >::Test_TestCounter(), OKlib::TestExecutionTools::Test_TestEquivalence< TestEquivalence >::Test_TestEquivalence(), OKlib::TestExecutionTools::Test_TestIrreflexivity< TestIrreflexivity >::Test_TestIrreflexivity(), OKlib::TestExecutionTools::Test_TestQuasiorder< TestQuasiorder >::Test_TestQuasiorder(), OKlib::TestExecutionTools::Test_TestReflexivity< TestReflexivity >::Test_TestReflexivity(), OKlib::TestExecutionTools::Test_TestSymmetry< TestSymmetry >::Test_TestSymmetry(), OKlib::TestExecutionTools::Test_TestTotality< TestTotality >::Test_TestTotality(), OKlib::TestExecutionTools::Test_TestTransitivity< TestTransitivity >::Test_TestTransitivity(), OKlib::TestExecutionTools::Test_TestTrichotomy< TestTrichotomy >::Test_TestTrichotomy(), OKlib::TestExecutionTools::Test_Total< Total >::Test_Total(), OKlib::SetAlgorithms::Test_Union< Union >::Test_Union(), OKlib::GraphDecomposition::Test_Width_elimination_sequence< Width_elimination_sequence, Graph >::Test_Width_elimination_sequence(), OKlib::Concepts::Variables_basic_test< Var >::Variables_basic_test(), OKlib::Concepts::VariablesAsIndex_basic_test< Var >::VariablesAsIndex_basic_test(), and OKlib::Concepts::VariablesWithIndex_basic_test< Var >::VariablesWithIndex_basic_test().

void OKlib::TestSystem::TestBase::log ( const ::OKlib::Messages::MessagesBase m) [inline, protected]

Test-meta-functions create short log-messages via this member function.

Definition at line 221 of file TestBaseClass_DesignStudy.hpp.

Test-meta-functions create full log-messages via this member function:

Definition at line 227 of file TestBaseClass_DesignStudy.hpp.

References description().

std::ostream& OKlib::TestSystem::TestBase::log_stream ( ) [inline, protected]

Access to the log-stream.

Definition at line 234 of file TestBaseClass_DesignStudy.hpp.

static int OKlib::TestSystem::TestBase::run_tests_default ( std::ostream &  out) [inline, static]

Definition at line 106 of file TestBaseClass.hpp.

References OKlib::TestSystem::Test::perform_test().

Referenced by main().

Changing the (assumed) test-function-nesting-level.

Definition at line 140 of file TestBaseClass_DesignStudy.hpp.


Member Data Documentation

Pointer to the test-level object (a static constant, so no ownership issues)

Via this pointer we have access to the *original* test-level, so that nested test-meta-functions can perform tests at the original test-level (note that in the TestBase::test functions (see below) only the decayed (static) test-level is available).

Definition at line 112 of file TestBaseClass_DesignStudy.hpp.

Referenced by description().

Name of the test-meta-function (which is simply the (complete) type).

Definition at line 115 of file TestBaseClass_DesignStudy.hpp.

Referenced by description().


The documentation for this class was generated from the following files: