no message
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@67 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
34baf93ed8
commit
44d1bc8ebf
21 changed files with 336 additions and 97 deletions
|
@ -18,7 +18,6 @@
|
|||
#include <memory>
|
||||
#include <typeinfo>
|
||||
#include <loki/AbstractFactory.h>
|
||||
#include "UnitTest.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// AbstractFactoryTest
|
||||
|
@ -63,8 +62,8 @@ public:
|
|||
Soldier *s;
|
||||
|
||||
s = easyFactory->Create<Soldier>();
|
||||
|
||||
r=typeid(*s)==typeid(SillySoldier);
|
||||
|
||||
r= !!(typeid(*s)==typeid(SillySoldier)); //SGB !! eliminates bool-to-int performance warning
|
||||
|
||||
delete s;
|
||||
|
||||
|
@ -82,6 +81,6 @@ public:
|
|||
|
||||
std::cout << '\n';
|
||||
}
|
||||
};
|
||||
} abstractFactoryTest;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -187,7 +187,7 @@ void test_vect1()
|
|||
assert(vec11.size() == 0);
|
||||
|
||||
check_insert1(vec11);
|
||||
unsigned size1 = vec11.size();
|
||||
size_t size1 = vec11.size();
|
||||
assert(size1);
|
||||
|
||||
test_vect1_t vec12(vec11.begin(), vec11.end());
|
||||
|
@ -244,7 +244,7 @@ void test_vect2()
|
|||
assert(it->second == 3);
|
||||
|
||||
std::pair<test_vect2_t::iterator, bool> aux = vec21.insert(std::make_pair("xyz", 99));
|
||||
assert(aux.first);
|
||||
assert(aux.first); //TODOSGB was second meant, not first? MSVC7 dies here (more errors follow)
|
||||
it = vec21.find("xyz");
|
||||
assert(it->second == 3);
|
||||
|
||||
|
@ -353,6 +353,6 @@ public:
|
|||
|
||||
std::cout << '\n';
|
||||
}
|
||||
};
|
||||
} assocVectorTest;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -6,14 +6,6 @@
|
|||
|
||||
#include <typeinfo>
|
||||
#include <Loki/DataGenerators.h>
|
||||
#include "UnitTest.h"
|
||||
|
||||
template<typename T>
|
||||
T& remove_const(const T& t)
|
||||
{
|
||||
return const_cast<T&>(t);
|
||||
}
|
||||
|
||||
|
||||
struct DataGeneratorsTest : public Test
|
||||
{
|
||||
|
@ -38,7 +30,7 @@ struct DataGeneratorsTest : public Test
|
|||
names.reserve(n);
|
||||
//Some fascist decided that all temporaries should be const.
|
||||
//The following line of code stupidity is a direct result of the half-baked idea
|
||||
iterate_types<char_types, name_from_type>(remove_const(std::back_inserter(names)));
|
||||
iterate_types<char_types, nameof_type>(std::back_inserter(names));
|
||||
b = names.size() == n;
|
||||
testAssert("iterate_types - Check Length", b, result);
|
||||
|
||||
|
@ -48,7 +40,7 @@ struct DataGeneratorsTest : public Test
|
|||
short,
|
||||
int,
|
||||
double>::Result some_types;
|
||||
iterate_types<some_types, sizeof_type>(remove_const(std::back_inserter(sizes)));
|
||||
iterate_types<some_types, sizeof_type>(std::back_inserter(sizes));
|
||||
size_t apriori_size[] = {sizeof(char), sizeof(short), sizeof(int), sizeof(double)};
|
||||
b = true;
|
||||
for(int i=0; i<n; ++i)
|
||||
|
@ -65,6 +57,6 @@ struct DataGeneratorsTest : public Test
|
|||
b = sizes.size() == 0;
|
||||
testAssert("iterate_types - Degenerate Case 2 - NullType", b, result);
|
||||
}
|
||||
};
|
||||
} datageneratorsTest;
|
||||
|
||||
#endif //DATAGENERATORSTEST_H
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#define FACTORYTEST_H
|
||||
|
||||
#include <loki/Factory.h>
|
||||
#include "UnitTest.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// FactoryTest
|
||||
|
@ -142,6 +141,6 @@ public:
|
|||
|
||||
std::cout << '\n';
|
||||
}
|
||||
};
|
||||
} factoryTest;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#define FUNCTORTEST_H
|
||||
|
||||
#include <loki/Functor.h>
|
||||
#include "UnitTest.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// FunctorTest
|
||||
|
@ -102,8 +101,12 @@ private:
|
|||
result=true;
|
||||
}
|
||||
};
|
||||
};
|
||||
} functorTest;
|
||||
|
||||
bool FunctorTest::testResult;
|
||||
|
||||
#ifndef SMALLOBJ_CPP
|
||||
# define SMALLOBJ_CPP
|
||||
# include "../../SmallObj.cpp"
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
//#include "AbstractFactoryTest.h"
|
||||
//#include "AssocVectorTest.h"
|
||||
//#include "FunctorTest.h"
|
||||
#include "DataGeneratorsTest.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// LokiTest
|
||||
|
@ -56,6 +57,7 @@ private:
|
|||
// tests.add(abstractFactoryTest);
|
||||
// tests.add(assocVectorTest);
|
||||
// tests.add(functorTest);
|
||||
tests.add(datageneratorTest);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -72,6 +74,7 @@ private:
|
|||
// AbstractFactoryTest abstractFactoryTest;
|
||||
// AssocVectorTest assocVectorTest;
|
||||
// FunctorTest functorTest;
|
||||
DataGeneratorsTest datageneratorTest;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
21
tools/RegressionTest/MSVCUnitTest.sln
Normal file
21
tools/RegressionTest/MSVCUnitTest.sln
Normal file
|
@ -0,0 +1,21 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 7.00
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnitTest", "MSVCUnitTest.vcproj", "{79729949-F144-4098-BFE9-B6320E6AC3F6}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
ConfigName.0 = Debug
|
||||
ConfigName.1 = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectDependencies) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{79729949-F144-4098-BFE9-B6320E6AC3F6}.Debug.ActiveCfg = Debug|Win32
|
||||
{79729949-F144-4098-BFE9-B6320E6AC3F6}.Debug.Build.0 = Debug|Win32
|
||||
{79729949-F144-4098-BFE9-B6320E6AC3F6}.Release.ActiveCfg = Release|Win32
|
||||
{79729949-F144-4098-BFE9-B6320E6AC3F6}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
121
tools/RegressionTest/MSVCUnitTest.vcproj
Normal file
121
tools/RegressionTest/MSVCUnitTest.vcproj
Normal file
|
@ -0,0 +1,121 @@
|
|||
<?xml version="1.0" encoding = "Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.00"
|
||||
Name="UnitTest"
|
||||
ProjectGUID="{79729949-F144-4098-BFE9-B6320E6AC3F6}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
BufferSecurityCheck="TRUE"
|
||||
TreatWChar_tAsBuiltInType="TRUE"
|
||||
ForceConformanceInForLoopScope="TRUE"
|
||||
RuntimeTypeInfo="TRUE"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/UnitTest.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/UnitTest.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
OmitFramePointers="TRUE"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/UnitTest.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath="LokiTest.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Test.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\MSVC\1300\TypeTraits.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="UnitTest.h">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -76,7 +76,7 @@ namespace
|
|||
typedef SingletonHolder<MyClass<19>, CreateStatic, SingletonWithLongevity, SingleThreaded> t19;
|
||||
typedef SingletonHolder<MyClass<20>, CreateStatic, NoDestroy, SingleThreaded> t20;
|
||||
|
||||
#if !__INTEL_COMPILER && !__GNUC__
|
||||
#if !__INTEL_COMPILER && !__GNUC__ && !_MSC_VER
|
||||
|
||||
typedef SingletonHolder<MyClass<5>, CreateUsingNew, DefaultLifetime, ClassLevelLockable> t5;
|
||||
typedef SingletonHolder<MyClass<6>, CreateUsingNew, PhoenixSingleton, ClassLevelLockable> t6;
|
||||
|
@ -126,7 +126,7 @@ public:
|
|||
MAKE_TEST(t19)
|
||||
MAKE_TEST(t20)
|
||||
|
||||
#if !__INTEL_COMPILER && !__GNUC__
|
||||
#if !__INTEL_COMPILER && !__GNUC__ && !_MSC_VER
|
||||
|
||||
MAKE_TEST(t5)
|
||||
MAKE_TEST(t6)
|
||||
|
@ -152,6 +152,8 @@ public:
|
|||
|
||||
private:
|
||||
bool singletonTest;
|
||||
};
|
||||
} singletonTest;
|
||||
|
||||
#include "../../Singleton.cpp"
|
||||
|
||||
#endif
|
||||
|
|
|
@ -144,7 +144,7 @@ private:
|
|||
|
||||
for (int j = 0; j < 1024; ++j)
|
||||
{
|
||||
int pos = std::rand() % vec.size();
|
||||
size_t pos = std::rand() % vec.size();
|
||||
|
||||
delete vec[pos];
|
||||
|
||||
|
@ -159,6 +159,10 @@ private:
|
|||
vec.pop_back();
|
||||
}
|
||||
}
|
||||
};
|
||||
} smallObjectTest;
|
||||
|
||||
#ifndef SMALLOBJ_CPP
|
||||
# define SMALLOBJ_CPP
|
||||
# include "../../SmallObj.cpp"
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -285,6 +285,6 @@ private:
|
|||
typedef SmartPtr<TestClass, DestructiveCopy, DisallowConversion, NoCheck, DefaultSPStorage> p101;
|
||||
typedef SmartPtr<TestClass, NoCopy, DisallowConversion, NoCheck, DefaultSPStorage> p102;
|
||||
typedef SmartPtr<TestClass, NoCopy, DisallowConversion, NoCheck, DefaultSPStorage> p103;
|
||||
};
|
||||
} smartPtrTest;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -9,23 +9,86 @@
|
|||
//
|
||||
// This software is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// Last update: September 16, 2002
|
||||
// Last update: October 10, 2002
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __INTEL_COMPILER
|
||||
# pragma warning(disable: 111 193 304 383 444 488 981 1418)
|
||||
#endif
|
||||
|
||||
#include "LokiTest.h"
|
||||
//Some platforms might have difficulty with this
|
||||
//Need to ifdef around those cases.
|
||||
//TODOSGB
|
||||
|
||||
#include "UnitTest.h"
|
||||
|
||||
//static variable defintion, do not remove
|
||||
Test::tests_type Test::tests;
|
||||
|
||||
|
||||
//Merely comment out any of the following headers to
|
||||
// prevent thier execution during the test.
|
||||
//A pluggable-factory-like method is used to
|
||||
// auto-register the test, so all that is needed
|
||||
// is the header inclusion to execute the correspond
|
||||
// unit test.
|
||||
|
||||
#include "TypelistTest.h"
|
||||
#include "TypeManipTest.h"
|
||||
#include "TypeTraitsTest.h"
|
||||
#include "SmallObjectTest.h"
|
||||
#include "SingletonTest.h"
|
||||
#include "SmartPtrTest.h"
|
||||
#include "FactoryTest.h"
|
||||
#include "AbstractFactoryTest.h"
|
||||
#include "AssocVectorTest.h"
|
||||
#include "FunctorTest.h"
|
||||
#include "DataGeneratorsTest.h"
|
||||
|
||||
|
||||
/*
|
||||
* AP - All Pass
|
||||
* FC - Fails to Compile
|
||||
* ? - Unknown/Not Tested/Not Recorded
|
||||
*
|
||||
* TypelistTest TypeManipTest TypeTraitsTest SmallObjectTest SingletonTest
|
||||
* gcc 2.95.3 ? ? ? ? ?
|
||||
* gcc 3.2 AP AP AP AP P #ifdef?
|
||||
* MSVC 6 ? ? ? ? ?
|
||||
* MSVC 7 DerivedToFront Conversion FC AP P #ifdef?
|
||||
* Intel ? ? ? ? ? ?
|
||||
* BCB 5.5? ? ? ? ? ?
|
||||
* CW 6.0 DerivedToFront ? ? ? ?
|
||||
*
|
||||
* SmartPtrTest FactoryTest AbstractFactoryTest AssocVectorTest FunctorTest
|
||||
* gcc 2.95.3 ? ? ? ? ?
|
||||
* gcc 3.2 FC AP AP FC AP
|
||||
* MSVC 6 ? ? ? ? ?
|
||||
* MSVC 7 FC AP AP FC AP
|
||||
* Intel ? ? ? ? ? ?
|
||||
* BCB 5.5? ? ? ? ? ?
|
||||
* CW 6.0 ? ? ? ? ?
|
||||
*
|
||||
* DataGeneratorsTest
|
||||
* gcc 2.95.3 ?
|
||||
* gcc 3.2 AP
|
||||
* MSVC 6 ?
|
||||
* MSVC 7 AP
|
||||
* Intel ? ?
|
||||
* BCB 5.5? ?
|
||||
* CW 6.0 ?
|
||||
|
||||
*/
|
||||
|
||||
int main()
|
||||
{
|
||||
LokiTest test;
|
||||
|
||||
const int result=test.result();
|
||||
int result = Test::run("Loki Unit Test");
|
||||
|
||||
#if __BORLANDC__ || __GNUC__
|
||||
#if __BORLANDC__
|
||||
while(true); // Stop console window from closing if run from IDE.
|
||||
#elif _MSC_VER || __GNUC__
|
||||
system("pause");
|
||||
#endif
|
||||
|
||||
return result;
|
||||
|
|
|
@ -114,6 +114,6 @@ private:
|
|||
struct Base { char c; };
|
||||
struct Derived1 : Base { char c; };
|
||||
struct Derived2 : Derived1 { char c; };
|
||||
};
|
||||
} typeManipTest;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#define TYPETRAITSTEST_H
|
||||
|
||||
#include <Loki/TypeTraits.h>
|
||||
#include "UnitTest.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// TypeTraitsTest
|
||||
|
@ -111,6 +110,6 @@ public:
|
|||
|
||||
std::cout << '\n';
|
||||
}
|
||||
};
|
||||
} typeTraitsTest;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#define TYPELISTTEST_H
|
||||
|
||||
#include <Loki/Typelist.h>
|
||||
#include "UnitTest.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// TypelistTest
|
||||
|
@ -185,6 +184,5 @@ private:
|
|||
struct Base { char c; };
|
||||
struct Derived1 : Base { char c; };
|
||||
struct Derived2 : Derived1 { char c; };
|
||||
};
|
||||
|
||||
} typelistTest;
|
||||
#endif
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// SameType
|
||||
|
@ -28,6 +29,8 @@
|
|||
|
||||
// Rani Sharoni's SameType
|
||||
|
||||
//This is non-standard code, you are not allowed to
|
||||
// specialize a nested template
|
||||
template<class T1,class T2>
|
||||
struct SameType
|
||||
{
|
||||
|
@ -49,13 +52,13 @@ public:
|
|||
template<class T1,class T2>
|
||||
struct SameType
|
||||
{
|
||||
static const bool value=false;
|
||||
static const bool value=false;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct SameType<T,T>
|
||||
{
|
||||
static const bool value=true;
|
||||
static const bool value=true;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -75,17 +78,24 @@ public:
|
|||
int notSupported;
|
||||
};
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Test
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class Test
|
||||
{
|
||||
typedef std::vector<Test*> tests_type;
|
||||
static tests_type tests;
|
||||
|
||||
public:
|
||||
explicit Test(const std::string &n) : name(n) {}
|
||||
explicit Test(const std::string &n) : name(n)
|
||||
{
|
||||
Test::tests.push_back(this);
|
||||
}
|
||||
|
||||
virtual void execute(TestResult &) =0;
|
||||
|
||||
|
||||
protected:
|
||||
~Test() {}
|
||||
|
||||
|
@ -135,59 +145,23 @@ public:
|
|||
|
||||
protected:
|
||||
const std::string name;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// TestSuite
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class TestSuite : public Test
|
||||
{
|
||||
private:
|
||||
typedef std::vector<Test *> TestList;
|
||||
|
||||
|
||||
public:
|
||||
explicit TestSuite(const std::string &name =emptyStr()) : Test(name) {}
|
||||
|
||||
void add(Test &test)
|
||||
{
|
||||
tests.push_back(&test);
|
||||
}
|
||||
|
||||
virtual void execute(TestResult &result)
|
||||
{
|
||||
printName(result);
|
||||
|
||||
if(name.length()!=0)
|
||||
result.pos+=2;
|
||||
|
||||
for(TestList::iterator i=tests.begin();i!=tests.end();++i)
|
||||
(*i)->execute(result);
|
||||
|
||||
if(name.length()!=0)
|
||||
result.pos-=2;
|
||||
}
|
||||
|
||||
private:
|
||||
TestList tests;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// UnitTest
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class UnitTest
|
||||
{
|
||||
public:
|
||||
int run(const std::string &title,TestSuite &tests) const
|
||||
static int run(const std::string &title)
|
||||
{
|
||||
std::cout << title << std::string(Test::offset-title.length(),' ') << "Result\n";
|
||||
std::cout << std::string(76,'-') << '\n';
|
||||
|
||||
|
||||
TestResult testResult;
|
||||
|
||||
tests.execute(testResult);
|
||||
|
||||
|
||||
tests_type::iterator it;
|
||||
tests_type::const_iterator itEnd = Test::tests.end();
|
||||
for(it=Test::tests.begin(); it!=itEnd; ++it)
|
||||
{
|
||||
Test* test = *it;
|
||||
test->execute(testResult);
|
||||
}
|
||||
|
||||
std::cout << std::string(76,'-') << '\n';
|
||||
|
||||
const int total=testResult.passed+testResult.failed;
|
||||
|
@ -203,6 +177,8 @@ public:
|
|||
|
||||
return testResult.failed;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue