Changeset 9b6b2f


Ignore:
Timestamp:
Feb 25, 2010, 2:17:15 PM (15 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
c296c2, cee0a17
Parents:
685100
Message:

Tests now work with Eclipse ECUT's TestRunner.

  • new switch in configure.ac: --enable-ecut
  • all tests are compiled as single test as before
  • and a new TestRunner test suite that combines all test into a single executable which can be run as CppUnit program in Eclipse (and then gives JUnit like output).
Files:
2 added
26 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    r685100 r9b6b2f  
    6666fi
    6767
     68# add replacement/saturation hydrogen or not
     69AC_ARG_ENABLE([ecut],AS_HELP_STRING([--enable-ecut],[Use ECut TestRunnerClient (default is yes)]),
     70              [enable_ecut=$enableval], [enable_ecut=yes])
     71if test x"$enable_ecut" = xyes; then
     72  AC_DEFINE(HAVE_ECUT,1, ["Use ECut TestRunnerClient instead of our own."])
     73  AC_SUBST(HAVE_ECUT)
     74fi
     75
    6876# Check for "extern inline", using a modified version
    6977# of the test for AC_C_INLINE from acspecific.mt
  • src/unittests/ActOnAllUnitTest.cpp

    r685100 r9b6b2f  
    1616#include "memoryallocator.hpp"
    1717#include "vector.hpp"
     18
     19#ifdef HAVE_TESTRUNNER
     20#include "UnitTestMain.hpp"
     21#endif /*HAVE_TESTRUNNER*/
    1822
    1923/********************************************** Test classes **************************************/
     
    108112  }
    109113};
    110 
    111 
    112 /********************************************** Main routine **************************************/
    113 
    114 int main(int argc, char **argv)
    115 {
    116   // Get the top level suite from the registry
    117   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    118 
    119   // Adds the test to the list of test to run
    120   CppUnit::TextUi::TestRunner runner;
    121   runner.addTest( suite );
    122 
    123   // Change the default outputter to a compiler error format outputter
    124   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    125                                                        std::cerr ) );
    126   // Run the tests.
    127   bool wasSucessful = runner.run();
    128 
    129   // Return error code 1 if the one of test failed.
    130   return wasSucessful ? 0 : 1;
    131 };
  • src/unittests/ActionSequenceTest.cpp

    r685100 r9b6b2f  
    1313#include "Actions/Action.hpp"
    1414#include "Actions/ActionSequence.hpp"
     15
     16#ifdef HAVE_TESTRUNNER
     17#include "UnitTestMain.hpp"
     18#endif /*HAVE_TESTRUNNER*/
     19
     20/********************************************** Test classes **************************************/
    1521
    1622// Registers the fixture into the 'registry'
     
    193199
    194200
    195 /********************************************** Main routine **************************************/
    196 
    197 int main(int argc, char **argv)
    198 {
    199   // Get the top level suite from the registry
    200   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    201 
    202   // Adds the test to the list of test to run
    203   CppUnit::TextUi::TestRunner runner;
    204   runner.addTest( suite );
    205 
    206   // Change the default outputter to a compiler error format outputter
    207   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    208                                                        std::cerr ) );
    209   // Run the tests.
    210   bool wasSucessful = runner.run();
    211 
    212   // Return error code 1 if the one of test failed.
    213   return wasSucessful ? 0 : 1;
    214 };
  • src/unittests/AnalysisCorrelationToPointUnitTest.cpp

    r685100 r9b6b2f  
    2424#include "periodentafel.hpp"
    2525#include "tesselation.hpp"
     26
     27#ifdef HAVE_TESTRUNNER
     28#include "UnitTestMain.hpp"
     29#endif /*HAVE_TESTRUNNER*/
    2630
    2731/********************************************** Test classes **************************************/
     
    140144
    141145};
    142 
    143 /********************************************** Main routine **************************************/
    144 
    145 int main(int argc, char **argv)
    146 {
    147   // Get the top level suite from the registry
    148   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    149 
    150   // Adds the test to the list of test to run
    151   CppUnit::TextUi::TestRunner runner;
    152   runner.addTest( suite );
    153 
    154   // Change the default outputter to a compiler error format outputter
    155   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    156                                                        std::cerr ) );
    157   // Run the tests.
    158   bool wasSucessful = runner.run();
    159 
    160   // Return error code 1 if the one of test failed.
    161   return wasSucessful ? 0 : 1;
    162 };
  • src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp

    r685100 r9b6b2f  
    2424#include "periodentafel.hpp"
    2525#include "tesselation.hpp"
     26
     27#ifdef HAVE_TESTRUNNER
     28#include "UnitTestMain.hpp"
     29#endif /*HAVE_TESTRUNNER*/
    2630
    2731/********************************************** Test classes **************************************/
     
    211215
    212216};
    213 
    214 /********************************************** Main routine **************************************/
    215 
    216 int main(int argc, char **argv)
    217 {
    218   // Get the top level suite from the registry
    219   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    220 
    221   // Adds the test to the list of test to run
    222   CppUnit::TextUi::TestRunner runner;
    223   runner.addTest( suite );
    224 
    225   // Change the default outputter to a compiler error format outputter
    226   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    227                                                        std::cerr ) );
    228   // Run the tests.
    229   bool wasSucessful = runner.run();
    230 
    231   // Return error code 1 if the one of test failed.
    232   return wasSucessful ? 0 : 1;
    233 };
  • src/unittests/AnalysisPairCorrelationUnitTest.cpp

    r685100 r9b6b2f  
    2424#include "periodentafel.hpp"
    2525#include "tesselation.hpp"
     26
     27#ifdef HAVE_TESTRUNNER
     28#include "UnitTestMain.hpp"
     29#endif /*HAVE_TESTRUNNER*/
    2630
    2731/********************************************** Test classes **************************************/
     
    132136  CPPUNIT_ASSERT_EQUAL( 6, tester->second );
    133137};
    134 
    135 /********************************************** Main routine **************************************/
    136 
    137 int main(int argc, char **argv)
    138 {
    139   // Get the top level suite from the registry
    140   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    141 
    142   // Adds the test to the list of test to run
    143   CppUnit::TextUi::TestRunner runner;
    144   runner.addTest( suite );
    145 
    146   // Change the default outputter to a compiler error format outputter
    147   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    148                                                        std::cerr ) );
    149   // Run the tests.
    150   bool wasSucessful = runner.run();
    151 
    152   // Return error code 1 if the one of test failed.
    153   return wasSucessful ? 0 : 1;
    154 };
  • src/unittests/CacheableTest.cpp

    r685100 r9b6b2f  
    1515
    1616#include "Patterns/Cacheable.hpp"
     17
     18#ifdef HAVE_TESTRUNNER
     19#include "UnitTestMain.hpp"
     20#endif /*HAVE_TESTRUNNER*/
     21
     22/********************************************** Test classes **************************************/
    1723
    1824// Registers the fixture into the 'registry'
     
    7783  CPPUNIT_ASSERT_EQUAL( true, numbers->hasRecalced);
    7884}
    79 
    80 
    81 
    82 /********************************************** Main routine **************************************/
    83 
    84 int main(int argc, char **argv)
    85 {
    86   // Get the top level suite from the registry
    87   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    88 
    89   // Adds the test to the list of test to run
    90   CppUnit::TextUi::TestRunner runner;
    91   runner.addTest( suite );
    92 
    93   // Change the default outputter to a compiler error format outputter
    94   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    95                                                        std::cerr ) );
    96   // Run the tests.
    97   bool wasSucessful = runner.run();
    98 
    99   // Return error code 1 if the one of test failed.
    100   return wasSucessful ? 0 : 1;
    101 };
    102 
  • src/unittests/DescriptorUnittest.cpp

    r685100 r9b6b2f  
    1919#include "atom.hpp"
    2020
     21#ifdef HAVE_TESTRUNNER
     22#include "UnitTestMain.hpp"
     23#endif /*HAVE_TESTRUNNER*/
     24
     25/********************************************** Test classes **************************************/
    2126// Registers the fixture into the 'registry'
    2227CPPUNIT_TEST_SUITE_REGISTRATION( DescriptorUnittest );
     
    157162  }
    158163}
    159 
    160 /********************************************** Main routine **************************************/
    161 
    162 int main(int argc, char **argv)
    163 {
    164   // Get the top level suite from the registry
    165   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    166 
    167   // Adds the test to the list of test to run
    168   CppUnit::TextUi::TestRunner runner;
    169   runner.addTest( suite );
    170 
    171   // Change the default outputter to a compiler error format outputter
    172   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    173                                                        std::cerr ) );
    174   // Run the tests.
    175   bool wasSucessful = runner.run();
    176 
    177   // Return error code 1 if the one of test failed.
    178   return wasSucessful ? 0 : 1;
    179 };
  • src/unittests/Makefile.am

    r685100 r9b6b2f  
    3434 
    3535check_PROGRAMS = $(TESTS)
    36 noinst_PROGRAMS = $(TESTS)
     36noinst_PROGRAMS = $(TESTS) TestRunner
    3737
    3838GSLLIBS = ../libgslwrapper.a
    3939ALLLIBS = ../libmolecuilder.a ${GSLLIBS} $(BOOST_LIB) ${BOOST_THREAD_LIB}
    4040
    41 ActOnAllUnitTest_SOURCES = ../test/ActOnAllTest.hpp ActOnAllUnitTest.cpp ActOnAllUnitTest.hpp
     41TESTSOURCES = \
     42  ActOnAllUnitTest.cpp \
     43  analysisbondsunittest.cpp \
     44  AnalysisCorrelationToPointUnitTest.cpp \
     45  AnalysisCorrelationToSurfaceUnitTest.cpp  \
     46  AnalysisPairCorrelationUnitTest.cpp \
     47  bondgraphunittest.cpp \
     48  gslmatrixsymmetricunittest.cpp \
     49  gslmatrixunittest.cpp \
     50  gslvectorunittest.cpp \
     51  infounittest.cpp \
     52  linearsystemofequationsunittest.cpp \
     53  listofbondsunittest.cpp \
     54  logunittest.cpp \
     55  memoryallocatorunittest.cpp  \
     56  memoryusageobserverunittest.cpp \
     57  stackclassunittest.cpp \
     58  tesselationunittest.cpp \
     59  tesselation_boundarytriangleunittest.cpp \
     60  tesselation_insideoutsideunittest.cpp \
     61  vectorunittest.cpp \
     62  ActionSequenceTest.cpp \
     63  ObserverTest.cpp \
     64  CacheableTest.cpp \
     65  DescriptorUnittest.cpp
     66
     67TESTHEADERS = \
     68  analysis_correlation.hpp
     69
     70ActOnAllUnitTest_SOURCES = UnitTestMain.cpp ../test/ActOnAllTest.hpp ActOnAllUnitTest.cpp ActOnAllUnitTest.hpp
    4271ActOnAllUnitTest_LDADD = ${ALLLIBS}
    4372
    44 AnalysisBondsUnitTests_SOURCES = analysisbondsunittest.cpp analysisbondsunittest.hpp
     73AnalysisBondsUnitTests_SOURCES = UnitTestMain.cpp analysisbondsunittest.cpp analysisbondsunittest.hpp
    4574AnalysisBondsUnitTests_LDADD = ${ALLLIBS}
    4675
    47 AnalysisCorrelationToPointUnitTest_SOURCES = analysis_correlation.hpp AnalysisCorrelationToPointUnitTest.cpp AnalysisCorrelationToPointUnitTest.hpp
     76AnalysisCorrelationToPointUnitTest_SOURCES = UnitTestMain.cpp analysis_correlation.hpp AnalysisCorrelationToPointUnitTest.cpp AnalysisCorrelationToPointUnitTest.hpp
    4877AnalysisCorrelationToPointUnitTest_LDADD = ${ALLLIBS}
    4978
    50 AnalysisCorrelationToSurfaceUnitTest_SOURCES = analysis_correlation.hpp AnalysisCorrelationToSurfaceUnitTest.cpp AnalysisCorrelationToSurfaceUnitTest.hpp
     79AnalysisCorrelationToSurfaceUnitTest_SOURCES = UnitTestMain.cpp analysis_correlation.hpp AnalysisCorrelationToSurfaceUnitTest.cpp AnalysisCorrelationToSurfaceUnitTest.hpp
    5180AnalysisCorrelationToSurfaceUnitTest_LDADD = ${ALLLIBS}
    5281
    53 AnalysisPairCorrelationUnitTest_SOURCES = analysis_correlation.hpp AnalysisPairCorrelationUnitTest.cpp AnalysisPairCorrelationUnitTest.hpp
     82AnalysisPairCorrelationUnitTest_SOURCES = UnitTestMain.cpp analysis_correlation.hpp AnalysisPairCorrelationUnitTest.cpp AnalysisPairCorrelationUnitTest.hpp
    5483AnalysisPairCorrelationUnitTest_LDADD = ${ALLLIBS}
    5584
    56 BondGraphUnitTest_SOURCES = bondgraphunittest.cpp bondgraphunittest.hpp
     85BondGraphUnitTest_SOURCES = UnitTestMain.cpp bondgraphunittest.cpp bondgraphunittest.hpp
    5786BondGraphUnitTest_LDADD = ${ALLLIBS}
    5887
    59 GSLMatrixSymmetricUnitTest_SOURCES = gslmatrixsymmetricunittest.cpp gslmatrixsymmetricunittest.hpp
     88GSLMatrixSymmetricUnitTest_SOURCES = UnitTestMain.cpp gslmatrixsymmetricunittest.cpp gslmatrixsymmetricunittest.hpp
    6089GSLMatrixSymmetricUnitTest_LDADD = ${GSLLIBS}
    6190
    62 GSLMatrixUnitTest_SOURCES = gslmatrixunittest.cpp gslmatrixunittest.hpp
     91GSLMatrixUnitTest_SOURCES = UnitTestMain.cpp gslmatrixunittest.cpp gslmatrixunittest.hpp
    6392GSLMatrixUnitTest_LDADD = ${GSLLIBS}
    6493
    65 GSLVectorUnitTest_SOURCES = gslvectorunittest.cpp gslvectorunittest.hpp
     94GSLVectorUnitTest_SOURCES = UnitTestMain.cpp gslvectorunittest.cpp gslvectorunittest.hpp
    6695GSLVectorUnitTest_LDADD = ${GSLLIBS}
    6796
    68 InfoUnitTest_SOURCES = infounittest.cpp infounittest.hpp
     97InfoUnitTest_SOURCES = UnitTestMain.cpp infounittest.cpp infounittest.hpp
    6998InfoUnitTest_LDADD = ${ALLLIBS}
    7099
    71 LinearSystemOfEquationsUnitTest_SOURCES = linearsystemofequationsunittest.cpp linearsystemofequationsunittest.hpp
     100LinearSystemOfEquationsUnitTest_SOURCES = UnitTestMain.cpp linearsystemofequationsunittest.cpp linearsystemofequationsunittest.hpp
    72101LinearSystemOfEquationsUnitTest_LDADD = ${ALLLIBS}
    73102
    74 ListOfBondsUnitTest_SOURCES = listofbondsunittest.cpp listofbondsunittest.hpp
     103ListOfBondsUnitTest_SOURCES = UnitTestMain.cpp listofbondsunittest.cpp listofbondsunittest.hpp
    75104ListOfBondsUnitTest_LDADD = ${ALLLIBS}
    76105
    77 LogUnitTest_SOURCES = logunittest.cpp logunittest.hpp
     106LogUnitTest_SOURCES = UnitTestMain.cpp logunittest.cpp logunittest.hpp
    78107LogUnitTest_LDADD = ${ALLLIBS}
    79108
    80 MemoryAllocatorUnitTest_SOURCES = memoryallocatorunittest.cpp memoryallocatorunittest.hpp
     109MemoryAllocatorUnitTest_SOURCES = UnitTestMain.cpp memoryallocatorunittest.cpp memoryallocatorunittest.hpp
    81110MemoryAllocatorUnitTest_LDADD = ${ALLLIBS}
    82111
    83 MemoryUsageObserverUnitTest_SOURCES = memoryusageobserverunittest.cpp memoryusageobserverunittest.hpp
     112MemoryUsageObserverUnitTest_SOURCES = UnitTestMain.cpp memoryusageobserverunittest.cpp memoryusageobserverunittest.hpp
    84113MemoryUsageObserverUnitTest_LDADD = ${ALLLIBS}
    85114
    86 StackClassUnitTest_SOURCES = stackclassunittest.cpp stackclassunittest.hpp
     115StackClassUnitTest_SOURCES = UnitTestMain.cpp stackclassunittest.cpp stackclassunittest.hpp
    87116StackClassUnitTest_LDADD = ${ALLLIBS}
    88117
    89 TesselationUnitTest_SOURCES = tesselationunittest.cpp tesselationunittest.hpp
     118TesselationUnitTest_SOURCES = UnitTestMain.cpp tesselationunittest.cpp tesselationunittest.hpp
    90119TesselationUnitTest_LDADD = ${ALLLIBS}
    91120
    92 Tesselation_BoundaryTriangleUnitTest_SOURCES = tesselation_boundarytriangleunittest.cpp tesselation_boundarytriangleunittest.hpp
     121Tesselation_BoundaryTriangleUnitTest_SOURCES = UnitTestMain.cpp tesselation_boundarytriangleunittest.cpp tesselation_boundarytriangleunittest.hpp
    93122Tesselation_BoundaryTriangleUnitTest_LDADD = ${ALLLIBS}
    94123
    95 Tesselation_InOutsideUnitTest_SOURCES = tesselation_insideoutsideunittest.cpp tesselation_insideoutsideunittest.hpp
     124Tesselation_InOutsideUnitTest_SOURCES = UnitTestMain.cpp tesselation_insideoutsideunittest.cpp tesselation_insideoutsideunittest.hpp
    96125Tesselation_InOutsideUnitTest_LDADD = ${ALLLIBS}
    97126
    98 VectorUnitTest_SOURCES = vectorunittest.cpp vectorunittest.hpp
     127VectorUnitTest_SOURCES = UnitTestMain.cpp vectorunittest.cpp vectorunittest.hpp
    99128VectorUnitTest_LDADD = ${ALLLIBS}
    100129
    101 ActionSequenceTest_SOURCES = ActionSequenceTest.cpp ActionSequenceTest.hpp
     130ActionSequenceTest_SOURCES = UnitTestMain.cpp ../../../TestRunnerClient.hpp ActionSequenceTest.cpp ActionSequenceTest.hpp
    102131ActionSequenceTest_LDADD = ${ALLLIBS}
    103132
    104 ObserverTest_SOURCES = ObserverTest.cpp ObserverTest.hpp
     133ObserverTest_SOURCES = UnitTestMain.cpp ObserverTest.cpp ObserverTest.hpp
    105134ObserverTest_LDADD = ${ALLLIBS}
    106135
    107 CacheableTest_SOURCES = CacheableTest.cpp CacheableTest.hpp
     136CacheableTest_SOURCES = UnitTestMain.cpp CacheableTest.cpp CacheableTest.hpp
    108137CacheableTest_LDADD = ${ALLLIBS}
    109138
    110 DescriptorUnittest_SOURCES = DescriptorUnittest.cpp DescriptorUnittest.hpp
    111 DescriptorUnittest_LDADD = ${ALLLIBS}
     139DescriptorUnittest_SOURCES = UnitTestMain.cpp DescriptorUnittest.cpp DescriptorUnittest.hpp
     140DescriptorUnittest_LDADD = ${ALLLIBS}
     141
     142TestRunner_SOURCES = TestRunnerMain.cpp $(TESTSOURCES) $(TESTHEADERS)
     143TestRunner_LDADD = ${ALLLIBS}
    112144
    113145#AUTOMAKE_OPTIONS = parallel-tests
  • src/unittests/ObserverTest.cpp

    r685100 r9b6b2f  
    1717
    1818using namespace std;
     19
     20#ifdef HAVE_TESTRUNNER
     21#include "UnitTestMain.hpp"
     22#endif /*HAVE_TESTRUNNER*/
    1923
    2024// Registers the fixture into the 'registry'
     
    110114  simpleObservable1->signOn(observer2);
    111115  simpleObservable1->signOn(observer3);
     116
    112117  simpleObservable2->signOn(observer2);
    113118  simpleObservable2->signOn(observer4);
     
    181186  CPPUNIT_ASSERT(true);
    182187}
    183 
    184 /********************************************** Main routine **************************************/
    185 
    186 int main(int argc, char **argv)
    187 {
    188   // Get the top level suite from the registry
    189   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    190 
    191   // Adds the test to the list of test to run
    192   CppUnit::TextUi::TestRunner runner;
    193   runner.addTest( suite );
    194 
    195   // Change the default outputter to a compiler error format outputter
    196   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    197                                                        std::cerr ) );
    198   // Run the tests.
    199   bool wasSucessful = runner.run();
    200 
    201   // Return error code 1 if the one of test failed.
    202   return wasSucessful ? 0 : 1;
    203 };
  • src/unittests/analysisbondsunittest.cpp

    r685100 r9b6b2f  
    2424#include "molecule.hpp"
    2525#include "periodentafel.hpp"
     26
     27#ifdef HAVE_TESTRUNNER
     28#include "UnitTestMain.hpp"
     29#endif /*HAVE_TESTRUNNER*/
    2630
    2731/********************************************** Test classes **************************************/
     
    163167  CPPUNIT_ASSERT_EQUAL( 0. , Max );
    164168};
    165 
    166 
    167 /********************************************** Main routine **************************************/
    168 
    169 int main(int argc, char **argv)
    170 {
    171   // Get the top level suite from the registry
    172   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    173 
    174   // Adds the test to the list of test to run
    175   CppUnit::TextUi::TestRunner runner;
    176   runner.addTest( suite );
    177 
    178   // Change the default outputter to a compiler error format outputter
    179   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    180                                                        std::cerr ) );
    181   // Run the tests.
    182   bool wasSucessful = runner.run();
    183 
    184   // Return error code 1 if the one of test failed.
    185   return wasSucessful ? 0 : 1;
    186 };
  • src/unittests/bondgraphunittest.cpp

    r685100 r9b6b2f  
    2323#include "periodentafel.hpp"
    2424#include "bondgraphunittest.hpp"
     25
     26#ifdef HAVE_TESTRUNNER
     27#include "UnitTestMain.hpp"
     28#endif /*HAVE_TESTRUNNER*/
    2529
    2630/********************************************** Test classes **************************************/
     
    123127  CPPUNIT_ASSERT_EQUAL( true , Walker->IsBondedTo(Runner) );
    124128};
    125 
    126 
    127 /********************************************** Main routine **************************************/
    128 
    129 int main(int argc, char **argv)
    130 {
    131   // Get the top level suite from the registry
    132   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    133 
    134   // Adds the test to the list of test to run
    135   CppUnit::TextUi::TestRunner runner;
    136   runner.addTest( suite );
    137 
    138   // Change the default outputter to a compiler error format outputter
    139   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    140                                                        std::cerr ) );
    141   // Run the tests.
    142   bool wasSucessful = runner.run();
    143 
    144   // Return error code 1 if the one of test failed.
    145   return wasSucessful ? 0 : 1;
    146 };
  • src/unittests/gslmatrixsymmetricunittest.cpp

    r685100 r9b6b2f  
    1313
    1414#include "gslmatrixsymmetricunittest.hpp"
     15
     16#ifdef HAVE_TESTRUNNER
     17#include "UnitTestMain.hpp"
     18#endif /*HAVE_TESTRUNNER*/
    1519
    1620/********************************************** Test classes **************************************/
     
    266270  CPPUNIT_ASSERT_EQUAL( -26.5, m->Determinant() );
    267271};
    268 
    269 /********************************************** Main routine **************************************/
    270 
    271 int main(int argc, char **argv)
    272 {
    273   // Get the top level suite from the registry
    274   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    275 
    276   // Adds the test to the list of test to run
    277   CppUnit::TextUi::TestRunner runner;
    278   runner.addTest( suite );
    279 
    280   // Change the default outputter to a compiler error format outputter
    281   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    282                                                        std::cerr ) );
    283   // Run the tests.
    284   bool wasSucessful = runner.run();
    285 
    286   // Return error code 1 if the one of test failed.
    287   return wasSucessful ? 0 : 1;
    288 };
  • src/unittests/gslmatrixunittest.cpp

    r685100 r9b6b2f  
    1313
    1414#include "gslmatrixunittest.hpp"
     15
     16#ifdef HAVE_TESTRUNNER
     17#include "UnitTestMain.hpp"
     18#endif /*HAVE_TESTRUNNER*/
    1519
    1620/********************************************** Test classes **************************************/
     
    248252  CPPUNIT_ASSERT_EQUAL( false, m->IsPositiveDefinite() );
    249253};
    250 
    251 /********************************************** Main routine **************************************/
    252 
    253 int main(int argc, char **argv)
    254 {
    255   // Get the top level suite from the registry
    256   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    257 
    258   // Adds the test to the list of test to run
    259   CppUnit::TextUi::TestRunner runner;
    260   runner.addTest( suite );
    261 
    262   // Change the default outputter to a compiler error format outputter
    263   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    264                                                        std::cerr ) );
    265   // Run the tests.
    266   bool wasSucessful = runner.run();
    267 
    268   // Return error code 1 if the one of test failed.
    269   return wasSucessful ? 0 : 1;
    270 };
  • src/unittests/gslvectorunittest.cpp

    r685100 r9b6b2f  
    1313
    1414#include "gslvectorunittest.hpp"
     15
     16#ifdef HAVE_TESTRUNNER
     17#include "UnitTestMain.hpp"
     18#endif /*HAVE_TESTRUNNER*/
    1519
    1620/********************************************** Test classes **************************************/
     
    113117    CPPUNIT_ASSERT_EQUAL( (double)(3-j), v->Get(j) );
    114118};
    115 
    116 
    117 /********************************************** Main routine **************************************/
    118 
    119 int main(int argc, char **argv)
    120 {
    121   // Get the top level suite from the registry
    122   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    123 
    124   // Adds the test to the list of test to run
    125   CppUnit::TextUi::TestRunner runner;
    126   runner.addTest( suite );
    127 
    128   // Change the default outputter to a compiler error format outputter
    129   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    130                                                        std::cerr ) );
    131   // Run the tests.
    132   bool wasSucessful = runner.run();
    133 
    134   // Return error code 1 if the one of test failed.
    135   return wasSucessful ? 0 : 1;
    136 };
  • src/unittests/infounittest.cpp

    r685100 r9b6b2f  
    1717#include "info.hpp"
    1818#include "infounittest.hpp"
     19
     20#ifdef HAVE_TESTRUNNER
     21#include "UnitTestMain.hpp"
     22#endif /*HAVE_TESTRUNNER*/
    1923
    2024/********************************************** Test classes **************************************/
     
    4347  CPPUNIT_ASSERT_EQUAL( 1, test.verbosity );
    4448};
    45 
    46 
    47 /********************************************** Main routine **************************************/
    48 
    49 int main(int argc, char **argv)
    50 {
    51   // Get the top level suite from the registry
    52   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    53 
    54   // Adds the test to the list of test to run
    55   CppUnit::TextUi::TestRunner runner;
    56   runner.addTest( suite );
    57 
    58   // Change the default outputter to a compiler error format outputter
    59   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    60                                                        std::cerr ) );
    61   // Run the tests.
    62   bool wasSucessful = runner.run();
    63 
    64   // Return error code 1 if the one of test failed.
    65   return wasSucessful ? 0 : 1;
    66 };
  • src/unittests/linearsystemofequationsunittest.cpp

    r685100 r9b6b2f  
    1515#include "linearsystemofequationsunittest.hpp"
    1616#include "vector.hpp"
     17
     18#ifdef HAVE_TESTRUNNER
     19#include "UnitTestMain.hpp"
     20#endif /*HAVE_TESTRUNNER*/
    1721
    1822/********************************************** Test classes **************************************/
     
    103107  delete[](array);
    104108};
    105 
    106 /********************************************** Main routine **************************************/
    107 
    108 int main(int argc, char **argv)
    109 {
    110   // Get the top level suite from the registry
    111   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    112 
    113   // Adds the test to the list of test to run
    114   CppUnit::TextUi::TestRunner runner;
    115   runner.addTest( suite );
    116 
    117   // Change the default outputter to a compiler error format outputter
    118   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    119                                                        std::cerr ) );
    120   // Run the tests.
    121   bool wasSucessful = runner.run();
    122 
    123   // Return error code 1 if the one of test failed.
    124   return wasSucessful ? 0 : 1;
    125 };
  • src/unittests/listofbondsunittest.cpp

    r685100 r9b6b2f  
    2222#include "periodentafel.hpp"
    2323
     24#ifdef HAVE_TESTRUNNER
     25#include "UnitTestMain.hpp"
     26#endif /*HAVE_TESTRUNNER*/
     27
    2428/********************************************** Test classes **************************************/
    2529
     
    250254  CPPUNIT_ASSERT_EQUAL( TestMolecule->first->next, TestMolecule->last );
    251255};
    252 
    253 /********************************************** Main routine **************************************/
    254 
    255 int main(int argc, char **argv)
    256 {
    257   // Get the top level suite from the registry
    258   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    259 
    260   // Adds the test to the list of test to run
    261   CppUnit::TextUi::TestRunner runner;
    262   runner.addTest( suite );
    263 
    264   // Change the default outputter to a compiler error format outputter
    265   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    266                                                        std::cerr ) );
    267   // Run the tests.
    268   bool wasSucessful = runner.run();
    269 
    270   // Return error code 1 if the one of test failed.
    271   return wasSucessful ? 0 : 1;
    272 };
  • src/unittests/logunittest.cpp

    r685100 r9b6b2f  
    1414#include "defs.hpp"
    1515#include "verbose.hpp"
     16
     17#ifdef HAVE_TESTRUNNER
     18#include "UnitTestMain.hpp"
     19#endif /*HAVE_TESTRUNNER*/
    1620
    1721/********************************************** Test classes **************************************/
     
    4852  eLog() << Verbose(4) << "This should not be printed." << endl;
    4953};
    50 
    51 
    52 /********************************************** Main routine **************************************/
    53 
    54 int main(int argc, char **argv)
    55 {
    56   // Get the top level suite from the registry
    57   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    58 
    59   // Adds the test to the list of test to run
    60   CppUnit::TextUi::TestRunner runner;
    61   runner.addTest( suite );
    62 
    63   // Change the default outputter to a compiler error format outputter
    64   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    65                                                        std::cerr ) );
    66   // Run the tests.
    67   bool wasSucessful = runner.run();
    68 
    69   // Return error code 1 if the one of test failed.
    70   return wasSucessful ? 0 : 1;
    71 };
  • src/unittests/memoryallocatorunittest.cpp

    r685100 r9b6b2f  
    1414#include "helpers.hpp"
    1515#include "defs.hpp"
     16
     17#ifdef HAVE_TESTRUNNER
     18#include "UnitTestMain.hpp"
     19#endif /*HAVE_TESTRUNNER*/
    1620
    1721/********************************************** Test classes **************************************/
     
    102106  Free(buffer2);
    103107};
    104 
    105 
    106 /********************************************** Main routine **************************************/
    107 
    108 int main(int argc, char **argv)
    109 {
    110   // Get the top level suite from the registry
    111   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    112 
    113   // Adds the test to the list of test to run
    114   CppUnit::TextUi::TestRunner runner;
    115   runner.addTest( suite );
    116 
    117   // Change the default outputter to a compiler error format outputter
    118   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    119                                                        std::cerr ) );
    120   // Run the tests.
    121   bool wasSucessful = runner.run();
    122 
    123   // Return error code 1 if the one of test failed.
    124   return wasSucessful ? 0 : 1;
    125 };
  • src/unittests/memoryusageobserverunittest.cpp

    r685100 r9b6b2f  
    1313#include "memoryusageobserver.hpp"
    1414#include "memoryusageobserverunittest.hpp"
     15
     16#ifdef HAVE_TESTRUNNER
     17#include "UnitTestMain.hpp"
     18#endif /*HAVE_TESTRUNNER*/
    1519
    1620/********************************************** Test classes **************************************/
     
    136140  CPPUNIT_ASSERT_EQUAL(i, (int*) MemoryUsageObserver::getInstance()->getPointersToAllocatedMemory().begin()->first);
    137141};
    138 
    139 
    140 /********************************************** Main routine **************************************/
    141 
    142 int main(int argc, char **argv)
    143 {
    144   // Get the top level suite from the registry
    145   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    146 
    147   // Adds the test to the list of test to run
    148   CppUnit::TextUi::TestRunner runner;
    149   runner.addTest( suite );
    150 
    151   // Change the default outputter to a compiler error format outputter
    152   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    153                                                        std::cerr ) );
    154   // Run the tests.
    155   bool wasSucessful = runner.run();
    156 
    157   // Return error code 1 if the one of test failed.
    158   return wasSucessful ? 0 : 1;
    159 };
  • src/unittests/stackclassunittest.cpp

    r685100 r9b6b2f  
    1414#include "stackclassunittest.hpp"
    1515#include "log.hpp"
     16
     17#ifdef HAVE_TESTRUNNER
     18#include "UnitTestMain.hpp"
     19#endif /*HAVE_TESTRUNNER*/
    1620
    1721enum { testdimension=3 };
     
    6771  CPPUNIT_ASSERT_EQUAL(0, Stack->ItemCount());
    6872};
    69 
    70 
    71 /********************************************** Main routine **************************************/
    72 
    73 int main(int argc, char **argv)
    74 {
    75   // Get the top level suite from the registry
    76   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    77 
    78   // Adds the test to the list of test to run
    79   CppUnit::TextUi::TestRunner runner;
    80   runner.addTest( suite );
    81 
    82   // Change the default outputter to a compiler error format outputter
    83   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    84                                                        std::cerr ) );
    85   // Run the tests.
    86   bool wasSucessful = runner.run();
    87 
    88   // Return error code 1 if the one of test failed.
    89   return wasSucessful ? 0 : 1;
    90 };
  • src/unittests/tesselation_boundarytriangleunittest.cpp

    r685100 r9b6b2f  
    1717#include "tesselation.hpp"
    1818#include "tesselation_boundarytriangleunittest.hpp"
     19
     20#ifdef HAVE_TESTRUNNER
     21#include "UnitTestMain.hpp"
     22#endif /*HAVE_TESTRUNNER*/
    1923
    2024#define SPHERERADIUS 2.
     
    191195  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    192196};
    193 
    194 
    195 /********************************************** Main routine **************************************/
    196 
    197 int main(int argc, char **argv)
    198 {
    199   // Get the top level suite from the registry
    200   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    201 
    202   // Adds the test to the list of test to run
    203   CppUnit::TextUi::TestRunner runner;
    204   runner.addTest( suite );
    205 
    206   // Change the default outputter to a compiler error format outputter
    207   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    208                                                        std::cerr ) );
    209   // Run the tests.
    210   bool wasSucessful = runner.run();
    211 
    212   // Return error code 1 if the one of test failed.
    213   return wasSucessful ? 0 : 1;
    214 };
  • src/unittests/tesselation_insideoutsideunittest.cpp

    r685100 r9b6b2f  
    1717#include "tesselation.hpp"
    1818#include "tesselation_insideoutsideunittest.hpp"
     19
     20#ifdef HAVE_TESTRUNNER
     21#include "UnitTestMain.hpp"
     22#endif /*HAVE_TESTRUNNER*/
    1923
    2024#define SPHERERADIUS 2.
     
    161165      }
    162166};
    163 
    164 /********************************************** Main routine **************************************/
    165 
    166 int main(int argc, char **argv)
    167 {
    168   // Get the top level suite from the registry
    169   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    170 
    171   // Adds the test to the list of test to run
    172   CppUnit::TextUi::TestRunner runner;
    173   runner.addTest( suite );
    174 
    175   // Change the default outputter to a compiler error format outputter
    176   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    177                                                        std::cerr ) );
    178   // Run the tests.
    179   bool wasSucessful = runner.run();
    180 
    181   // Return error code 1 if the one of test failed.
    182   return wasSucessful ? 0 : 1;
    183 };
  • src/unittests/tesselationunittest.cpp

    r685100 r9b6b2f  
    1818#include "tesselation.hpp"
    1919#include "tesselationunittest.hpp"
     20
     21#ifdef HAVE_TESTRUNNER
     22#include "UnitTestMain.hpp"
     23#endif /*HAVE_TESTRUNNER*/
    2024
    2125#define SPHERERADIUS 2.
     
    177181  }
    178182}
    179 
    180 /********************************************** Main routine **************************************/
    181 
    182 int main(int argc, char **argv)
    183 {
    184   // Get the top level suite from the registry
    185   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    186 
    187   // Adds the test to the list of test to run
    188   CppUnit::TextUi::TestRunner runner;
    189   runner.addTest( suite );
    190 
    191   // Change the default outputter to a compiler error format outputter
    192   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    193                                                        std::cerr ) );
    194   // Run the tests.
    195   bool wasSucessful = runner.run();
    196 
    197   // Return error code 1 if the one of test failed.
    198   return wasSucessful ? 0 : 1;
    199 };
  • src/unittests/vectorunittest.cpp

    r685100 r9b6b2f  
    1616#include "vector.hpp"
    1717#include "vectorunittest.hpp"
     18
     19#ifdef HAVE_TESTRUNNER
     20#include "UnitTestMain.hpp"
     21#endif /*HAVE_TESTRUNNER*/
    1822
    1923/********************************************** Test classes **************************************/
     
    290294}
    291295
    292 
    293 /********************************************** Main routine **************************************/
    294 
    295 int main(int argc, char **argv)
    296 {
    297   // Get the top level suite from the registry
    298   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
    299 
    300   // Adds the test to the list of test to run
    301   CppUnit::TextUi::TestRunner runner;
    302   runner.addTest( suite );
    303 
    304   // Change the default outputter to a compiler error format outputter
    305   runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
    306                                                        std::cerr ) );
    307   // Run the tests.
    308   bool wasSucessful = runner.run();
    309 
    310   // Return error code 1 if the one of test failed.
    311   return wasSucessful ? 0 : 1;
    312 };
Note: See TracChangeset for help on using the changeset viewer.