mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-24 17:30:44 +02:00
set eol-style to native
This commit is contained in:
@@ -1,30 +1,30 @@
|
|||||||
Microsoft Visual Studio Solution File, Format Version 8.00
|
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CppUnit", "CppUnit_VS71.vcproj", "{138BB448-808A-4FE5-A66D-78D1F8770F59}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CppUnit", "CppUnit_VS71.vcproj", "{138BB448-808A-4FE5-A66D-78D1F8770F59}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinTestRunner", "WinTestRunner\WinTestRunner_VS71.vcproj", "{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinTestRunner", "WinTestRunner\WinTestRunner_VS71.vcproj", "{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
{138BB448-808A-4FE5-A66D-78D1F8770F59} = {138BB448-808A-4FE5-A66D-78D1F8770F59}
|
{138BB448-808A-4FE5-A66D-78D1F8770F59} = {138BB448-808A-4FE5-A66D-78D1F8770F59}
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfiguration) = preSolution
|
GlobalSection(SolutionConfiguration) = preSolution
|
||||||
debug_shared = debug_shared
|
debug_shared = debug_shared
|
||||||
release_shared = release_shared
|
release_shared = release_shared
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfiguration) = postSolution
|
GlobalSection(ProjectConfiguration) = postSolution
|
||||||
{138BB448-808A-4FE5-A66D-78D1F8770F59}.debug_shared.ActiveCfg = debug_shared|Win32
|
{138BB448-808A-4FE5-A66D-78D1F8770F59}.debug_shared.ActiveCfg = debug_shared|Win32
|
||||||
{138BB448-808A-4FE5-A66D-78D1F8770F59}.debug_shared.Build.0 = debug_shared|Win32
|
{138BB448-808A-4FE5-A66D-78D1F8770F59}.debug_shared.Build.0 = debug_shared|Win32
|
||||||
{138BB448-808A-4FE5-A66D-78D1F8770F59}.release_shared.ActiveCfg = release_shared|Win32
|
{138BB448-808A-4FE5-A66D-78D1F8770F59}.release_shared.ActiveCfg = release_shared|Win32
|
||||||
{138BB448-808A-4FE5-A66D-78D1F8770F59}.release_shared.Build.0 = release_shared|Win32
|
{138BB448-808A-4FE5-A66D-78D1F8770F59}.release_shared.Build.0 = release_shared|Win32
|
||||||
{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.debug_shared.ActiveCfg = debug_shared|Win32
|
{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.debug_shared.ActiveCfg = debug_shared|Win32
|
||||||
{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.debug_shared.Build.0 = debug_shared|Win32
|
{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.debug_shared.Build.0 = debug_shared|Win32
|
||||||
{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.release_shared.ActiveCfg = release_shared|Win32
|
{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.release_shared.ActiveCfg = release_shared|Win32
|
||||||
{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.release_shared.Build.0 = release_shared|Win32
|
{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.release_shared.Build.0 = release_shared|Win32
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|||||||
@@ -1,259 +1,259 @@
|
|||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="7.10"
|
Version="7.10"
|
||||||
Name="CppUnit"
|
Name="CppUnit"
|
||||||
ProjectGUID="{138BB448-808A-4FE5-A66D-78D1F8770F59}"
|
ProjectGUID="{138BB448-808A-4FE5-A66D-78D1F8770F59}"
|
||||||
SccProjectName="CppUnit"
|
SccProjectName="CppUnit"
|
||||||
SccLocalPath="."
|
SccLocalPath="."
|
||||||
Keyword="MFCProj">
|
Keyword="MFCProj">
|
||||||
<Platforms>
|
<Platforms>
|
||||||
<Platform
|
<Platform
|
||||||
Name="Win32"/>
|
Name="Win32"/>
|
||||||
</Platforms>
|
</Platforms>
|
||||||
<Configurations>
|
<Configurations>
|
||||||
<Configuration
|
<Configuration
|
||||||
Name="debug_shared|Win32"
|
Name="debug_shared|Win32"
|
||||||
OutputDirectory=".\obj\debug_shared"
|
OutputDirectory=".\obj\debug_shared"
|
||||||
IntermediateDirectory=".\obj\debug_shared"
|
IntermediateDirectory=".\obj\debug_shared"
|
||||||
ConfigurationType="2"
|
ConfigurationType="2"
|
||||||
UseOfMFC="2"
|
UseOfMFC="2"
|
||||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||||
CharacterSet="2">
|
CharacterSet="2">
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
InlineFunctionExpansion="0"
|
InlineFunctionExpansion="0"
|
||||||
EnableIntrinsicFunctions="FALSE"
|
EnableIntrinsicFunctions="FALSE"
|
||||||
AdditionalIncludeDirectories="include"
|
AdditionalIncludeDirectories="include"
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;POCO_DLL;CppUnit_EXPORTS"
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;POCO_DLL;CppUnit_EXPORTS"
|
||||||
StringPooling="TRUE"
|
StringPooling="TRUE"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="3"
|
RuntimeLibrary="3"
|
||||||
BufferSecurityCheck="TRUE"
|
BufferSecurityCheck="TRUE"
|
||||||
TreatWChar_tAsBuiltInType="TRUE"
|
TreatWChar_tAsBuiltInType="TRUE"
|
||||||
ForceConformanceInForLoopScope="TRUE"
|
ForceConformanceInForLoopScope="TRUE"
|
||||||
RuntimeTypeInfo="TRUE"
|
RuntimeTypeInfo="TRUE"
|
||||||
PrecompiledHeaderFile=""
|
PrecompiledHeaderFile=""
|
||||||
AssemblerListingLocation=""
|
AssemblerListingLocation=""
|
||||||
ObjectFile="$(IntDir)/"
|
ObjectFile="$(IntDir)/"
|
||||||
ProgramDataBaseFileName="$(IntDir)/vc70.pdb"
|
ProgramDataBaseFileName="$(IntDir)/vc70.pdb"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
Detect64BitPortabilityProblems="TRUE"
|
Detect64BitPortabilityProblems="TRUE"
|
||||||
DebugInformationFormat="4"
|
DebugInformationFormat="4"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
ShowIncludes="FALSE"/>
|
ShowIncludes="FALSE"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCustomBuildTool"/>
|
Name="VCCustomBuildTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
ShowProgress="0"
|
ShowProgress="0"
|
||||||
OutputFile="..\bin\CppUnitd.dll"
|
OutputFile="..\bin\CppUnitd.dll"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
AdditionalLibraryDirectories=""
|
AdditionalLibraryDirectories=""
|
||||||
GenerateDebugInformation="TRUE"
|
GenerateDebugInformation="TRUE"
|
||||||
ProgramDatabaseFile="..\bin\CppUnitd.pdb"
|
ProgramDatabaseFile="..\bin\CppUnitd.pdb"
|
||||||
ImportLibrary="..\lib\CppUnitd.lib"
|
ImportLibrary="..\lib\CppUnitd.lib"
|
||||||
TargetMachine="1"/>
|
TargetMachine="1"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCMIDLTool"
|
Name="VCMIDLTool"
|
||||||
PreprocessorDefinitions="_DEBUG"
|
PreprocessorDefinitions="_DEBUG"
|
||||||
MkTypLibCompatible="TRUE"
|
MkTypLibCompatible="TRUE"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
TargetEnvironment="1"
|
TargetEnvironment="1"
|
||||||
TypeLibraryName=".\lib/CppUnit.tlb"
|
TypeLibraryName=".\lib/CppUnit.tlb"
|
||||||
HeaderFileName=""/>
|
HeaderFileName=""/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPostBuildEventTool"/>
|
Name="VCPostBuildEventTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreBuildEventTool"/>
|
Name="VCPreBuildEventTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreLinkEventTool"/>
|
Name="VCPreLinkEventTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCResourceCompilerTool"
|
Name="VCResourceCompilerTool"
|
||||||
PreprocessorDefinitions="_DEBUG"
|
PreprocessorDefinitions="_DEBUG"
|
||||||
Culture="3079"/>
|
Culture="3079"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCWebServiceProxyGeneratorTool"/>
|
Name="VCWebServiceProxyGeneratorTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCXMLDataGeneratorTool"/>
|
Name="VCXMLDataGeneratorTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCWebDeploymentTool"/>
|
Name="VCWebDeploymentTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedWrapperGeneratorTool"/>
|
Name="VCManagedWrapperGeneratorTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
<Configuration
|
<Configuration
|
||||||
Name="release_shared|Win32"
|
Name="release_shared|Win32"
|
||||||
OutputDirectory=".\obj\release_shared"
|
OutputDirectory=".\obj\release_shared"
|
||||||
IntermediateDirectory=".\obj\release_shared"
|
IntermediateDirectory=".\obj\release_shared"
|
||||||
ConfigurationType="2"
|
ConfigurationType="2"
|
||||||
UseOfMFC="0"
|
UseOfMFC="0"
|
||||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||||
CharacterSet="2">
|
CharacterSet="2">
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="4"
|
Optimization="4"
|
||||||
InlineFunctionExpansion="1"
|
InlineFunctionExpansion="1"
|
||||||
EnableIntrinsicFunctions="TRUE"
|
EnableIntrinsicFunctions="TRUE"
|
||||||
FavorSizeOrSpeed="1"
|
FavorSizeOrSpeed="1"
|
||||||
OmitFramePointers="TRUE"
|
OmitFramePointers="TRUE"
|
||||||
AdditionalIncludeDirectories="include"
|
AdditionalIncludeDirectories="include"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_AFXDLL;POCO_DLL;CppUnit_EXPORTS"
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_AFXDLL;POCO_DLL;CppUnit_EXPORTS"
|
||||||
StringPooling="TRUE"
|
StringPooling="TRUE"
|
||||||
RuntimeLibrary="2"
|
RuntimeLibrary="2"
|
||||||
BufferSecurityCheck="FALSE"
|
BufferSecurityCheck="FALSE"
|
||||||
TreatWChar_tAsBuiltInType="TRUE"
|
TreatWChar_tAsBuiltInType="TRUE"
|
||||||
ForceConformanceInForLoopScope="TRUE"
|
ForceConformanceInForLoopScope="TRUE"
|
||||||
RuntimeTypeInfo="TRUE"
|
RuntimeTypeInfo="TRUE"
|
||||||
PrecompiledHeaderFile=""
|
PrecompiledHeaderFile=""
|
||||||
AssemblerListingLocation=""
|
AssemblerListingLocation=""
|
||||||
ObjectFile="$(IntDir)/"
|
ObjectFile="$(IntDir)/"
|
||||||
ProgramDataBaseFileName="$(IntDir)/vc70.pdb"
|
ProgramDataBaseFileName="$(IntDir)/vc70.pdb"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
Detect64BitPortabilityProblems="TRUE"
|
Detect64BitPortabilityProblems="TRUE"
|
||||||
CompileAs="0"/>
|
CompileAs="0"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCustomBuildTool"/>
|
Name="VCCustomBuildTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
OutputFile="..\bin\CppUnit.dll"
|
OutputFile="..\bin\CppUnit.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
AdditionalLibraryDirectories=""
|
AdditionalLibraryDirectories=""
|
||||||
ProgramDatabaseFile=""
|
ProgramDatabaseFile=""
|
||||||
ImportLibrary="..\lib\CppUnit.lib"
|
ImportLibrary="..\lib\CppUnit.lib"
|
||||||
TargetMachine="1"/>
|
TargetMachine="1"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCMIDLTool"
|
Name="VCMIDLTool"
|
||||||
PreprocessorDefinitions="NDEBUG"
|
PreprocessorDefinitions="NDEBUG"
|
||||||
MkTypLibCompatible="TRUE"
|
MkTypLibCompatible="TRUE"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
TargetEnvironment="1"
|
TargetEnvironment="1"
|
||||||
TypeLibraryName=".\lib/CppUnit.tlb"
|
TypeLibraryName=".\lib/CppUnit.tlb"
|
||||||
HeaderFileName=""/>
|
HeaderFileName=""/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPostBuildEventTool"/>
|
Name="VCPostBuildEventTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreBuildEventTool"/>
|
Name="VCPreBuildEventTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreLinkEventTool"/>
|
Name="VCPreLinkEventTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCResourceCompilerTool"
|
Name="VCResourceCompilerTool"
|
||||||
PreprocessorDefinitions="NDEBUG"
|
PreprocessorDefinitions="NDEBUG"
|
||||||
Culture="3079"/>
|
Culture="3079"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCWebServiceProxyGeneratorTool"/>
|
Name="VCWebServiceProxyGeneratorTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCXMLDataGeneratorTool"/>
|
Name="VCXMLDataGeneratorTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCWebDeploymentTool"/>
|
Name="VCWebDeploymentTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedWrapperGeneratorTool"/>
|
Name="VCManagedWrapperGeneratorTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
</Configurations>
|
</Configurations>
|
||||||
<References>
|
<References>
|
||||||
</References>
|
</References>
|
||||||
<Files>
|
<Files>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Source Files"
|
Name="Source Files"
|
||||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\CppUnitException.cpp">
|
RelativePath=".\src\CppUnitException.cpp">
|
||||||
<FileConfiguration
|
<FileConfiguration
|
||||||
Name="debug_shared|Win32">
|
Name="debug_shared|Win32">
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
|
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
<FileConfiguration
|
<FileConfiguration
|
||||||
Name="release_shared|Win32">
|
Name="release_shared|Win32">
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
|
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="src\TestCase.cpp">
|
RelativePath="src\TestCase.cpp">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="src\TestDecorator.cpp">
|
RelativePath="src\TestDecorator.cpp">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="src\TestFailure.cpp">
|
RelativePath="src\TestFailure.cpp">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="src\TestResult.cpp">
|
RelativePath="src\TestResult.cpp">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\TestRunner.cpp">
|
RelativePath=".\src\TestRunner.cpp">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="src\TestSuite.cpp">
|
RelativePath="src\TestSuite.cpp">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="src\TextTestResult.cpp">
|
RelativePath="src\TextTestResult.cpp">
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Include Files"
|
Name="Include Files"
|
||||||
Filter="*.h">
|
Filter="*.h">
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\CppUnit.h">
|
RelativePath=".\include\CppUnit\CppUnit.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\CppUnitException.h">
|
RelativePath=".\include\CppUnit\CppUnitException.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\estring.h">
|
RelativePath=".\include\CppUnit\estring.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\Guards.h">
|
RelativePath=".\include\CppUnit\Guards.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\Orthodox.h">
|
RelativePath=".\include\CppUnit\Orthodox.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\RepeatedTest.h">
|
RelativePath=".\include\CppUnit\RepeatedTest.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\Test.h">
|
RelativePath=".\include\CppUnit\Test.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\TestCaller.h">
|
RelativePath=".\include\CppUnit\TestCaller.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\TestCase.h">
|
RelativePath=".\include\CppUnit\TestCase.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\TestDecorator.h">
|
RelativePath=".\include\CppUnit\TestDecorator.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\TestFailure.h">
|
RelativePath=".\include\CppUnit\TestFailure.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\TestResult.h">
|
RelativePath=".\include\CppUnit\TestResult.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\TestRunner.h">
|
RelativePath=".\include\CppUnit\TestRunner.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\TestSetup.h">
|
RelativePath=".\include\CppUnit\TestSetup.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\TestSuite.h">
|
RelativePath=".\include\CppUnit\TestSuite.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\TextTestResult.h">
|
RelativePath=".\include\CppUnit\TextTestResult.h">
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
</Files>
|
</Files>
|
||||||
<Globals>
|
<Globals>
|
||||||
</Globals>
|
</Globals>
|
||||||
</VisualStudioProject>
|
</VisualStudioProject>
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||||
# Visual Studio 2005
|
# Visual Studio 2005
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CppUnit", "CppUnit_vs80.vcproj", "{138BB448-808A-4FE5-A66D-78D1F8770F59}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CppUnit", "CppUnit_vs80.vcproj", "{138BB448-808A-4FE5-A66D-78D1F8770F59}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinTestRunner", "WinTestRunner\WinTestRunner_vs80.vcproj", "{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinTestRunner", "WinTestRunner\WinTestRunner_vs80.vcproj", "{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
{138BB448-808A-4FE5-A66D-78D1F8770F59} = {138BB448-808A-4FE5-A66D-78D1F8770F59}
|
{138BB448-808A-4FE5-A66D-78D1F8770F59} = {138BB448-808A-4FE5-A66D-78D1F8770F59}
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
debug_shared|Win32 = debug_shared|Win32
|
debug_shared|Win32 = debug_shared|Win32
|
||||||
release_shared|Win32 = release_shared|Win32
|
release_shared|Win32 = release_shared|Win32
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{138BB448-808A-4FE5-A66D-78D1F8770F59}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
|
{138BB448-808A-4FE5-A66D-78D1F8770F59}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
|
||||||
{138BB448-808A-4FE5-A66D-78D1F8770F59}.debug_shared|Win32.Build.0 = debug_shared|Win32
|
{138BB448-808A-4FE5-A66D-78D1F8770F59}.debug_shared|Win32.Build.0 = debug_shared|Win32
|
||||||
{138BB448-808A-4FE5-A66D-78D1F8770F59}.release_shared|Win32.ActiveCfg = release_shared|Win32
|
{138BB448-808A-4FE5-A66D-78D1F8770F59}.release_shared|Win32.ActiveCfg = release_shared|Win32
|
||||||
{138BB448-808A-4FE5-A66D-78D1F8770F59}.release_shared|Win32.Build.0 = release_shared|Win32
|
{138BB448-808A-4FE5-A66D-78D1F8770F59}.release_shared|Win32.Build.0 = release_shared|Win32
|
||||||
{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
|
{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
|
||||||
{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.debug_shared|Win32.Build.0 = debug_shared|Win32
|
{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.debug_shared|Win32.Build.0 = debug_shared|Win32
|
||||||
{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.release_shared|Win32.ActiveCfg = release_shared|Win32
|
{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.release_shared|Win32.ActiveCfg = release_shared|Win32
|
||||||
{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.release_shared|Win32.Build.0 = release_shared|Win32
|
{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.release_shared|Win32.Build.0 = release_shared|Win32
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|||||||
@@ -1,351 +1,351 @@
|
|||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="8.00"
|
Version="8.00"
|
||||||
Name="CppUnit"
|
Name="CppUnit"
|
||||||
ProjectGUID="{138BB448-808A-4FE5-A66D-78D1F8770F59}"
|
ProjectGUID="{138BB448-808A-4FE5-A66D-78D1F8770F59}"
|
||||||
Keyword="MFCProj"
|
Keyword="MFCProj"
|
||||||
>
|
>
|
||||||
<Platforms>
|
<Platforms>
|
||||||
<Platform
|
<Platform
|
||||||
Name="Win32"
|
Name="Win32"
|
||||||
/>
|
/>
|
||||||
</Platforms>
|
</Platforms>
|
||||||
<ToolFiles>
|
<ToolFiles>
|
||||||
</ToolFiles>
|
</ToolFiles>
|
||||||
<Configurations>
|
<Configurations>
|
||||||
<Configuration
|
<Configuration
|
||||||
Name="debug_shared|Win32"
|
Name="debug_shared|Win32"
|
||||||
OutputDirectory=".\obj\debug_shared"
|
OutputDirectory=".\obj\debug_shared"
|
||||||
IntermediateDirectory=".\obj\debug_shared"
|
IntermediateDirectory=".\obj\debug_shared"
|
||||||
ConfigurationType="2"
|
ConfigurationType="2"
|
||||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||||
UseOfMFC="2"
|
UseOfMFC="2"
|
||||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||||
CharacterSet="2"
|
CharacterSet="2"
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreBuildEventTool"
|
Name="VCPreBuildEventTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCustomBuildTool"
|
Name="VCCustomBuildTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCXMLDataGeneratorTool"
|
Name="VCXMLDataGeneratorTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCWebServiceProxyGeneratorTool"
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCMIDLTool"
|
Name="VCMIDLTool"
|
||||||
PreprocessorDefinitions="_DEBUG"
|
PreprocessorDefinitions="_DEBUG"
|
||||||
MkTypLibCompatible="true"
|
MkTypLibCompatible="true"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
TargetEnvironment="1"
|
TargetEnvironment="1"
|
||||||
TypeLibraryName=".\lib/CppUnit.tlb"
|
TypeLibraryName=".\lib/CppUnit.tlb"
|
||||||
HeaderFileName=""
|
HeaderFileName=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
InlineFunctionExpansion="0"
|
InlineFunctionExpansion="0"
|
||||||
EnableIntrinsicFunctions="false"
|
EnableIntrinsicFunctions="false"
|
||||||
AdditionalIncludeDirectories="include"
|
AdditionalIncludeDirectories="include"
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;CppUnit_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;CppUnit_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="3"
|
RuntimeLibrary="3"
|
||||||
BufferSecurityCheck="true"
|
BufferSecurityCheck="true"
|
||||||
TreatWChar_tAsBuiltInType="true"
|
TreatWChar_tAsBuiltInType="true"
|
||||||
ForceConformanceInForLoopScope="true"
|
ForceConformanceInForLoopScope="true"
|
||||||
RuntimeTypeInfo="true"
|
RuntimeTypeInfo="true"
|
||||||
PrecompiledHeaderFile=""
|
PrecompiledHeaderFile=""
|
||||||
AssemblerListingLocation=""
|
AssemblerListingLocation=""
|
||||||
ObjectFile="$(IntDir)/"
|
ObjectFile="$(IntDir)/"
|
||||||
ProgramDataBaseFileName="$(IntDir)/vc80.pdb"
|
ProgramDataBaseFileName="$(IntDir)/vc80.pdb"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
Detect64BitPortabilityProblems="true"
|
Detect64BitPortabilityProblems="true"
|
||||||
DebugInformationFormat="4"
|
DebugInformationFormat="4"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
ShowIncludes="false"
|
ShowIncludes="false"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCResourceCompilerTool"
|
Name="VCResourceCompilerTool"
|
||||||
PreprocessorDefinitions="_DEBUG"
|
PreprocessorDefinitions="_DEBUG"
|
||||||
Culture="3079"
|
Culture="3079"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreLinkEventTool"
|
Name="VCPreLinkEventTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
ShowProgress="0"
|
ShowProgress="0"
|
||||||
OutputFile="..\bin\CppUnitd.dll"
|
OutputFile="..\bin\CppUnitd.dll"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
AdditionalLibraryDirectories=""
|
AdditionalLibraryDirectories=""
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
ProgramDatabaseFile="..\bin\CppUnitd.pdb"
|
ProgramDatabaseFile="..\bin\CppUnitd.pdb"
|
||||||
ImportLibrary="..\lib\CppUnitd.lib"
|
ImportLibrary="..\lib\CppUnitd.lib"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCALinkTool"
|
Name="VCALinkTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManifestTool"
|
Name="VCManifestTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCXDCMakeTool"
|
Name="VCXDCMakeTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCBscMakeTool"
|
Name="VCBscMakeTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCFxCopTool"
|
Name="VCFxCopTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCAppVerifierTool"
|
Name="VCAppVerifierTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCWebDeploymentTool"
|
Name="VCWebDeploymentTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPostBuildEventTool"
|
Name="VCPostBuildEventTool"
|
||||||
/>
|
/>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
<Configuration
|
<Configuration
|
||||||
Name="release_shared|Win32"
|
Name="release_shared|Win32"
|
||||||
OutputDirectory=".\obj\release_shared"
|
OutputDirectory=".\obj\release_shared"
|
||||||
IntermediateDirectory=".\obj\release_shared"
|
IntermediateDirectory=".\obj\release_shared"
|
||||||
ConfigurationType="2"
|
ConfigurationType="2"
|
||||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||||
UseOfMFC="0"
|
UseOfMFC="0"
|
||||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||||
CharacterSet="2"
|
CharacterSet="2"
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreBuildEventTool"
|
Name="VCPreBuildEventTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCustomBuildTool"
|
Name="VCCustomBuildTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCXMLDataGeneratorTool"
|
Name="VCXMLDataGeneratorTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCWebServiceProxyGeneratorTool"
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCMIDLTool"
|
Name="VCMIDLTool"
|
||||||
PreprocessorDefinitions="NDEBUG"
|
PreprocessorDefinitions="NDEBUG"
|
||||||
MkTypLibCompatible="true"
|
MkTypLibCompatible="true"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
TargetEnvironment="1"
|
TargetEnvironment="1"
|
||||||
TypeLibraryName=".\lib/CppUnit.tlb"
|
TypeLibraryName=".\lib/CppUnit.tlb"
|
||||||
HeaderFileName=""
|
HeaderFileName=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="4"
|
Optimization="4"
|
||||||
InlineFunctionExpansion="1"
|
InlineFunctionExpansion="1"
|
||||||
EnableIntrinsicFunctions="true"
|
EnableIntrinsicFunctions="true"
|
||||||
FavorSizeOrSpeed="1"
|
FavorSizeOrSpeed="1"
|
||||||
OmitFramePointers="true"
|
OmitFramePointers="true"
|
||||||
AdditionalIncludeDirectories="include"
|
AdditionalIncludeDirectories="include"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_AFXDLL;POCO_DLL;CppUnit_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_AFXDLL;POCO_DLL;CppUnit_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
RuntimeLibrary="2"
|
RuntimeLibrary="2"
|
||||||
BufferSecurityCheck="false"
|
BufferSecurityCheck="false"
|
||||||
TreatWChar_tAsBuiltInType="true"
|
TreatWChar_tAsBuiltInType="true"
|
||||||
ForceConformanceInForLoopScope="true"
|
ForceConformanceInForLoopScope="true"
|
||||||
RuntimeTypeInfo="true"
|
RuntimeTypeInfo="true"
|
||||||
PrecompiledHeaderFile=""
|
PrecompiledHeaderFile=""
|
||||||
AssemblerListingLocation=""
|
AssemblerListingLocation=""
|
||||||
ObjectFile="$(IntDir)/"
|
ObjectFile="$(IntDir)/"
|
||||||
ProgramDataBaseFileName="$(IntDir)/vc70.pdb"
|
ProgramDataBaseFileName="$(IntDir)/vc70.pdb"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
Detect64BitPortabilityProblems="true"
|
Detect64BitPortabilityProblems="true"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCResourceCompilerTool"
|
Name="VCResourceCompilerTool"
|
||||||
PreprocessorDefinitions="NDEBUG"
|
PreprocessorDefinitions="NDEBUG"
|
||||||
Culture="3079"
|
Culture="3079"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreLinkEventTool"
|
Name="VCPreLinkEventTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
OutputFile="..\bin\CppUnit.dll"
|
OutputFile="..\bin\CppUnit.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
AdditionalLibraryDirectories=""
|
AdditionalLibraryDirectories=""
|
||||||
ProgramDatabaseFile=""
|
ProgramDatabaseFile=""
|
||||||
ImportLibrary="..\lib\CppUnit.lib"
|
ImportLibrary="..\lib\CppUnit.lib"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCALinkTool"
|
Name="VCALinkTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManifestTool"
|
Name="VCManifestTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCXDCMakeTool"
|
Name="VCXDCMakeTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCBscMakeTool"
|
Name="VCBscMakeTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCFxCopTool"
|
Name="VCFxCopTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCAppVerifierTool"
|
Name="VCAppVerifierTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCWebDeploymentTool"
|
Name="VCWebDeploymentTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPostBuildEventTool"
|
Name="VCPostBuildEventTool"
|
||||||
/>
|
/>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
</Configurations>
|
</Configurations>
|
||||||
<References>
|
<References>
|
||||||
</References>
|
</References>
|
||||||
<Files>
|
<Files>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Source Files"
|
Name="Source Files"
|
||||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||||
>
|
>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\CppUnitException.cpp"
|
RelativePath=".\src\CppUnitException.cpp"
|
||||||
>
|
>
|
||||||
<FileConfiguration
|
<FileConfiguration
|
||||||
Name="debug_shared|Win32"
|
Name="debug_shared|Win32"
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
ObjectFile="$(IntDir)/$(InputName)1.obj"
|
ObjectFile="$(IntDir)/$(InputName)1.obj"
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
<FileConfiguration
|
<FileConfiguration
|
||||||
Name="release_shared|Win32"
|
Name="release_shared|Win32"
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
ObjectFile="$(IntDir)/$(InputName)1.obj"
|
ObjectFile="$(IntDir)/$(InputName)1.obj"
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="src\TestCase.cpp"
|
RelativePath="src\TestCase.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="src\TestDecorator.cpp"
|
RelativePath="src\TestDecorator.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="src\TestFailure.cpp"
|
RelativePath="src\TestFailure.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="src\TestResult.cpp"
|
RelativePath="src\TestResult.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\TestRunner.cpp"
|
RelativePath=".\src\TestRunner.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="src\TestSuite.cpp"
|
RelativePath="src\TestSuite.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="src\TextTestResult.cpp"
|
RelativePath="src\TextTestResult.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Include Files"
|
Name="Include Files"
|
||||||
Filter="*.h"
|
Filter="*.h"
|
||||||
>
|
>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\CppUnit.h"
|
RelativePath=".\include\CppUnit\CppUnit.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\CppUnitException.h"
|
RelativePath=".\include\CppUnit\CppUnitException.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\estring.h"
|
RelativePath=".\include\CppUnit\estring.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\Guards.h"
|
RelativePath=".\include\CppUnit\Guards.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\Orthodox.h"
|
RelativePath=".\include\CppUnit\Orthodox.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\RepeatedTest.h"
|
RelativePath=".\include\CppUnit\RepeatedTest.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\Test.h"
|
RelativePath=".\include\CppUnit\Test.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\TestCaller.h"
|
RelativePath=".\include\CppUnit\TestCaller.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\TestCase.h"
|
RelativePath=".\include\CppUnit\TestCase.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\TestDecorator.h"
|
RelativePath=".\include\CppUnit\TestDecorator.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\TestFailure.h"
|
RelativePath=".\include\CppUnit\TestFailure.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\TestResult.h"
|
RelativePath=".\include\CppUnit\TestResult.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\TestRunner.h"
|
RelativePath=".\include\CppUnit\TestRunner.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\TestSetup.h"
|
RelativePath=".\include\CppUnit\TestSetup.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\TestSuite.h"
|
RelativePath=".\include\CppUnit\TestSuite.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\CppUnit\TextTestResult.h"
|
RelativePath=".\include\CppUnit\TextTestResult.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
</Files>
|
</Files>
|
||||||
<Globals>
|
<Globals>
|
||||||
</Globals>
|
</Globals>
|
||||||
</VisualStudioProject>
|
</VisualStudioProject>
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
#
|
#
|
||||||
# Makefile
|
# Makefile
|
||||||
#
|
#
|
||||||
# $Id: //poco/1.2/CppUnit/Makefile#1 $
|
# $Id: //poco/1.2/CppUnit/Makefile#1 $
|
||||||
#
|
#
|
||||||
# Makefile for Poco CppUnit
|
# Makefile for Poco CppUnit
|
||||||
#
|
#
|
||||||
|
|
||||||
include $(POCO_BASE)/build/rules/global
|
include $(POCO_BASE)/build/rules/global
|
||||||
|
|
||||||
objects = CppUnitException TestDecorator TestResult TestSuite \
|
objects = CppUnitException TestDecorator TestResult TestSuite \
|
||||||
TestCase TestFailure TestRunner TextTestResult
|
TestCase TestFailure TestRunner TextTestResult
|
||||||
|
|
||||||
target = CppUnit
|
target = CppUnit
|
||||||
target_version = 1
|
target_version = 1
|
||||||
target_libs =
|
target_libs =
|
||||||
|
|
||||||
include $(POCO_BASE)/build/rules/lib
|
include $(POCO_BASE)/build/rules/lib
|
||||||
|
|||||||
@@ -1,223 +1,223 @@
|
|||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="7.10"
|
Version="7.10"
|
||||||
Name="WinTestRunner"
|
Name="WinTestRunner"
|
||||||
ProjectGUID="{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}"
|
ProjectGUID="{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}"
|
||||||
SccProjectName="WinTestRunner"
|
SccProjectName="WinTestRunner"
|
||||||
SccLocalPath="."
|
SccLocalPath="."
|
||||||
Keyword="MFCProj">
|
Keyword="MFCProj">
|
||||||
<Platforms>
|
<Platforms>
|
||||||
<Platform
|
<Platform
|
||||||
Name="Win32"/>
|
Name="Win32"/>
|
||||||
</Platforms>
|
</Platforms>
|
||||||
<Configurations>
|
<Configurations>
|
||||||
<Configuration
|
<Configuration
|
||||||
Name="release_shared|Win32"
|
Name="release_shared|Win32"
|
||||||
OutputDirectory=".\obj\release_shared"
|
OutputDirectory=".\obj\release_shared"
|
||||||
IntermediateDirectory=".\obj\release_shared"
|
IntermediateDirectory=".\obj\release_shared"
|
||||||
ConfigurationType="2"
|
ConfigurationType="2"
|
||||||
UseOfMFC="2"
|
UseOfMFC="2"
|
||||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||||
CharacterSet="2">
|
CharacterSet="2">
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="4"
|
Optimization="4"
|
||||||
InlineFunctionExpansion="1"
|
InlineFunctionExpansion="1"
|
||||||
EnableIntrinsicFunctions="TRUE"
|
EnableIntrinsicFunctions="TRUE"
|
||||||
FavorSizeOrSpeed="1"
|
FavorSizeOrSpeed="1"
|
||||||
OmitFramePointers="TRUE"
|
OmitFramePointers="TRUE"
|
||||||
AdditionalIncludeDirectories="include;..\include"
|
AdditionalIncludeDirectories="include;..\include"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;POCO_DLL;WinTestRunner_EXPORTS;WINVER=0x0500"
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;POCO_DLL;WinTestRunner_EXPORTS;WINVER=0x0500"
|
||||||
RuntimeLibrary="2"
|
RuntimeLibrary="2"
|
||||||
BufferSecurityCheck="FALSE"
|
BufferSecurityCheck="FALSE"
|
||||||
TreatWChar_tAsBuiltInType="TRUE"
|
TreatWChar_tAsBuiltInType="TRUE"
|
||||||
ForceConformanceInForLoopScope="TRUE"
|
ForceConformanceInForLoopScope="TRUE"
|
||||||
RuntimeTypeInfo="TRUE"
|
RuntimeTypeInfo="TRUE"
|
||||||
PrecompiledHeaderFile=""
|
PrecompiledHeaderFile=""
|
||||||
AssemblerListingLocation=""
|
AssemblerListingLocation=""
|
||||||
ObjectFile="$(IntDir)\"
|
ObjectFile="$(IntDir)\"
|
||||||
ProgramDataBaseFileName="$(IntDir)/vc70.pdb"
|
ProgramDataBaseFileName="$(IntDir)/vc70.pdb"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
Detect64BitPortabilityProblems="TRUE"
|
Detect64BitPortabilityProblems="TRUE"
|
||||||
CompileAs="0"/>
|
CompileAs="0"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCustomBuildTool"/>
|
Name="VCCustomBuildTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies="cppunit.lib winmm.lib"
|
AdditionalDependencies="cppunit.lib winmm.lib"
|
||||||
OutputFile="..\..\bin\WinTestRunner.dll"
|
OutputFile="..\..\bin\WinTestRunner.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
AdditionalLibraryDirectories="..\..\lib"
|
AdditionalLibraryDirectories="..\..\lib"
|
||||||
ProgramDatabaseFile=""
|
ProgramDatabaseFile=""
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
ImportLibrary="..\..\lib\WinTestRunner.lib"
|
ImportLibrary="..\..\lib\WinTestRunner.lib"
|
||||||
TargetMachine="1"/>
|
TargetMachine="1"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCMIDLTool"
|
Name="VCMIDLTool"
|
||||||
PreprocessorDefinitions="NDEBUG"
|
PreprocessorDefinitions="NDEBUG"
|
||||||
MkTypLibCompatible="TRUE"
|
MkTypLibCompatible="TRUE"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
TargetEnvironment="1"
|
TargetEnvironment="1"
|
||||||
TypeLibraryName=".\lib\wintestrunner.tlb"
|
TypeLibraryName=".\lib\wintestrunner.tlb"
|
||||||
HeaderFileName=""/>
|
HeaderFileName=""/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPostBuildEventTool"/>
|
Name="VCPostBuildEventTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreBuildEventTool"/>
|
Name="VCPreBuildEventTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreLinkEventTool"/>
|
Name="VCPreLinkEventTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCResourceCompilerTool"
|
Name="VCResourceCompilerTool"
|
||||||
PreprocessorDefinitions="NDEBUG"
|
PreprocessorDefinitions="NDEBUG"
|
||||||
Culture="3079"/>
|
Culture="3079"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCWebServiceProxyGeneratorTool"/>
|
Name="VCWebServiceProxyGeneratorTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCXMLDataGeneratorTool"/>
|
Name="VCXMLDataGeneratorTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCWebDeploymentTool"/>
|
Name="VCWebDeploymentTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedWrapperGeneratorTool"/>
|
Name="VCManagedWrapperGeneratorTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
<Configuration
|
<Configuration
|
||||||
Name="debug_shared|Win32"
|
Name="debug_shared|Win32"
|
||||||
OutputDirectory=".\obj\debug_shared"
|
OutputDirectory=".\obj\debug_shared"
|
||||||
IntermediateDirectory=".\obj\debug_shared"
|
IntermediateDirectory=".\obj\debug_shared"
|
||||||
ConfigurationType="2"
|
ConfigurationType="2"
|
||||||
UseOfMFC="2"
|
UseOfMFC="2"
|
||||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||||
CharacterSet="2">
|
CharacterSet="2">
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
InlineFunctionExpansion="0"
|
InlineFunctionExpansion="0"
|
||||||
EnableIntrinsicFunctions="FALSE"
|
EnableIntrinsicFunctions="FALSE"
|
||||||
AdditionalIncludeDirectories="include;..\include"
|
AdditionalIncludeDirectories="include;..\include"
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;POCO_DLL;WinTestRunner_EXPORTS;WINVER=0x0500"
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;POCO_DLL;WinTestRunner_EXPORTS;WINVER=0x0500"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="3"
|
RuntimeLibrary="3"
|
||||||
BufferSecurityCheck="TRUE"
|
BufferSecurityCheck="TRUE"
|
||||||
TreatWChar_tAsBuiltInType="TRUE"
|
TreatWChar_tAsBuiltInType="TRUE"
|
||||||
ForceConformanceInForLoopScope="TRUE"
|
ForceConformanceInForLoopScope="TRUE"
|
||||||
RuntimeTypeInfo="TRUE"
|
RuntimeTypeInfo="TRUE"
|
||||||
PrecompiledHeaderFile=""
|
PrecompiledHeaderFile=""
|
||||||
AssemblerListingLocation=""
|
AssemblerListingLocation=""
|
||||||
ObjectFile="$(IntDir)\"
|
ObjectFile="$(IntDir)\"
|
||||||
ProgramDataBaseFileName="$(IntDir)\vc70.pdb"
|
ProgramDataBaseFileName="$(IntDir)\vc70.pdb"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
Detect64BitPortabilityProblems="TRUE"
|
Detect64BitPortabilityProblems="TRUE"
|
||||||
DebugInformationFormat="4"
|
DebugInformationFormat="4"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
ShowIncludes="FALSE"/>
|
ShowIncludes="FALSE"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCustomBuildTool"/>
|
Name="VCCustomBuildTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies="cppunitd.lib winmm.lib"
|
AdditionalDependencies="cppunitd.lib winmm.lib"
|
||||||
ShowProgress="0"
|
ShowProgress="0"
|
||||||
OutputFile="..\..\bin\WinTestRunnerd.dll"
|
OutputFile="..\..\bin\WinTestRunnerd.dll"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
AdditionalLibraryDirectories="..\..\lib"
|
AdditionalLibraryDirectories="..\..\lib"
|
||||||
GenerateDebugInformation="TRUE"
|
GenerateDebugInformation="TRUE"
|
||||||
ProgramDatabaseFile="..\..\bin\WinTestRunnerd.pdb"
|
ProgramDatabaseFile="..\..\bin\WinTestRunnerd.pdb"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
ImportLibrary="..\..\lib\WinTestRunnerd.lib"
|
ImportLibrary="..\..\lib\WinTestRunnerd.lib"
|
||||||
TargetMachine="1"/>
|
TargetMachine="1"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCMIDLTool"
|
Name="VCMIDLTool"
|
||||||
PreprocessorDefinitions="_DEBUG"
|
PreprocessorDefinitions="_DEBUG"
|
||||||
MkTypLibCompatible="TRUE"
|
MkTypLibCompatible="TRUE"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
TargetEnvironment="1"
|
TargetEnvironment="1"
|
||||||
TypeLibraryName=".\lib\wintestrunner.tlb"
|
TypeLibraryName=".\lib\wintestrunner.tlb"
|
||||||
HeaderFileName=""/>
|
HeaderFileName=""/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPostBuildEventTool"/>
|
Name="VCPostBuildEventTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreBuildEventTool"/>
|
Name="VCPreBuildEventTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreLinkEventTool"/>
|
Name="VCPreLinkEventTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCResourceCompilerTool"
|
Name="VCResourceCompilerTool"
|
||||||
PreprocessorDefinitions="_DEBUG"
|
PreprocessorDefinitions="_DEBUG"
|
||||||
Culture="3079"/>
|
Culture="3079"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCWebServiceProxyGeneratorTool"/>
|
Name="VCWebServiceProxyGeneratorTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCXMLDataGeneratorTool"/>
|
Name="VCXMLDataGeneratorTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCWebDeploymentTool"/>
|
Name="VCWebDeploymentTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedWrapperGeneratorTool"/>
|
Name="VCManagedWrapperGeneratorTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
</Configurations>
|
</Configurations>
|
||||||
<References>
|
<References>
|
||||||
</References>
|
</References>
|
||||||
<Files>
|
<Files>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Source Files"
|
Name="Source Files"
|
||||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||||
<File
|
<File
|
||||||
RelativePath="src\ActiveTest.cpp">
|
RelativePath="src\ActiveTest.cpp">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\DLLMain.cpp">
|
RelativePath=".\src\DLLMain.cpp">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="src\GUITestResult.cpp">
|
RelativePath="src\GUITestResult.cpp">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="src\ProgressBar.cpp">
|
RelativePath="src\ProgressBar.cpp">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="src\TestRunnerDlg.cpp">
|
RelativePath="src\TestRunnerDlg.cpp">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\WinTestRunner.cpp">
|
RelativePath=".\src\WinTestRunner.cpp">
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Include Files"
|
Name="Include Files"
|
||||||
Filter="*.h">
|
Filter="*.h">
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\ActiveTest.h">
|
RelativePath=".\src\ActiveTest.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\GUITestResult.h">
|
RelativePath=".\src\GUITestResult.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\ProgressBar.h">
|
RelativePath=".\src\ProgressBar.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\TestRunnerDlg.h">
|
RelativePath=".\src\TestRunnerDlg.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\WinTestRunner\WinTestRunner.h">
|
RelativePath=".\include\WinTestRunner\WinTestRunner.h">
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Resource Files"
|
Name="Resource Files"
|
||||||
Filter="">
|
Filter="">
|
||||||
<File
|
<File
|
||||||
RelativePath=".\res\Resource.h">
|
RelativePath=".\res\Resource.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\res\WinTestRunner.rc">
|
RelativePath=".\res\WinTestRunner.rc">
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
</Files>
|
</Files>
|
||||||
<Globals>
|
<Globals>
|
||||||
<Global
|
<Global
|
||||||
Name="RESOURCE_FILE"
|
Name="RESOURCE_FILE"
|
||||||
Value="TestRunner.rc"/>
|
Value="TestRunner.rc"/>
|
||||||
</Globals>
|
</Globals>
|
||||||
</VisualStudioProject>
|
</VisualStudioProject>
|
||||||
|
|||||||
@@ -1,301 +1,301 @@
|
|||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="8.00"
|
Version="8.00"
|
||||||
Name="WinTestRunner"
|
Name="WinTestRunner"
|
||||||
ProjectGUID="{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}"
|
ProjectGUID="{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}"
|
||||||
Keyword="MFCProj"
|
Keyword="MFCProj"
|
||||||
>
|
>
|
||||||
<Platforms>
|
<Platforms>
|
||||||
<Platform
|
<Platform
|
||||||
Name="Win32"
|
Name="Win32"
|
||||||
/>
|
/>
|
||||||
</Platforms>
|
</Platforms>
|
||||||
<ToolFiles>
|
<ToolFiles>
|
||||||
</ToolFiles>
|
</ToolFiles>
|
||||||
<Configurations>
|
<Configurations>
|
||||||
<Configuration
|
<Configuration
|
||||||
Name="release_shared|Win32"
|
Name="release_shared|Win32"
|
||||||
OutputDirectory=".\obj\release_shared"
|
OutputDirectory=".\obj\release_shared"
|
||||||
IntermediateDirectory=".\obj\release_shared"
|
IntermediateDirectory=".\obj\release_shared"
|
||||||
ConfigurationType="2"
|
ConfigurationType="2"
|
||||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||||
UseOfMFC="2"
|
UseOfMFC="2"
|
||||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||||
CharacterSet="2"
|
CharacterSet="2"
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreBuildEventTool"
|
Name="VCPreBuildEventTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCustomBuildTool"
|
Name="VCCustomBuildTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCXMLDataGeneratorTool"
|
Name="VCXMLDataGeneratorTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCWebServiceProxyGeneratorTool"
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCMIDLTool"
|
Name="VCMIDLTool"
|
||||||
PreprocessorDefinitions="NDEBUG"
|
PreprocessorDefinitions="NDEBUG"
|
||||||
MkTypLibCompatible="true"
|
MkTypLibCompatible="true"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
TargetEnvironment="1"
|
TargetEnvironment="1"
|
||||||
TypeLibraryName=".\lib\wintestrunner.tlb"
|
TypeLibraryName=".\lib\wintestrunner.tlb"
|
||||||
HeaderFileName=""
|
HeaderFileName=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="4"
|
Optimization="4"
|
||||||
InlineFunctionExpansion="1"
|
InlineFunctionExpansion="1"
|
||||||
EnableIntrinsicFunctions="true"
|
EnableIntrinsicFunctions="true"
|
||||||
FavorSizeOrSpeed="1"
|
FavorSizeOrSpeed="1"
|
||||||
OmitFramePointers="true"
|
OmitFramePointers="true"
|
||||||
AdditionalIncludeDirectories="include;..\include"
|
AdditionalIncludeDirectories="include;..\include"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WinTestRunner_EXPORTS;WINVER=0x0500;_CRT_SECURE_NO_DEPRECATE"
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WinTestRunner_EXPORTS;WINVER=0x0500;_CRT_SECURE_NO_DEPRECATE"
|
||||||
RuntimeLibrary="2"
|
RuntimeLibrary="2"
|
||||||
BufferSecurityCheck="false"
|
BufferSecurityCheck="false"
|
||||||
TreatWChar_tAsBuiltInType="true"
|
TreatWChar_tAsBuiltInType="true"
|
||||||
ForceConformanceInForLoopScope="true"
|
ForceConformanceInForLoopScope="true"
|
||||||
RuntimeTypeInfo="true"
|
RuntimeTypeInfo="true"
|
||||||
PrecompiledHeaderFile=""
|
PrecompiledHeaderFile=""
|
||||||
AssemblerListingLocation=""
|
AssemblerListingLocation=""
|
||||||
ObjectFile="$(IntDir)\"
|
ObjectFile="$(IntDir)\"
|
||||||
ProgramDataBaseFileName="$(IntDir)/vc70.pdb"
|
ProgramDataBaseFileName="$(IntDir)/vc70.pdb"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
Detect64BitPortabilityProblems="true"
|
Detect64BitPortabilityProblems="true"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCResourceCompilerTool"
|
Name="VCResourceCompilerTool"
|
||||||
PreprocessorDefinitions="NDEBUG"
|
PreprocessorDefinitions="NDEBUG"
|
||||||
Culture="3079"
|
Culture="3079"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreLinkEventTool"
|
Name="VCPreLinkEventTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies="cppunit.lib winmm.lib"
|
AdditionalDependencies="cppunit.lib winmm.lib"
|
||||||
OutputFile="..\..\bin\WinTestRunner.dll"
|
OutputFile="..\..\bin\WinTestRunner.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
AdditionalLibraryDirectories="..\..\lib"
|
AdditionalLibraryDirectories="..\..\lib"
|
||||||
ProgramDatabaseFile=""
|
ProgramDatabaseFile=""
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
ImportLibrary="..\..\lib\WinTestRunner.lib"
|
ImportLibrary="..\..\lib\WinTestRunner.lib"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCALinkTool"
|
Name="VCALinkTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManifestTool"
|
Name="VCManifestTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCXDCMakeTool"
|
Name="VCXDCMakeTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCBscMakeTool"
|
Name="VCBscMakeTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCFxCopTool"
|
Name="VCFxCopTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCAppVerifierTool"
|
Name="VCAppVerifierTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCWebDeploymentTool"
|
Name="VCWebDeploymentTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPostBuildEventTool"
|
Name="VCPostBuildEventTool"
|
||||||
/>
|
/>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
<Configuration
|
<Configuration
|
||||||
Name="debug_shared|Win32"
|
Name="debug_shared|Win32"
|
||||||
OutputDirectory=".\obj\debug_shared"
|
OutputDirectory=".\obj\debug_shared"
|
||||||
IntermediateDirectory=".\obj\debug_shared"
|
IntermediateDirectory=".\obj\debug_shared"
|
||||||
ConfigurationType="2"
|
ConfigurationType="2"
|
||||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||||
UseOfMFC="2"
|
UseOfMFC="2"
|
||||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||||
CharacterSet="2"
|
CharacterSet="2"
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreBuildEventTool"
|
Name="VCPreBuildEventTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCustomBuildTool"
|
Name="VCCustomBuildTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCXMLDataGeneratorTool"
|
Name="VCXMLDataGeneratorTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCWebServiceProxyGeneratorTool"
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCMIDLTool"
|
Name="VCMIDLTool"
|
||||||
PreprocessorDefinitions="_DEBUG"
|
PreprocessorDefinitions="_DEBUG"
|
||||||
MkTypLibCompatible="true"
|
MkTypLibCompatible="true"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
TargetEnvironment="1"
|
TargetEnvironment="1"
|
||||||
TypeLibraryName=".\lib\wintestrunner.tlb"
|
TypeLibraryName=".\lib\wintestrunner.tlb"
|
||||||
HeaderFileName=""
|
HeaderFileName=""
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
InlineFunctionExpansion="0"
|
InlineFunctionExpansion="0"
|
||||||
EnableIntrinsicFunctions="false"
|
EnableIntrinsicFunctions="false"
|
||||||
AdditionalIncludeDirectories="include;..\include"
|
AdditionalIncludeDirectories="include;..\include"
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;WinTestRunner_EXPORTS;WINVER=0x0500;_CRT_SECURE_NO_DEPRECATE"
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;WinTestRunner_EXPORTS;WINVER=0x0500;_CRT_SECURE_NO_DEPRECATE"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="3"
|
RuntimeLibrary="3"
|
||||||
BufferSecurityCheck="true"
|
BufferSecurityCheck="true"
|
||||||
TreatWChar_tAsBuiltInType="true"
|
TreatWChar_tAsBuiltInType="true"
|
||||||
ForceConformanceInForLoopScope="true"
|
ForceConformanceInForLoopScope="true"
|
||||||
RuntimeTypeInfo="true"
|
RuntimeTypeInfo="true"
|
||||||
PrecompiledHeaderFile=""
|
PrecompiledHeaderFile=""
|
||||||
AssemblerListingLocation=""
|
AssemblerListingLocation=""
|
||||||
ObjectFile="$(IntDir)\"
|
ObjectFile="$(IntDir)\"
|
||||||
ProgramDataBaseFileName="$(IntDir)\vc70.pdb"
|
ProgramDataBaseFileName="$(IntDir)\vc70.pdb"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
Detect64BitPortabilityProblems="true"
|
Detect64BitPortabilityProblems="true"
|
||||||
DebugInformationFormat="4"
|
DebugInformationFormat="4"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
ShowIncludes="false"
|
ShowIncludes="false"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCResourceCompilerTool"
|
Name="VCResourceCompilerTool"
|
||||||
PreprocessorDefinitions="_DEBUG"
|
PreprocessorDefinitions="_DEBUG"
|
||||||
Culture="3079"
|
Culture="3079"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreLinkEventTool"
|
Name="VCPreLinkEventTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies="cppunitd.lib winmm.lib"
|
AdditionalDependencies="cppunitd.lib winmm.lib"
|
||||||
ShowProgress="0"
|
ShowProgress="0"
|
||||||
OutputFile="..\..\bin\WinTestRunnerd.dll"
|
OutputFile="..\..\bin\WinTestRunnerd.dll"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
AdditionalLibraryDirectories="..\..\lib"
|
AdditionalLibraryDirectories="..\..\lib"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
ProgramDatabaseFile="..\..\bin\WinTestRunnerd.pdb"
|
ProgramDatabaseFile="..\..\bin\WinTestRunnerd.pdb"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
ImportLibrary="..\..\lib\WinTestRunnerd.lib"
|
ImportLibrary="..\..\lib\WinTestRunnerd.lib"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCALinkTool"
|
Name="VCALinkTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManifestTool"
|
Name="VCManifestTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCXDCMakeTool"
|
Name="VCXDCMakeTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCBscMakeTool"
|
Name="VCBscMakeTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCFxCopTool"
|
Name="VCFxCopTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCAppVerifierTool"
|
Name="VCAppVerifierTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCWebDeploymentTool"
|
Name="VCWebDeploymentTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPostBuildEventTool"
|
Name="VCPostBuildEventTool"
|
||||||
/>
|
/>
|
||||||
</Configuration>
|
</Configuration>
|
||||||
</Configurations>
|
</Configurations>
|
||||||
<References>
|
<References>
|
||||||
</References>
|
</References>
|
||||||
<Files>
|
<Files>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Source Files"
|
Name="Source Files"
|
||||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||||
>
|
>
|
||||||
<File
|
<File
|
||||||
RelativePath="src\ActiveTest.cpp"
|
RelativePath="src\ActiveTest.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\DLLMain.cpp"
|
RelativePath=".\src\DLLMain.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="src\GUITestResult.cpp"
|
RelativePath="src\GUITestResult.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="src\ProgressBar.cpp"
|
RelativePath="src\ProgressBar.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="src\TestRunnerDlg.cpp"
|
RelativePath="src\TestRunnerDlg.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\WinTestRunner.cpp"
|
RelativePath=".\src\WinTestRunner.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Include Files"
|
Name="Include Files"
|
||||||
Filter="*.h"
|
Filter="*.h"
|
||||||
>
|
>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\ActiveTest.h"
|
RelativePath=".\src\ActiveTest.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\GUITestResult.h"
|
RelativePath=".\src\GUITestResult.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\ProgressBar.h"
|
RelativePath=".\src\ProgressBar.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\TestRunnerDlg.h"
|
RelativePath=".\src\TestRunnerDlg.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\WinTestRunner\WinTestRunner.h"
|
RelativePath=".\include\WinTestRunner\WinTestRunner.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Resource Files"
|
Name="Resource Files"
|
||||||
>
|
>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\res\Resource.h"
|
RelativePath=".\res\Resource.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\res\WinTestRunner.rc"
|
RelativePath=".\res\WinTestRunner.rc"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
</Files>
|
</Files>
|
||||||
<Globals>
|
<Globals>
|
||||||
<Global
|
<Global
|
||||||
Name="RESOURCE_FILE"
|
Name="RESOURCE_FILE"
|
||||||
Value="TestRunner.rc"
|
Value="TestRunner.rc"
|
||||||
/>
|
/>
|
||||||
</Globals>
|
</Globals>
|
||||||
</VisualStudioProject>
|
</VisualStudioProject>
|
||||||
|
|||||||
@@ -1,63 +1,63 @@
|
|||||||
//
|
//
|
||||||
// WinTestRunner.h
|
// WinTestRunner.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/WinTestRunner/include/WinTestRunner/WinTestRunner.h#1 $
|
// $Id: //poco/1.2/CppUnit/WinTestRunner/include/WinTestRunner/WinTestRunner.h#1 $
|
||||||
//
|
//
|
||||||
// Application shell for CppUnit's TestRunner dialog.
|
// Application shell for CppUnit's TestRunner dialog.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef WinTestRunner_H_INCLUDED
|
#ifndef WinTestRunner_H_INCLUDED
|
||||||
#define WinTestRunner_H_INCLUDED
|
#define WinTestRunner_H_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#if defined(WinTestRunner_EXPORTS)
|
#if defined(WinTestRunner_EXPORTS)
|
||||||
#define WinTestRunner_API __declspec(dllexport)
|
#define WinTestRunner_API __declspec(dllexport)
|
||||||
#else
|
#else
|
||||||
#define WinTestRunner_API __declspec(dllimport)
|
#define WinTestRunner_API __declspec(dllimport)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/CppUnit.h"
|
#include "CppUnit/CppUnit.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <afxwin.h>
|
#include <afxwin.h>
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
class Test;
|
class Test;
|
||||||
|
|
||||||
|
|
||||||
class WinTestRunner_API WinTestRunner
|
class WinTestRunner_API WinTestRunner
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WinTestRunner();
|
WinTestRunner();
|
||||||
~WinTestRunner();
|
~WinTestRunner();
|
||||||
|
|
||||||
void run();
|
void run();
|
||||||
void addTest(Test* pTest);
|
void addTest(Test* pTest);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<Test*> _tests;
|
std::vector<Test*> _tests;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class WinTestRunner_API WinTestRunnerApp: public CWinApp
|
class WinTestRunner_API WinTestRunnerApp: public CWinApp
|
||||||
/// A simple application class that hosts the TestRunner dialog.
|
/// A simple application class that hosts the TestRunner dialog.
|
||||||
/// Create a subclass and override the TestMain() method.
|
/// Create a subclass and override the TestMain() method.
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual BOOL InitInstance();
|
virtual BOOL InitInstance();
|
||||||
|
|
||||||
virtual void TestMain() = 0;
|
virtual void TestMain() = 0;
|
||||||
|
|
||||||
DECLARE_MESSAGE_MAP()
|
DECLARE_MESSAGE_MAP()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|
||||||
|
|
||||||
#endif // WinTestRunner_H_INCLUDED
|
#endif // WinTestRunner_H_INCLUDED
|
||||||
|
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
//{{NO_DEPENDENCIES}}
|
//{{NO_DEPENDENCIES}}
|
||||||
// Microsoft Visual C++ generated include file.
|
// Microsoft Visual C++ generated include file.
|
||||||
// Used by TestRunner.rc
|
// Used by TestRunner.rc
|
||||||
//
|
//
|
||||||
#define IDD_DIALOG_TESTRUNNER 129
|
#define IDD_DIALOG_TESTRUNNER 129
|
||||||
#define IDC_LIST 1000
|
#define IDC_LIST 1000
|
||||||
#define ID_RUN 1001
|
#define ID_RUN 1001
|
||||||
#define ID_STOP 1002
|
#define ID_STOP 1002
|
||||||
#define IDC_PROGRESS 1003
|
#define IDC_PROGRESS 1003
|
||||||
#define IDC_INDICATOR 1004
|
#define IDC_INDICATOR 1004
|
||||||
#define IDC_COMBO_TEST 1005
|
#define IDC_COMBO_TEST 1005
|
||||||
#define IDC_STATIC_RUNS 1007
|
#define IDC_STATIC_RUNS 1007
|
||||||
#define IDC_STATIC_ERRORS 1008
|
#define IDC_STATIC_ERRORS 1008
|
||||||
#define IDC_STATIC_FAILURES 1009
|
#define IDC_STATIC_FAILURES 1009
|
||||||
#define IDC_EDIT_TIME 1010
|
#define IDC_EDIT_TIME 1010
|
||||||
#define IDC_CHK_AUTORUN 1013
|
#define IDC_CHK_AUTORUN 1013
|
||||||
|
|
||||||
// Next default values for new objects
|
// Next default values for new objects
|
||||||
//
|
//
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 131
|
#define _APS_NEXT_RESOURCE_VALUE 131
|
||||||
#define _APS_NEXT_COMMAND_VALUE 32771
|
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1014
|
#define _APS_NEXT_CONTROL_VALUE 1014
|
||||||
#define _APS_NEXT_SYMED_VALUE 101
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,175 +1,175 @@
|
|||||||
// Microsoft Visual C++ generated resource script.
|
// Microsoft Visual C++ generated resource script.
|
||||||
//
|
//
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
|
||||||
#define APSTUDIO_READONLY_SYMBOLS
|
#define APSTUDIO_READONLY_SYMBOLS
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Generated from the TEXTINCLUDE 2 resource.
|
// Generated from the TEXTINCLUDE 2 resource.
|
||||||
//
|
//
|
||||||
#include "afxres.h"
|
#include "afxres.h"
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
#undef APSTUDIO_READONLY_SYMBOLS
|
#undef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// English (U.S.) resources
|
// English (U.S.) resources
|
||||||
|
|
||||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
#pragma code_page(1252)
|
#pragma code_page(1252)
|
||||||
#endif //_WIN32
|
#endif //_WIN32
|
||||||
|
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// TEXTINCLUDE
|
// TEXTINCLUDE
|
||||||
//
|
//
|
||||||
|
|
||||||
1 TEXTINCLUDE
|
1 TEXTINCLUDE
|
||||||
BEGIN
|
BEGIN
|
||||||
"resource.h\0"
|
"resource.h\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
2 TEXTINCLUDE
|
2 TEXTINCLUDE
|
||||||
BEGIN
|
BEGIN
|
||||||
"#include ""afxres.h""\r\n"
|
"#include ""afxres.h""\r\n"
|
||||||
"\0"
|
"\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
3 TEXTINCLUDE
|
3 TEXTINCLUDE
|
||||||
BEGIN
|
BEGIN
|
||||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||||
"\r\n"
|
"\r\n"
|
||||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
|
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
|
||||||
"#ifdef _WIN32\r\n"
|
"#ifdef _WIN32\r\n"
|
||||||
"LANGUAGE 9, 1\r\n"
|
"LANGUAGE 9, 1\r\n"
|
||||||
"#pragma code_page(1252)\r\n"
|
"#pragma code_page(1252)\r\n"
|
||||||
"#endif\r\n"
|
"#endif\r\n"
|
||||||
"#include ""..\\res\\WinTestRunner.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
|
"#include ""..\\res\\WinTestRunner.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
|
||||||
"#include ""afxres.rc"" // Standard components\r\n"
|
"#include ""afxres.rc"" // Standard components\r\n"
|
||||||
"#endif\0"
|
"#endif\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
#endif // APSTUDIO_INVOKED
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Version
|
// Version
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,0,0,1
|
FILEVERSION 1,0,0,1
|
||||||
PRODUCTVERSION 1,0,0,1
|
PRODUCTVERSION 1,0,0,1
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
#else
|
#else
|
||||||
FILEFLAGS 0x0L
|
FILEFLAGS 0x0L
|
||||||
#endif
|
#endif
|
||||||
FILEOS 0x4L
|
FILEOS 0x4L
|
||||||
FILETYPE 0x2L
|
FILETYPE 0x2L
|
||||||
FILESUBTYPE 0x0L
|
FILESUBTYPE 0x0L
|
||||||
BEGIN
|
BEGIN
|
||||||
BLOCK "StringFileInfo"
|
BLOCK "StringFileInfo"
|
||||||
BEGIN
|
BEGIN
|
||||||
BLOCK "040904b0"
|
BLOCK "040904b0"
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "FileDescription", "CppUnit WinTestRunner DLL"
|
VALUE "FileDescription", "CppUnit WinTestRunner DLL"
|
||||||
VALUE "FileVersion", "1, 0, 0, 1"
|
VALUE "FileVersion", "1, 0, 0, 1"
|
||||||
VALUE "InternalName", "WinTestRunner"
|
VALUE "InternalName", "WinTestRunner"
|
||||||
VALUE "LegalCopyright", "Copyright (c) 2005"
|
VALUE "LegalCopyright", "Copyright (c) 2005"
|
||||||
VALUE "OriginalFilename", "TestRunner.dll"
|
VALUE "OriginalFilename", "TestRunner.dll"
|
||||||
VALUE "ProductName", "CppUnit WinTestRunner Dynamic Link Library"
|
VALUE "ProductName", "CppUnit WinTestRunner Dynamic Link Library"
|
||||||
VALUE "ProductVersion", "1, 0, 0, 1"
|
VALUE "ProductVersion", "1, 0, 0, 1"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "Translation", 0x409, 1200
|
VALUE "Translation", 0x409, 1200
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Dialog
|
// Dialog
|
||||||
//
|
//
|
||||||
|
|
||||||
IDD_DIALOG_TESTRUNNER DIALOGEX 0, 0, 512, 300
|
IDD_DIALOG_TESTRUNNER DIALOGEX 0, 0, 512, 300
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
CAPTION "CppUnit WinTestRunner"
|
CAPTION "CppUnit WinTestRunner"
|
||||||
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
COMBOBOX IDC_COMBO_TEST,7,20,424,273,CBS_DROPDOWNLIST |
|
COMBOBOX IDC_COMBO_TEST,7,20,424,273,CBS_DROPDOWNLIST |
|
||||||
WS_VSCROLL | WS_TABSTOP
|
WS_VSCROLL | WS_TABSTOP
|
||||||
DEFPUSHBUTTON "Run",ID_RUN,455,7,50,14
|
DEFPUSHBUTTON "Run",ID_RUN,455,7,50,14
|
||||||
DEFPUSHBUTTON "Stop",ID_STOP,455,24,50,14
|
DEFPUSHBUTTON "Stop",ID_STOP,455,24,50,14
|
||||||
CONTROL "List1",IDC_LIST,"SysListView32",LVS_REPORT | WS_BORDER |
|
CONTROL "List1",IDC_LIST,"SysListView32",LVS_REPORT | WS_BORDER |
|
||||||
WS_TABSTOP,7,110,498,160
|
WS_TABSTOP,7,110,498,160
|
||||||
PUSHBUTTON "Close",IDOK,455,279,50,14
|
PUSHBUTTON "Close",IDOK,455,279,50,14
|
||||||
LTEXT "Test Name:",IDC_STATIC,7,9,179,9
|
LTEXT "Test Name:",IDC_STATIC,7,9,179,9
|
||||||
LTEXT "Progress:",IDC_STATIC,7,55,49,9
|
LTEXT "Progress:",IDC_STATIC,7,55,49,9
|
||||||
LTEXT "Errors and Failures:",IDC_STATIC,7,99,67,9
|
LTEXT "Errors and Failures:",IDC_STATIC,7,99,67,9
|
||||||
LTEXT "Runs:",IDC_STATIC,457,54,26,10
|
LTEXT "Runs:",IDC_STATIC,457,54,26,10
|
||||||
LTEXT "Failures:",IDC_STATIC,457,80,26,10
|
LTEXT "Failures:",IDC_STATIC,457,80,26,10
|
||||||
LTEXT "Errors:",IDC_STATIC,457,67,26,10
|
LTEXT "Errors:",IDC_STATIC,457,67,26,10
|
||||||
RTEXT "0",IDC_STATIC_RUNS,487,54,16,10
|
RTEXT "0",IDC_STATIC_RUNS,487,54,16,10
|
||||||
RTEXT "0",IDC_STATIC_ERRORS,487,67,16,10
|
RTEXT "0",IDC_STATIC_ERRORS,487,67,16,10
|
||||||
RTEXT "0",IDC_STATIC_FAILURES,487,80,16,10
|
RTEXT "0",IDC_STATIC_FAILURES,487,80,16,10
|
||||||
EDITTEXT IDC_EDIT_TIME,7,281,440,12,ES_AUTOHSCROLL | ES_READONLY |
|
EDITTEXT IDC_EDIT_TIME,7,281,440,12,ES_AUTOHSCROLL | ES_READONLY |
|
||||||
NOT WS_BORDER
|
NOT WS_BORDER
|
||||||
LTEXT "",IDC_PROGRESS,7,67,424,20,SS_SUNKEN | NOT WS_VISIBLE
|
LTEXT "",IDC_PROGRESS,7,67,424,20,SS_SUNKEN | NOT WS_VISIBLE
|
||||||
CONTROL "Auto Run",IDC_CHK_AUTORUN,"Button",BS_AUTOCHECKBOX |
|
CONTROL "Auto Run",IDC_CHK_AUTORUN,"Button",BS_AUTOCHECKBOX |
|
||||||
BS_LEFTTEXT | WS_TABSTOP,383,38,46,10
|
BS_LEFTTEXT | WS_TABSTOP,383,38,46,10
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// DESIGNINFO
|
// DESIGNINFO
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
GUIDELINES DESIGNINFO
|
GUIDELINES DESIGNINFO
|
||||||
BEGIN
|
BEGIN
|
||||||
IDD_DIALOG_TESTRUNNER, DIALOG
|
IDD_DIALOG_TESTRUNNER, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 7
|
LEFTMARGIN, 7
|
||||||
RIGHTMARGIN, 505
|
RIGHTMARGIN, 505
|
||||||
TOPMARGIN, 7
|
TOPMARGIN, 7
|
||||||
BOTTOMMARGIN, 293
|
BOTTOMMARGIN, 293
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
#endif // APSTUDIO_INVOKED
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
#endif // English (U.S.) resources
|
#endif // English (U.S.) resources
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef APSTUDIO_INVOKED
|
#ifndef APSTUDIO_INVOKED
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Generated from the TEXTINCLUDE 3 resource.
|
// Generated from the TEXTINCLUDE 3 resource.
|
||||||
//
|
//
|
||||||
#define _AFX_NO_SPLITTER_RESOURCES
|
#define _AFX_NO_SPLITTER_RESOURCES
|
||||||
#define _AFX_NO_OLE_RESOURCES
|
#define _AFX_NO_OLE_RESOURCES
|
||||||
#define _AFX_NO_TRACKER_RESOURCES
|
#define _AFX_NO_TRACKER_RESOURCES
|
||||||
#define _AFX_NO_PROPERTY_RESOURCES
|
#define _AFX_NO_PROPERTY_RESOURCES
|
||||||
|
|
||||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
LANGUAGE 9, 1
|
LANGUAGE 9, 1
|
||||||
#pragma code_page(1252)
|
#pragma code_page(1252)
|
||||||
#endif
|
#endif
|
||||||
#include "afxres.rc" // Standard components
|
#include "afxres.rc" // Standard components
|
||||||
#endif
|
#endif
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
#endif // not APSTUDIO_INVOKED
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|||||||
@@ -1,44 +1,44 @@
|
|||||||
//
|
//
|
||||||
// ActiveTest.cpp
|
// ActiveTest.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/ActiveTest.cpp#1 $
|
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/ActiveTest.cpp#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#include <afxwin.h>
|
#include <afxwin.h>
|
||||||
#include "ActiveTest.h"
|
#include "ActiveTest.h"
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
// Spawn a thread to a test
|
// Spawn a thread to a test
|
||||||
void ActiveTest::run(TestResult* result)
|
void ActiveTest::run(TestResult* result)
|
||||||
{
|
{
|
||||||
CWinThread* thread;
|
CWinThread* thread;
|
||||||
|
|
||||||
setTestResult(result);
|
setTestResult(result);
|
||||||
_runCompleted.ResetEvent();
|
_runCompleted.ResetEvent();
|
||||||
|
|
||||||
thread = AfxBeginThread(threadFunction, this, THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED);
|
thread = AfxBeginThread(threadFunction, this, THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED);
|
||||||
DuplicateHandle(GetCurrentProcess(), thread->m_hThread, GetCurrentProcess(), &_threadHandle, 0, FALSE, DUPLICATE_SAME_ACCESS);
|
DuplicateHandle(GetCurrentProcess(), thread->m_hThread, GetCurrentProcess(), &_threadHandle, 0, FALSE, DUPLICATE_SAME_ACCESS);
|
||||||
|
|
||||||
thread->ResumeThread();
|
thread->ResumeThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Simple execution thread. Assuming that an ActiveTest instance
|
// Simple execution thread. Assuming that an ActiveTest instance
|
||||||
// only creates one of these at a time.
|
// only creates one of these at a time.
|
||||||
UINT ActiveTest::threadFunction(LPVOID thisInstance)
|
UINT ActiveTest::threadFunction(LPVOID thisInstance)
|
||||||
{
|
{
|
||||||
ActiveTest* test = (ActiveTest*) thisInstance;
|
ActiveTest* test = (ActiveTest*) thisInstance;
|
||||||
|
|
||||||
test->run();
|
test->run();
|
||||||
test->_runCompleted.SetEvent();
|
test->_runCompleted.SetEvent();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|
||||||
|
|||||||
@@ -1,89 +1,89 @@
|
|||||||
//
|
//
|
||||||
// ActiveTest.h
|
// ActiveTest.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/ActiveTest.h#1 $
|
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/ActiveTest.h#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef ActiveTest_INCLUDED
|
#ifndef ActiveTest_INCLUDED
|
||||||
#define ActiveTest_INCLUDED
|
#define ActiveTest_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/CppUnit.h"
|
#include "CppUnit/CppUnit.h"
|
||||||
#include "CppUnit/TestDecorator.h"
|
#include "CppUnit/TestDecorator.h"
|
||||||
#include <afxmt.h>
|
#include <afxmt.h>
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
/* A Microsoft-specific active test
|
/* A Microsoft-specific active test
|
||||||
*
|
*
|
||||||
* An active test manages its own
|
* An active test manages its own
|
||||||
* thread of execution. This one
|
* thread of execution. This one
|
||||||
* is very simple and only sufficient
|
* is very simple and only sufficient
|
||||||
* for the limited use we put it through
|
* for the limited use we put it through
|
||||||
* in the TestRunner. It spawns a thread
|
* in the TestRunner. It spawns a thread
|
||||||
* on run (TestResult *) and signals
|
* on run (TestResult *) and signals
|
||||||
* completion of the test.
|
* completion of the test.
|
||||||
*
|
*
|
||||||
* We assume that only one thread
|
* We assume that only one thread
|
||||||
* will be active at once for each
|
* will be active at once for each
|
||||||
* instance.
|
* instance.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class ActiveTest: public TestDecorator
|
class ActiveTest: public TestDecorator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ActiveTest(Test* test);
|
ActiveTest(Test* test);
|
||||||
~ActiveTest();
|
~ActiveTest();
|
||||||
|
|
||||||
void run(TestResult* result);
|
void run(TestResult* result);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
HANDLE _threadHandle;
|
HANDLE _threadHandle;
|
||||||
CEvent _runCompleted;
|
CEvent _runCompleted;
|
||||||
TestResult* _currentTestResult;
|
TestResult* _currentTestResult;
|
||||||
|
|
||||||
void run ();
|
void run ();
|
||||||
void setTestResult(TestResult* result);
|
void setTestResult(TestResult* result);
|
||||||
static UINT threadFunction(LPVOID thisInstance);
|
static UINT threadFunction(LPVOID thisInstance);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Construct the active test
|
// Construct the active test
|
||||||
inline ActiveTest::ActiveTest(Test *test): TestDecorator(test)
|
inline ActiveTest::ActiveTest(Test *test): TestDecorator(test)
|
||||||
{
|
{
|
||||||
_currentTestResult = NULL;
|
_currentTestResult = NULL;
|
||||||
_threadHandle = INVALID_HANDLE_VALUE;
|
_threadHandle = INVALID_HANDLE_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Pend until the test has completed
|
// Pend until the test has completed
|
||||||
inline ActiveTest::~ActiveTest()
|
inline ActiveTest::~ActiveTest()
|
||||||
{
|
{
|
||||||
CSingleLock(&_runCompleted, TRUE);
|
CSingleLock(&_runCompleted, TRUE);
|
||||||
CloseHandle(_threadHandle);
|
CloseHandle(_threadHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Set the test result that we are to run
|
// Set the test result that we are to run
|
||||||
inline void ActiveTest::setTestResult(TestResult* result)
|
inline void ActiveTest::setTestResult(TestResult* result)
|
||||||
{
|
{
|
||||||
_currentTestResult = result;
|
_currentTestResult = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Run our test result
|
// Run our test result
|
||||||
inline void ActiveTest::run()
|
inline void ActiveTest::run()
|
||||||
{
|
{
|
||||||
TestDecorator::run(_currentTestResult);
|
TestDecorator::run(_currentTestResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|
||||||
|
|
||||||
#endif // ActiveTest_INCLUDED
|
#endif // ActiveTest_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,50 +1,50 @@
|
|||||||
//
|
//
|
||||||
// DLLMain.cpp
|
// DLLMain.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/DLLMain.cpp#1 $
|
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/DLLMain.cpp#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#include <afxwin.h>
|
#include <afxwin.h>
|
||||||
#include <afxdllx.h>
|
#include <afxdllx.h>
|
||||||
|
|
||||||
|
|
||||||
static AFX_EXTENSION_MODULE TestRunnerDLL = { NULL, NULL };
|
static AFX_EXTENSION_MODULE TestRunnerDLL = { NULL, NULL };
|
||||||
|
|
||||||
|
|
||||||
extern "C" int APIENTRY
|
extern "C" int APIENTRY
|
||||||
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
|
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
|
||||||
{
|
{
|
||||||
// Remove this if you use lpReserved
|
// Remove this if you use lpReserved
|
||||||
UNREFERENCED_PARAMETER(lpReserved);
|
UNREFERENCED_PARAMETER(lpReserved);
|
||||||
|
|
||||||
if (dwReason == DLL_PROCESS_ATTACH)
|
if (dwReason == DLL_PROCESS_ATTACH)
|
||||||
{
|
{
|
||||||
TRACE0("WinTestRunner.DLL Initializing\n");
|
TRACE0("WinTestRunner.DLL Initializing\n");
|
||||||
|
|
||||||
// Extension DLL one-time initialization
|
// Extension DLL one-time initialization
|
||||||
if (!AfxInitExtensionModule(TestRunnerDLL, hInstance))
|
if (!AfxInitExtensionModule(TestRunnerDLL, hInstance))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Insert this DLL into the resource chain
|
// Insert this DLL into the resource chain
|
||||||
// NOTE: If this Extension DLL is being implicitly linked to by
|
// NOTE: If this Extension DLL is being implicitly linked to by
|
||||||
// an MFC Regular DLL (such as an ActiveX Control)
|
// an MFC Regular DLL (such as an ActiveX Control)
|
||||||
// instead of an MFC application, then you will want to
|
// instead of an MFC application, then you will want to
|
||||||
// remove this line from DllMain and put it in a separate
|
// remove this line from DllMain and put it in a separate
|
||||||
// function exported from this Extension DLL. The Regular DLL
|
// function exported from this Extension DLL. The Regular DLL
|
||||||
// that uses this Extension DLL should then explicitly call that
|
// that uses this Extension DLL should then explicitly call that
|
||||||
// function to initialize this Extension DLL. Otherwise,
|
// function to initialize this Extension DLL. Otherwise,
|
||||||
// the CDynLinkLibrary object will not be attached to the
|
// the CDynLinkLibrary object will not be attached to the
|
||||||
// Regular DLL's resource chain, and serious problems will
|
// Regular DLL's resource chain, and serious problems will
|
||||||
// result.
|
// result.
|
||||||
|
|
||||||
new CDynLinkLibrary(TestRunnerDLL);
|
new CDynLinkLibrary(TestRunnerDLL);
|
||||||
}
|
}
|
||||||
else if (dwReason == DLL_PROCESS_DETACH)
|
else if (dwReason == DLL_PROCESS_DETACH)
|
||||||
{
|
{
|
||||||
TRACE0("WinTestRunner.DLL Terminating\n");
|
TRACE0("WinTestRunner.DLL Terminating\n");
|
||||||
// Terminate the library before destructors are called
|
// Terminate the library before destructors are called
|
||||||
AfxTermExtensionModule(TestRunnerDLL);
|
AfxTermExtensionModule(TestRunnerDLL);
|
||||||
}
|
}
|
||||||
return 1; // ok
|
return 1; // ok
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,43 +1,43 @@
|
|||||||
//
|
//
|
||||||
// GUITestResult.cpp
|
// GUITestResult.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/GUITestResult.cpp#1 $
|
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/GUITestResult.cpp#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#include "TestRunnerDlg.h"
|
#include "TestRunnerDlg.h"
|
||||||
#include "GUITestResult.h"
|
#include "GUITestResult.h"
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
void GUITestResult::addError(Test *test, CppUnitException *e)
|
void GUITestResult::addError(Test *test, CppUnitException *e)
|
||||||
{
|
{
|
||||||
ExclusiveZone zone(_syncObject);
|
ExclusiveZone zone(_syncObject);
|
||||||
|
|
||||||
TestResult::addError(test, e);
|
TestResult::addError(test, e);
|
||||||
_runner->addError(this, test, e);
|
_runner->addError(this, test, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GUITestResult::addFailure(Test *test, CppUnitException *e)
|
void GUITestResult::addFailure(Test *test, CppUnitException *e)
|
||||||
{
|
{
|
||||||
ExclusiveZone zone(_syncObject);
|
ExclusiveZone zone(_syncObject);
|
||||||
|
|
||||||
TestResult::addFailure(test, e);
|
TestResult::addFailure(test, e);
|
||||||
_runner->addFailure(this, test, e);
|
_runner->addFailure(this, test, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GUITestResult::endTest(Test *test)
|
void GUITestResult::endTest(Test *test)
|
||||||
{
|
{
|
||||||
ExclusiveZone zone(_syncObject);
|
ExclusiveZone zone(_syncObject);
|
||||||
|
|
||||||
TestResult::endTest(test);
|
TestResult::endTest(test);
|
||||||
_runner->endTest(this, test);
|
_runner->endTest(this, test);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|
||||||
|
|||||||
@@ -1,82 +1,82 @@
|
|||||||
//
|
//
|
||||||
// GUITestResult.h
|
// GUITestResult.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/GUITestResult.h#1 $
|
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/GUITestResult.h#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef GuiTestResult_INCLUDED
|
#ifndef GuiTestResult_INCLUDED
|
||||||
#define GuiTestResult_INCLUDED
|
#define GuiTestResult_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/CppUnit.h"
|
#include "CppUnit/CppUnit.h"
|
||||||
#include "CppUnit/TestResult.h"
|
#include "CppUnit/TestResult.h"
|
||||||
#include <afxmt.h>
|
#include <afxmt.h>
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
class TestRunnerDlg;
|
class TestRunnerDlg;
|
||||||
|
|
||||||
|
|
||||||
class GUITestResult: public TestResult
|
class GUITestResult: public TestResult
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GUITestResult(TestRunnerDlg* runner);
|
GUITestResult(TestRunnerDlg* runner);
|
||||||
~GUITestResult();
|
~GUITestResult();
|
||||||
|
|
||||||
void addError(Test* test, CppUnitException* e);
|
void addError(Test* test, CppUnitException* e);
|
||||||
void addFailure(Test* test, CppUnitException* e);
|
void addFailure(Test* test, CppUnitException* e);
|
||||||
|
|
||||||
void endTest(Test* test);
|
void endTest(Test* test);
|
||||||
void stop();
|
void stop();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
class LightweightSynchronizationObject: public TestResult::SynchronizationObject
|
class LightweightSynchronizationObject: public TestResult::SynchronizationObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void lock()
|
void lock()
|
||||||
{
|
{
|
||||||
_syncObject.Lock();
|
_syncObject.Lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void unlock()
|
void unlock()
|
||||||
{
|
{
|
||||||
_syncObject.Unlock();
|
_syncObject.Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CCriticalSection _syncObject;
|
CCriticalSection _syncObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TestRunnerDlg *_runner;
|
TestRunnerDlg *_runner;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Construct with lightweight synchronization
|
// Construct with lightweight synchronization
|
||||||
inline GUITestResult::GUITestResult(TestRunnerDlg* runner): _runner(runner)
|
inline GUITestResult::GUITestResult(TestRunnerDlg* runner): _runner(runner)
|
||||||
{
|
{
|
||||||
setSynchronizationObject(new LightweightSynchronizationObject());
|
setSynchronizationObject(new LightweightSynchronizationObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
inline GUITestResult::~GUITestResult()
|
inline GUITestResult::~GUITestResult()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Override without protection to prevent deadlock
|
// Override without protection to prevent deadlock
|
||||||
inline void GUITestResult::stop()
|
inline void GUITestResult::stop()
|
||||||
{
|
{
|
||||||
_stop = true;
|
_stop = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|
||||||
|
|
||||||
#endif // GuiTestResult_INCLUDED
|
#endif // GuiTestResult_INCLUDED
|
||||||
|
|||||||
@@ -1,140 +1,140 @@
|
|||||||
//
|
//
|
||||||
// ProgressBar.cpp
|
// ProgressBar.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/ProgressBar.cpp#1 $
|
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/ProgressBar.cpp#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#include "ProgressBar.h"
|
#include "ProgressBar.h"
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
// Paint the progress bar in response to a paint message
|
// Paint the progress bar in response to a paint message
|
||||||
void ProgressBar::paint(CDC& dc)
|
void ProgressBar::paint(CDC& dc)
|
||||||
{
|
{
|
||||||
paintBackground (dc);
|
paintBackground (dc);
|
||||||
paintStatus (dc);
|
paintStatus (dc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Paint the background of the progress bar region
|
// Paint the background of the progress bar region
|
||||||
void ProgressBar::paintBackground (CDC& dc)
|
void ProgressBar::paintBackground (CDC& dc)
|
||||||
{
|
{
|
||||||
CBrush brshBackground;
|
CBrush brshBackground;
|
||||||
CPen penGray (PS_SOLID, 1, RGB (128, 128, 128));
|
CPen penGray (PS_SOLID, 1, RGB (128, 128, 128));
|
||||||
CPen penWhite (PS_SOLID, 1, RGB (255, 255, 255));
|
CPen penWhite (PS_SOLID, 1, RGB (255, 255, 255));
|
||||||
|
|
||||||
VERIFY (brshBackground.CreateSolidBrush (::GetSysColor (COLOR_BTNFACE)));
|
VERIFY (brshBackground.CreateSolidBrush (::GetSysColor (COLOR_BTNFACE)));
|
||||||
|
|
||||||
dc.FillRect (_bounds, &brshBackground);
|
dc.FillRect (_bounds, &brshBackground);
|
||||||
|
|
||||||
CPen *pOldPen;
|
CPen *pOldPen;
|
||||||
|
|
||||||
pOldPen = dc.SelectObject (&penGray);
|
pOldPen = dc.SelectObject (&penGray);
|
||||||
{
|
{
|
||||||
dc.MoveTo (_bounds.left, _bounds.top);
|
dc.MoveTo (_bounds.left, _bounds.top);
|
||||||
dc.LineTo (_bounds.left + _bounds.Width () -1, _bounds.top);
|
dc.LineTo (_bounds.left + _bounds.Width () -1, _bounds.top);
|
||||||
|
|
||||||
dc.MoveTo (_bounds.left, _bounds.top);
|
dc.MoveTo (_bounds.left, _bounds.top);
|
||||||
dc.LineTo (_bounds.left, _bounds.top + _bounds.Height () -1);
|
dc.LineTo (_bounds.left, _bounds.top + _bounds.Height () -1);
|
||||||
|
|
||||||
}
|
}
|
||||||
dc.SelectObject (&penWhite);
|
dc.SelectObject (&penWhite);
|
||||||
{
|
{
|
||||||
dc.MoveTo (_bounds.left + _bounds.Width () -1, _bounds.top);
|
dc.MoveTo (_bounds.left + _bounds.Width () -1, _bounds.top);
|
||||||
dc.LineTo (_bounds.left + _bounds.Width () -1, _bounds.top + _bounds.Height () -1);
|
dc.LineTo (_bounds.left + _bounds.Width () -1, _bounds.top + _bounds.Height () -1);
|
||||||
|
|
||||||
dc.MoveTo (_bounds.left, _bounds.top + _bounds.Height () -1);
|
dc.MoveTo (_bounds.left, _bounds.top + _bounds.Height () -1);
|
||||||
dc.LineTo (_bounds.left + _bounds.Width () -1, _bounds.top + _bounds.Height () -1);
|
dc.LineTo (_bounds.left + _bounds.Width () -1, _bounds.top + _bounds.Height () -1);
|
||||||
|
|
||||||
}
|
}
|
||||||
dc.SelectObject (pOldPen);
|
dc.SelectObject (pOldPen);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Paint the actual status of the progress bar
|
// Paint the actual status of the progress bar
|
||||||
void ProgressBar::paintStatus (CDC& dc)
|
void ProgressBar::paintStatus (CDC& dc)
|
||||||
{
|
{
|
||||||
if (_progress <= 0)
|
if (_progress <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CBrush brshStatus;
|
CBrush brshStatus;
|
||||||
CRect rect (_bounds.left, _bounds.top,
|
CRect rect (_bounds.left, _bounds.top,
|
||||||
_bounds.left + _progressX, _bounds.bottom);
|
_bounds.left + _progressX, _bounds.bottom);
|
||||||
|
|
||||||
COLORREF statusColor = getStatusColor ();
|
COLORREF statusColor = getStatusColor ();
|
||||||
|
|
||||||
VERIFY (brshStatus.CreateSolidBrush (statusColor));
|
VERIFY (brshStatus.CreateSolidBrush (statusColor));
|
||||||
|
|
||||||
rect.DeflateRect (1, 1);
|
rect.DeflateRect (1, 1);
|
||||||
dc.FillRect (rect, &brshStatus);
|
dc.FillRect (rect, &brshStatus);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Paint the current step
|
// Paint the current step
|
||||||
void ProgressBar::paintStep (int startX, int endX)
|
void ProgressBar::paintStep (int startX, int endX)
|
||||||
{
|
{
|
||||||
// kludge: painting the whole region on each step
|
// kludge: painting the whole region on each step
|
||||||
_baseWindow->RedrawWindow (_bounds);
|
_baseWindow->RedrawWindow (_bounds);
|
||||||
_baseWindow->UpdateWindow ();
|
_baseWindow->UpdateWindow ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Setup the progress bar for execution over a total number of steps
|
// Setup the progress bar for execution over a total number of steps
|
||||||
void ProgressBar::start (int total)
|
void ProgressBar::start (int total)
|
||||||
{
|
{
|
||||||
_total = total;
|
_total = total;
|
||||||
reset ();
|
reset ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Take one step, indicating whether it was a successful step
|
// Take one step, indicating whether it was a successful step
|
||||||
void ProgressBar::step (bool successful)
|
void ProgressBar::step (bool successful)
|
||||||
{
|
{
|
||||||
_progress++;
|
_progress++;
|
||||||
|
|
||||||
int x = _progressX;
|
int x = _progressX;
|
||||||
|
|
||||||
_progressX = scale (_progress);
|
_progressX = scale (_progress);
|
||||||
|
|
||||||
if (!_error && !successful)
|
if (!_error && !successful)
|
||||||
{
|
{
|
||||||
_error = true;
|
_error = true;
|
||||||
x = 1;
|
x = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
paintStep (x, _progressX);
|
paintStep (x, _progressX);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Map from steps to display units
|
// Map from steps to display units
|
||||||
int ProgressBar::scale (int value)
|
int ProgressBar::scale (int value)
|
||||||
{
|
{
|
||||||
if (_total > 0)
|
if (_total > 0)
|
||||||
return max (1, value * (_bounds.Width () - 1) / _total);
|
return max (1, value * (_bounds.Width () - 1) / _total);
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Reset the progress bar
|
// Reset the progress bar
|
||||||
void ProgressBar::reset ()
|
void ProgressBar::reset ()
|
||||||
{
|
{
|
||||||
_progressX = 1;
|
_progressX = 1;
|
||||||
_progress = 0;
|
_progress = 0;
|
||||||
_error = false;
|
_error = false;
|
||||||
|
|
||||||
_baseWindow->RedrawWindow (_bounds);
|
_baseWindow->RedrawWindow (_bounds);
|
||||||
_baseWindow->UpdateWindow ();
|
_baseWindow->UpdateWindow ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|||||||
@@ -1,74 +1,74 @@
|
|||||||
//
|
//
|
||||||
// ProgressBar.h
|
// ProgressBar.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/ProgressBar.h#1 $
|
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/ProgressBar.h#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef ProgressBar_INCLUDED
|
#ifndef ProgressBar_INCLUDED
|
||||||
#define ProgressBar_INCLUDED
|
#define ProgressBar_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/CppUnit.h"
|
#include "CppUnit/CppUnit.h"
|
||||||
#include <afxwin.h>
|
#include <afxwin.h>
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
/* A Simple ProgressBar for test execution display
|
/* A Simple ProgressBar for test execution display
|
||||||
*/
|
*/
|
||||||
class ProgressBar
|
class ProgressBar
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ProgressBar(CWnd* baseWindow, CRect& bounds);
|
ProgressBar(CWnd* baseWindow, CRect& bounds);
|
||||||
|
|
||||||
void step(bool successful);
|
void step(bool successful);
|
||||||
void paint(CDC& dc);
|
void paint(CDC& dc);
|
||||||
int scale(int value);
|
int scale(int value);
|
||||||
void reset();
|
void reset();
|
||||||
void start(int total);
|
void start(int total);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void paintBackground(CDC& dc);
|
void paintBackground(CDC& dc);
|
||||||
void paintStatus(CDC& dc);
|
void paintStatus(CDC& dc);
|
||||||
COLORREF getStatusColor();
|
COLORREF getStatusColor();
|
||||||
void paintStep(int startX, int endX);
|
void paintStep(int startX, int endX);
|
||||||
|
|
||||||
CWnd* _baseWindow;
|
CWnd* _baseWindow;
|
||||||
CRect _bounds;
|
CRect _bounds;
|
||||||
|
|
||||||
bool _error;
|
bool _error;
|
||||||
int _total;
|
int _total;
|
||||||
int _progress;
|
int _progress;
|
||||||
int _progressX;
|
int _progressX;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Construct a ProgressBar
|
// Construct a ProgressBar
|
||||||
inline ProgressBar::ProgressBar(CWnd* baseWindow, CRect& bounds):
|
inline ProgressBar::ProgressBar(CWnd* baseWindow, CRect& bounds):
|
||||||
_baseWindow(baseWindow),
|
_baseWindow(baseWindow),
|
||||||
_bounds(bounds),
|
_bounds(bounds),
|
||||||
_error(false),
|
_error(false),
|
||||||
_total(0),
|
_total(0),
|
||||||
_progress(0),
|
_progress(0),
|
||||||
_progressX(0)
|
_progressX(0)
|
||||||
{
|
{
|
||||||
WINDOWINFO wi;
|
WINDOWINFO wi;
|
||||||
wi.cbSize = sizeof(WINDOWINFO);
|
wi.cbSize = sizeof(WINDOWINFO);
|
||||||
baseWindow->GetWindowInfo(&wi);
|
baseWindow->GetWindowInfo(&wi);
|
||||||
_bounds.OffsetRect(-wi.rcClient.left, -wi.rcClient.top);
|
_bounds.OffsetRect(-wi.rcClient.left, -wi.rcClient.top);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Get the current color
|
// Get the current color
|
||||||
inline COLORREF ProgressBar::getStatusColor()
|
inline COLORREF ProgressBar::getStatusColor()
|
||||||
{
|
{
|
||||||
return _error ? RGB(255, 0, 0) : RGB(0, 255, 0);
|
return _error ? RGB(255, 0, 0) : RGB(0, 255, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|
||||||
|
|
||||||
#endif // ProgressBar_INCLUDED
|
#endif // ProgressBar_INCLUDED
|
||||||
|
|||||||
@@ -1,106 +1,106 @@
|
|||||||
#ifndef SYNCHRONIZEDTESTRESULTDECORATOR_H
|
#ifndef SYNCHRONIZEDTESTRESULTDECORATOR_H
|
||||||
#define SYNCHRONIZEDTESTRESULTDECORATOR_H
|
#define SYNCHRONIZEDTESTRESULTDECORATOR_H
|
||||||
|
|
||||||
#include <afxmt.h>
|
#include <afxmt.h>
|
||||||
#include "TestResultDecorator.h"
|
#include "TestResultDecorator.h"
|
||||||
|
|
||||||
class SynchronizedTestResult : public TestResultDecorator
|
class SynchronizedTestResult : public TestResultDecorator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SynchronizedTestResult (TestResult *result);
|
SynchronizedTestResult (TestResult *result);
|
||||||
~SynchronizedTestResult ();
|
~SynchronizedTestResult ();
|
||||||
|
|
||||||
|
|
||||||
bool shouldStop ();
|
bool shouldStop ();
|
||||||
void addError (Test *test, CppUnitException *e);
|
void addError (Test *test, CppUnitException *e);
|
||||||
void addFailure (Test *test, CppUnitException *e);
|
void addFailure (Test *test, CppUnitException *e);
|
||||||
void startTest (Test *test);
|
void startTest (Test *test);
|
||||||
void endTest (Test *test);
|
void endTest (Test *test);
|
||||||
int runTests ();
|
int runTests ();
|
||||||
int testErrors ();
|
int testErrors ();
|
||||||
int testFailures ();
|
int testFailures ();
|
||||||
bool wasSuccessful ();
|
bool wasSuccessful ();
|
||||||
void stop ();
|
void stop ();
|
||||||
|
|
||||||
vector<TestFailure *>& errors ();
|
vector<TestFailure *>& errors ();
|
||||||
vector<TestFailure *>& failures ();
|
vector<TestFailure *>& failures ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CCriticalSection m_criticalSection;
|
CCriticalSection m_criticalSection;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
inline SynchronizedTestResult::SynchronizedTestResult (TestResult *result)
|
inline SynchronizedTestResult::SynchronizedTestResult (TestResult *result)
|
||||||
: TestResultDecorator (result) {}
|
: TestResultDecorator (result) {}
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
inline SynchronizedTestResult::~SynchronizedTestResult ()
|
inline SynchronizedTestResult::~SynchronizedTestResult ()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// Returns whether the test should stop
|
// Returns whether the test should stop
|
||||||
inline bool SynchronizedTestResult::shouldStop ()
|
inline bool SynchronizedTestResult::shouldStop ()
|
||||||
{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->shouldStop (); }
|
{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->shouldStop (); }
|
||||||
|
|
||||||
|
|
||||||
// Adds an error to the list of errors. The passed in exception
|
// Adds an error to the list of errors. The passed in exception
|
||||||
// caused the error
|
// caused the error
|
||||||
inline void SynchronizedTestResult::addError (Test *test, CppUnitException *e)
|
inline void SynchronizedTestResult::addError (Test *test, CppUnitException *e)
|
||||||
{ CSingleLock sync (&m_criticalSection, TRUE); m_result->addError (test, e); }
|
{ CSingleLock sync (&m_criticalSection, TRUE); m_result->addError (test, e); }
|
||||||
|
|
||||||
|
|
||||||
// Adds a failure to the list of failures. The passed in exception
|
// Adds a failure to the list of failures. The passed in exception
|
||||||
// caused the failure.
|
// caused the failure.
|
||||||
inline void SynchronizedTestResult::addFailure (Test *test, CppUnitException *e)
|
inline void SynchronizedTestResult::addFailure (Test *test, CppUnitException *e)
|
||||||
{ CSingleLock sync (&m_criticalSection, TRUE); m_result->addFailure (test, e); }
|
{ CSingleLock sync (&m_criticalSection, TRUE); m_result->addFailure (test, e); }
|
||||||
|
|
||||||
|
|
||||||
// Informs the result that a test will be started.
|
// Informs the result that a test will be started.
|
||||||
inline void SynchronizedTestResult::startTest (Test *test)
|
inline void SynchronizedTestResult::startTest (Test *test)
|
||||||
{ CSingleLock sync (&m_criticalSection, TRUE); m_result->startTest (test); }
|
{ CSingleLock sync (&m_criticalSection, TRUE); m_result->startTest (test); }
|
||||||
|
|
||||||
|
|
||||||
// Informs the result that a test was completed.
|
// Informs the result that a test was completed.
|
||||||
inline void SynchronizedTestResult::endTest (Test *test)
|
inline void SynchronizedTestResult::endTest (Test *test)
|
||||||
{ CSingleLock sync (&m_criticalSection, TRUE); m_result->endTest (test); }
|
{ CSingleLock sync (&m_criticalSection, TRUE); m_result->endTest (test); }
|
||||||
|
|
||||||
|
|
||||||
// Gets the number of run tests.
|
// Gets the number of run tests.
|
||||||
inline int SynchronizedTestResult::runTests ()
|
inline int SynchronizedTestResult::runTests ()
|
||||||
{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->runTests (); }
|
{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->runTests (); }
|
||||||
|
|
||||||
|
|
||||||
// Gets the number of detected errors.
|
// Gets the number of detected errors.
|
||||||
inline int SynchronizedTestResult::testErrors ()
|
inline int SynchronizedTestResult::testErrors ()
|
||||||
{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->testErrors (); }
|
{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->testErrors (); }
|
||||||
|
|
||||||
|
|
||||||
// Gets the number of detected failures.
|
// Gets the number of detected failures.
|
||||||
inline int SynchronizedTestResult::testFailures ()
|
inline int SynchronizedTestResult::testFailures ()
|
||||||
{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->testFailures (); }
|
{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->testFailures (); }
|
||||||
|
|
||||||
|
|
||||||
// Returns whether the entire test was successful or not.
|
// Returns whether the entire test was successful or not.
|
||||||
inline bool SynchronizedTestResult::wasSuccessful ()
|
inline bool SynchronizedTestResult::wasSuccessful ()
|
||||||
{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->wasSuccessful (); }
|
{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->wasSuccessful (); }
|
||||||
|
|
||||||
|
|
||||||
// Marks that the test run should stop.
|
// Marks that the test run should stop.
|
||||||
inline void SynchronizedTestResult::stop ()
|
inline void SynchronizedTestResult::stop ()
|
||||||
{ CSingleLock sync (&m_criticalSection, TRUE); m_result->stop (); }
|
{ CSingleLock sync (&m_criticalSection, TRUE); m_result->stop (); }
|
||||||
|
|
||||||
|
|
||||||
// Returns a vector of the errors.
|
// Returns a vector of the errors.
|
||||||
inline vector<TestFailure *>& SynchronizedTestResult::errors ()
|
inline vector<TestFailure *>& SynchronizedTestResult::errors ()
|
||||||
{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->errors (); }
|
{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->errors (); }
|
||||||
|
|
||||||
|
|
||||||
// Returns a vector of the failures.
|
// Returns a vector of the failures.
|
||||||
inline vector<TestFailure *>& SynchronizedTestResult::failures ()
|
inline vector<TestFailure *>& SynchronizedTestResult::failures ()
|
||||||
{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->failures (); }
|
{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->failures (); }
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,102 +1,102 @@
|
|||||||
#ifndef CPP_UNIT_TESTRESULTDECORATOR_H
|
#ifndef CPP_UNIT_TESTRESULTDECORATOR_H
|
||||||
#define CPP_UNIT_TESTRESULTDECORATOR_H
|
#define CPP_UNIT_TESTRESULTDECORATOR_H
|
||||||
|
|
||||||
#include "TestResult.h"
|
#include "TestResult.h"
|
||||||
|
|
||||||
class TestResultDecorator
|
class TestResultDecorator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TestResultDecorator (TestResult *result);
|
TestResultDecorator (TestResult *result);
|
||||||
virtual ~TestResultDecorator ();
|
virtual ~TestResultDecorator ();
|
||||||
|
|
||||||
|
|
||||||
virtual bool shouldStop ();
|
virtual bool shouldStop ();
|
||||||
virtual void addError (Test *test, CppUnitException *e);
|
virtual void addError (Test *test, CppUnitException *e);
|
||||||
virtual void addFailure (Test *test, CppUnitException *e);
|
virtual void addFailure (Test *test, CppUnitException *e);
|
||||||
virtual void startTest (Test *test);
|
virtual void startTest (Test *test);
|
||||||
virtual void endTest (Test *test);
|
virtual void endTest (Test *test);
|
||||||
virtual int runTests ();
|
virtual int runTests ();
|
||||||
virtual int testErrors ();
|
virtual int testErrors ();
|
||||||
virtual int testFailures ();
|
virtual int testFailures ();
|
||||||
virtual bool wasSuccessful ();
|
virtual bool wasSuccessful ();
|
||||||
virtual void stop ();
|
virtual void stop ();
|
||||||
|
|
||||||
vector<TestFailure *>& errors ();
|
vector<TestFailure *>& errors ();
|
||||||
vector<TestFailure *>& failures ();
|
vector<TestFailure *>& failures ();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
TestResult *m_result;
|
TestResult *m_result;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
inline TestResultDecorator::TestResultDecorator (TestResult *result)
|
inline TestResultDecorator::TestResultDecorator (TestResult *result)
|
||||||
: m_result (result) {}
|
: m_result (result) {}
|
||||||
|
|
||||||
inline TestResultDecorator::~TestResultDecorator ()
|
inline TestResultDecorator::~TestResultDecorator ()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// Returns whether the test should stop
|
// Returns whether the test should stop
|
||||||
inline bool TestResultDecorator::shouldStop ()
|
inline bool TestResultDecorator::shouldStop ()
|
||||||
{ return m_result->shouldStop (); }
|
{ return m_result->shouldStop (); }
|
||||||
|
|
||||||
|
|
||||||
// Adds an error to the list of errors. The passed in exception
|
// Adds an error to the list of errors. The passed in exception
|
||||||
// caused the error
|
// caused the error
|
||||||
inline void TestResultDecorator::addError (Test *test, CppUnitException *e)
|
inline void TestResultDecorator::addError (Test *test, CppUnitException *e)
|
||||||
{ m_result->addError (test, e); }
|
{ m_result->addError (test, e); }
|
||||||
|
|
||||||
|
|
||||||
// Adds a failure to the list of failures. The passed in exception
|
// Adds a failure to the list of failures. The passed in exception
|
||||||
// caused the failure.
|
// caused the failure.
|
||||||
inline void TestResultDecorator::addFailure (Test *test, CppUnitException *e)
|
inline void TestResultDecorator::addFailure (Test *test, CppUnitException *e)
|
||||||
{ m_result->addFailure (test, e); }
|
{ m_result->addFailure (test, e); }
|
||||||
|
|
||||||
|
|
||||||
// Informs the result that a test will be started.
|
// Informs the result that a test will be started.
|
||||||
inline void TestResultDecorator::startTest (Test *test)
|
inline void TestResultDecorator::startTest (Test *test)
|
||||||
{ m_result->startTest (test); }
|
{ m_result->startTest (test); }
|
||||||
|
|
||||||
|
|
||||||
// Informs the result that a test was completed.
|
// Informs the result that a test was completed.
|
||||||
inline void TestResultDecorator::endTest (Test *test)
|
inline void TestResultDecorator::endTest (Test *test)
|
||||||
{ m_result->endTest (test); }
|
{ m_result->endTest (test); }
|
||||||
|
|
||||||
|
|
||||||
// Gets the number of run tests.
|
// Gets the number of run tests.
|
||||||
inline int TestResultDecorator::runTests ()
|
inline int TestResultDecorator::runTests ()
|
||||||
{ return m_result->runTests (); }
|
{ return m_result->runTests (); }
|
||||||
|
|
||||||
|
|
||||||
// Gets the number of detected errors.
|
// Gets the number of detected errors.
|
||||||
inline int TestResultDecorator::testErrors ()
|
inline int TestResultDecorator::testErrors ()
|
||||||
{ return m_result->testErrors (); }
|
{ return m_result->testErrors (); }
|
||||||
|
|
||||||
|
|
||||||
// Gets the number of detected failures.
|
// Gets the number of detected failures.
|
||||||
inline int TestResultDecorator::testFailures ()
|
inline int TestResultDecorator::testFailures ()
|
||||||
{ return m_result->testFailures (); }
|
{ return m_result->testFailures (); }
|
||||||
|
|
||||||
|
|
||||||
// Returns whether the entire test was successful or not.
|
// Returns whether the entire test was successful or not.
|
||||||
inline bool TestResultDecorator::wasSuccessful ()
|
inline bool TestResultDecorator::wasSuccessful ()
|
||||||
{ return m_result->wasSuccessful (); }
|
{ return m_result->wasSuccessful (); }
|
||||||
|
|
||||||
|
|
||||||
// Marks that the test run should stop.
|
// Marks that the test run should stop.
|
||||||
inline void TestResultDecorator::stop ()
|
inline void TestResultDecorator::stop ()
|
||||||
{ m_result->stop (); }
|
{ m_result->stop (); }
|
||||||
|
|
||||||
|
|
||||||
// Returns a vector of the errors.
|
// Returns a vector of the errors.
|
||||||
inline vector<TestFailure *>& TestResultDecorator::errors ()
|
inline vector<TestFailure *>& TestResultDecorator::errors ()
|
||||||
{ return m_result->errors (); }
|
{ return m_result->errors (); }
|
||||||
|
|
||||||
|
|
||||||
// Returns a vector of the failures.
|
// Returns a vector of the failures.
|
||||||
inline vector<TestFailure *>& TestResultDecorator::failures ()
|
inline vector<TestFailure *>& TestResultDecorator::failures ()
|
||||||
{ return m_result->failures (); }
|
{ return m_result->failures (); }
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,424 +1,424 @@
|
|||||||
//
|
//
|
||||||
// TestRunnerDlg.cpp
|
// TestRunnerDlg.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/TestRunnerDlg.cpp#1 $
|
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/TestRunnerDlg.cpp#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#include <afxwin.h>
|
#include <afxwin.h>
|
||||||
#include <afxext.h>
|
#include <afxext.h>
|
||||||
#include <afxcmn.h>
|
#include <afxcmn.h>
|
||||||
#include <mmsystem.h>
|
#include <mmsystem.h>
|
||||||
#include "TestRunnerDlg.h"
|
#include "TestRunnerDlg.h"
|
||||||
#include "ActiveTest.h"
|
#include "ActiveTest.h"
|
||||||
#include "GUITestResult.h"
|
#include "GUITestResult.h"
|
||||||
#include "ProgressBar.h"
|
#include "ProgressBar.h"
|
||||||
#include "CppUnit/TestSuite.h"
|
#include "CppUnit/TestSuite.h"
|
||||||
#include "TestRunnerDlg.h"
|
#include "TestRunnerDlg.h"
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
TestRunnerDlg::TestRunnerDlg(CWnd* pParent): CDialog(TestRunnerDlg::IDD, pParent)
|
TestRunnerDlg::TestRunnerDlg(CWnd* pParent): CDialog(TestRunnerDlg::IDD, pParent)
|
||||||
{
|
{
|
||||||
//{{AFX_DATA_INIT(TestRunnerDlg)
|
//{{AFX_DATA_INIT(TestRunnerDlg)
|
||||||
// NOTE: the ClassWizard will add member initialization here
|
// NOTE: the ClassWizard will add member initialization here
|
||||||
//}}AFX_DATA_INIT
|
//}}AFX_DATA_INIT
|
||||||
|
|
||||||
_testsProgress = 0;
|
_testsProgress = 0;
|
||||||
_selectedTest = 0;
|
_selectedTest = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunnerDlg::DoDataExchange(CDataExchange* pDX)
|
void TestRunnerDlg::DoDataExchange(CDataExchange* pDX)
|
||||||
{
|
{
|
||||||
CDialog::DoDataExchange(pDX);
|
CDialog::DoDataExchange(pDX);
|
||||||
//{{AFX_DATA_MAP(TestRunnerDlg)
|
//{{AFX_DATA_MAP(TestRunnerDlg)
|
||||||
// NOTE: the ClassWizard will add DDX and DDV calls here
|
// NOTE: the ClassWizard will add DDX and DDV calls here
|
||||||
//}}AFX_DATA_MAP
|
//}}AFX_DATA_MAP
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BEGIN_MESSAGE_MAP(TestRunnerDlg, CDialog)
|
BEGIN_MESSAGE_MAP(TestRunnerDlg, CDialog)
|
||||||
//{{AFX_MSG_MAP(TestRunnerDlg)
|
//{{AFX_MSG_MAP(TestRunnerDlg)
|
||||||
ON_BN_CLICKED(ID_RUN, OnRun)
|
ON_BN_CLICKED(ID_RUN, OnRun)
|
||||||
ON_BN_CLICKED(ID_STOP, OnStop)
|
ON_BN_CLICKED(ID_STOP, OnStop)
|
||||||
ON_CBN_SELCHANGE(IDC_COMBO_TEST, OnSelchangeComboTest)
|
ON_CBN_SELCHANGE(IDC_COMBO_TEST, OnSelchangeComboTest)
|
||||||
ON_BN_CLICKED(IDC_CHK_AUTORUN, OnBnClickedAutorun)
|
ON_BN_CLICKED(IDC_CHK_AUTORUN, OnBnClickedAutorun)
|
||||||
ON_WM_PAINT()
|
ON_WM_PAINT()
|
||||||
//}}AFX_MSG_MAP
|
//}}AFX_MSG_MAP
|
||||||
END_MESSAGE_MAP()
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
|
||||||
BOOL TestRunnerDlg::OnInitDialog()
|
BOOL TestRunnerDlg::OnInitDialog()
|
||||||
{
|
{
|
||||||
CDialog::OnInitDialog();
|
CDialog::OnInitDialog();
|
||||||
|
|
||||||
CListCtrl *listCtrl = (CListCtrl *)GetDlgItem (IDC_LIST);
|
CListCtrl *listCtrl = (CListCtrl *)GetDlgItem (IDC_LIST);
|
||||||
CComboBox *comboBox = (CComboBox *)GetDlgItem (IDC_COMBO_TEST);
|
CComboBox *comboBox = (CComboBox *)GetDlgItem (IDC_COMBO_TEST);
|
||||||
|
|
||||||
ASSERT (listCtrl);
|
ASSERT (listCtrl);
|
||||||
ASSERT (comboBox);
|
ASSERT (comboBox);
|
||||||
|
|
||||||
CString title;
|
CString title;
|
||||||
GetWindowText(title);
|
GetWindowText(title);
|
||||||
#if defined(_DEBUG)
|
#if defined(_DEBUG)
|
||||||
title.Append(" [debug]");
|
title.Append(" [debug]");
|
||||||
#else
|
#else
|
||||||
title.Append(" [release]");
|
title.Append(" [release]");
|
||||||
#endif
|
#endif
|
||||||
SetWindowText(title);
|
SetWindowText(title);
|
||||||
|
|
||||||
listCtrl->InsertColumn (0,"Type", LVCFMT_LEFT, 16 + listCtrl->GetStringWidth ("Type"), 1);
|
listCtrl->InsertColumn (0,"Type", LVCFMT_LEFT, 16 + listCtrl->GetStringWidth ("Type"), 1);
|
||||||
listCtrl->InsertColumn (1,"Name", LVCFMT_LEFT, 16 * listCtrl->GetStringWidth ("X"), 2);
|
listCtrl->InsertColumn (1,"Name", LVCFMT_LEFT, 16 * listCtrl->GetStringWidth ("X"), 2);
|
||||||
listCtrl->InsertColumn (2,"Failed Condition", LVCFMT_LEFT, 24 * listCtrl->GetStringWidth ("M"), 3);
|
listCtrl->InsertColumn (2,"Failed Condition", LVCFMT_LEFT, 24 * listCtrl->GetStringWidth ("M"), 3);
|
||||||
listCtrl->InsertColumn (3,"Line", LVCFMT_LEFT, 16 + listCtrl->GetStringWidth ("0000"), 4);
|
listCtrl->InsertColumn (3,"Line", LVCFMT_LEFT, 16 + listCtrl->GetStringWidth ("0000"), 4);
|
||||||
listCtrl->InsertColumn (4,"File Name", LVCFMT_LEFT, 36 * listCtrl->GetStringWidth ("M"), 5);
|
listCtrl->InsertColumn (4,"File Name", LVCFMT_LEFT, 36 * listCtrl->GetStringWidth ("M"), 5);
|
||||||
|
|
||||||
int numberOfCases = 0;
|
int numberOfCases = 0;
|
||||||
|
|
||||||
CWinApp* pApp = AfxGetApp();
|
CWinApp* pApp = AfxGetApp();
|
||||||
CString lastTestCS = pApp->GetProfileString("Tests", "lastTest");
|
CString lastTestCS = pApp->GetProfileString("Tests", "lastTest");
|
||||||
std::string lastTest((LPCSTR) lastTestCS);
|
std::string lastTest((LPCSTR) lastTestCS);
|
||||||
int sel = -1;
|
int sel = -1;
|
||||||
for (std::vector<TestInfo>::iterator it = _tests.begin (); it != _tests.end (); ++it)
|
for (std::vector<TestInfo>::iterator it = _tests.begin (); it != _tests.end (); ++it)
|
||||||
{
|
{
|
||||||
std::string cbName(it->level*4, ' ');
|
std::string cbName(it->level*4, ' ');
|
||||||
cbName.append(it->pTest->toString());
|
cbName.append(it->pTest->toString());
|
||||||
comboBox->AddString (cbName.c_str ());
|
comboBox->AddString (cbName.c_str ());
|
||||||
if (sel < 0)
|
if (sel < 0)
|
||||||
{
|
{
|
||||||
if (lastTest.empty() || lastTest == it->pTest->toString())
|
if (lastTest.empty() || lastTest == it->pTest->toString())
|
||||||
{
|
{
|
||||||
_selectedTest = it->pTest;
|
_selectedTest = it->pTest;
|
||||||
sel = numberOfCases;
|
sel = numberOfCases;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
numberOfCases++;
|
numberOfCases++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numberOfCases > 0)
|
if (numberOfCases > 0)
|
||||||
{
|
{
|
||||||
if (sel < 0)
|
if (sel < 0)
|
||||||
{
|
{
|
||||||
_selectedTest = _tests[0].pTest;
|
_selectedTest = _tests[0].pTest;
|
||||||
sel = 0;
|
sel = 0;
|
||||||
}
|
}
|
||||||
comboBox->SetCurSel (sel);
|
comboBox->SetCurSel (sel);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
beRunDisabled ();
|
beRunDisabled ();
|
||||||
}
|
}
|
||||||
CWnd *pProgress = GetDlgItem(IDC_PROGRESS);
|
CWnd *pProgress = GetDlgItem(IDC_PROGRESS);
|
||||||
CRect rect;
|
CRect rect;
|
||||||
pProgress->GetWindowRect(&rect);
|
pProgress->GetWindowRect(&rect);
|
||||||
_testsProgress = new ProgressBar (this, rect);
|
_testsProgress = new ProgressBar (this, rect);
|
||||||
|
|
||||||
CButton* autoRunBtn = (CButton*) GetDlgItem(IDC_CHK_AUTORUN);
|
CButton* autoRunBtn = (CButton*) GetDlgItem(IDC_CHK_AUTORUN);
|
||||||
autoRunBtn->SetCheck(pApp->GetProfileInt("Tests", "autoRun", BST_UNCHECKED));
|
autoRunBtn->SetCheck(pApp->GetProfileInt("Tests", "autoRun", BST_UNCHECKED));
|
||||||
|
|
||||||
reset ();
|
reset ();
|
||||||
|
|
||||||
if (autoRunBtn->GetCheck() == BST_CHECKED)
|
if (autoRunBtn->GetCheck() == BST_CHECKED)
|
||||||
{
|
{
|
||||||
OnRun();
|
OnRun();
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE; // return TRUE unless you set the focus to a control
|
return TRUE; // return TRUE unless you set the focus to a control
|
||||||
// EXCEPTION: OCX Property Pages should return FALSE
|
// EXCEPTION: OCX Property Pages should return FALSE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TestRunnerDlg::~TestRunnerDlg ()
|
TestRunnerDlg::~TestRunnerDlg ()
|
||||||
{
|
{
|
||||||
freeState ();
|
freeState ();
|
||||||
delete _testsProgress;
|
delete _testsProgress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunnerDlg::OnRun()
|
void TestRunnerDlg::OnRun()
|
||||||
{
|
{
|
||||||
if (_selectedTest == 0)
|
if (_selectedTest == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
freeState ();
|
freeState ();
|
||||||
reset ();
|
reset ();
|
||||||
|
|
||||||
beRunning ();
|
beRunning ();
|
||||||
|
|
||||||
int numberOfTests = _selectedTest->countTestCases ();
|
int numberOfTests = _selectedTest->countTestCases ();
|
||||||
|
|
||||||
_testsProgress->start (numberOfTests);
|
_testsProgress->start (numberOfTests);
|
||||||
|
|
||||||
_result = new GUITestResult ((TestRunnerDlg *)this);
|
_result = new GUITestResult ((TestRunnerDlg *)this);
|
||||||
_activeTest = new ActiveTest (_selectedTest);
|
_activeTest = new ActiveTest (_selectedTest);
|
||||||
|
|
||||||
_testStartTime = timeGetTime ();
|
_testStartTime = timeGetTime ();
|
||||||
|
|
||||||
_activeTest->run (_result);
|
_activeTest->run (_result);
|
||||||
|
|
||||||
_testEndTime = timeGetTime ();
|
_testEndTime = timeGetTime ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunnerDlg::addListEntry(const std::string& type, TestResult *result, Test *test, CppUnitException *e)
|
void TestRunnerDlg::addListEntry(const std::string& type, TestResult *result, Test *test, CppUnitException *e)
|
||||||
{
|
{
|
||||||
char stage [80];
|
char stage [80];
|
||||||
LV_ITEM lvi;
|
LV_ITEM lvi;
|
||||||
CListCtrl *listCtrl = (CListCtrl *)GetDlgItem (IDC_LIST);
|
CListCtrl *listCtrl = (CListCtrl *)GetDlgItem (IDC_LIST);
|
||||||
int currentEntry = result->testErrors () + result->testFailures () -1;
|
int currentEntry = result->testErrors () + result->testFailures () -1;
|
||||||
|
|
||||||
sprintf (stage, "%s", type.c_str ());
|
sprintf (stage, "%s", type.c_str ());
|
||||||
|
|
||||||
lvi.mask = LVIF_TEXT;
|
lvi.mask = LVIF_TEXT;
|
||||||
lvi.iItem = currentEntry;
|
lvi.iItem = currentEntry;
|
||||||
lvi.iSubItem = 0;
|
lvi.iSubItem = 0;
|
||||||
lvi.pszText = stage;
|
lvi.pszText = stage;
|
||||||
lvi.iImage = 0;
|
lvi.iImage = 0;
|
||||||
lvi.stateMask = 0;
|
lvi.stateMask = 0;
|
||||||
lvi.state = 0;
|
lvi.state = 0;
|
||||||
|
|
||||||
listCtrl->InsertItem (&lvi);
|
listCtrl->InsertItem (&lvi);
|
||||||
|
|
||||||
// Set class string
|
// Set class string
|
||||||
listCtrl->SetItemText (currentEntry, 1, test->toString ().c_str ());
|
listCtrl->SetItemText (currentEntry, 1, test->toString ().c_str ());
|
||||||
|
|
||||||
// Set the asserted text
|
// Set the asserted text
|
||||||
listCtrl->SetItemText(currentEntry, 2, e->what ());
|
listCtrl->SetItemText(currentEntry, 2, e->what ());
|
||||||
|
|
||||||
// Set the line number
|
// Set the line number
|
||||||
if (e->lineNumber () == CppUnitException::CPPUNIT_UNKNOWNLINENUMBER)
|
if (e->lineNumber () == CppUnitException::CPPUNIT_UNKNOWNLINENUMBER)
|
||||||
sprintf (stage, "<unknown>");
|
sprintf (stage, "<unknown>");
|
||||||
else
|
else
|
||||||
sprintf (stage, "%ld", e->lineNumber ());
|
sprintf (stage, "%ld", e->lineNumber ());
|
||||||
|
|
||||||
listCtrl->SetItemText(currentEntry, 3, stage);
|
listCtrl->SetItemText(currentEntry, 3, stage);
|
||||||
|
|
||||||
// Set the file name
|
// Set the file name
|
||||||
listCtrl->SetItemText(currentEntry, 4, e->fileName ().c_str ());
|
listCtrl->SetItemText(currentEntry, 4, e->fileName ().c_str ());
|
||||||
|
|
||||||
listCtrl->RedrawItems (currentEntry, currentEntry);
|
listCtrl->RedrawItems (currentEntry, currentEntry);
|
||||||
listCtrl->UpdateWindow ();
|
listCtrl->UpdateWindow ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunnerDlg::addError (TestResult *result, Test *test, CppUnitException *e)
|
void TestRunnerDlg::addError (TestResult *result, Test *test, CppUnitException *e)
|
||||||
{
|
{
|
||||||
addListEntry ("Error", result, test, e);
|
addListEntry ("Error", result, test, e);
|
||||||
_errors++;
|
_errors++;
|
||||||
|
|
||||||
updateCountsDisplay ();
|
updateCountsDisplay ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunnerDlg::addFailure (TestResult *result, Test *test, CppUnitException *e)
|
void TestRunnerDlg::addFailure (TestResult *result, Test *test, CppUnitException *e)
|
||||||
{
|
{
|
||||||
addListEntry ("Failure", result, test, e);
|
addListEntry ("Failure", result, test, e);
|
||||||
_failures++;
|
_failures++;
|
||||||
|
|
||||||
updateCountsDisplay ();
|
updateCountsDisplay ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunnerDlg::endTest (TestResult *result, Test *test)
|
void TestRunnerDlg::endTest (TestResult *result, Test *test)
|
||||||
{
|
{
|
||||||
if (_selectedTest == 0)
|
if (_selectedTest == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_testsRun++;
|
_testsRun++;
|
||||||
updateCountsDisplay ();
|
updateCountsDisplay ();
|
||||||
_testsProgress->step (_failures == 0 && _errors == 0);
|
_testsProgress->step (_failures == 0 && _errors == 0);
|
||||||
|
|
||||||
_testEndTime = timeGetTime ();
|
_testEndTime = timeGetTime ();
|
||||||
|
|
||||||
updateCountsDisplay ();
|
updateCountsDisplay ();
|
||||||
|
|
||||||
if (_testsRun >= _selectedTest->countTestCases ())
|
if (_testsRun >= _selectedTest->countTestCases ())
|
||||||
beIdle ();
|
beIdle ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunnerDlg::beRunning ()
|
void TestRunnerDlg::beRunning ()
|
||||||
{
|
{
|
||||||
CButton *runButton = (CButton *)GetDlgItem (ID_RUN);
|
CButton *runButton = (CButton *)GetDlgItem (ID_RUN);
|
||||||
CButton *closeButton = (CButton *)GetDlgItem (IDOK);
|
CButton *closeButton = (CButton *)GetDlgItem (IDOK);
|
||||||
|
|
||||||
runButton->EnableWindow (FALSE);
|
runButton->EnableWindow (FALSE);
|
||||||
closeButton->EnableWindow (FALSE);
|
closeButton->EnableWindow (FALSE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunnerDlg::beIdle ()
|
void TestRunnerDlg::beIdle ()
|
||||||
{
|
{
|
||||||
CButton *runButton = (CButton *)GetDlgItem (ID_RUN);
|
CButton *runButton = (CButton *)GetDlgItem (ID_RUN);
|
||||||
CButton *closeButton = (CButton *)GetDlgItem (IDOK);
|
CButton *closeButton = (CButton *)GetDlgItem (IDOK);
|
||||||
|
|
||||||
runButton->EnableWindow (TRUE);
|
runButton->EnableWindow (TRUE);
|
||||||
closeButton->EnableWindow (TRUE);
|
closeButton->EnableWindow (TRUE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunnerDlg::beRunDisabled ()
|
void TestRunnerDlg::beRunDisabled ()
|
||||||
{
|
{
|
||||||
CButton *runButton = (CButton *)GetDlgItem (ID_RUN);
|
CButton *runButton = (CButton *)GetDlgItem (ID_RUN);
|
||||||
CButton *closeButton = (CButton *)GetDlgItem (IDOK);
|
CButton *closeButton = (CButton *)GetDlgItem (IDOK);
|
||||||
CButton *stopButton = (CButton *)GetDlgItem (ID_STOP);
|
CButton *stopButton = (CButton *)GetDlgItem (ID_STOP);
|
||||||
|
|
||||||
runButton->EnableWindow (FALSE);
|
runButton->EnableWindow (FALSE);
|
||||||
stopButton->EnableWindow (FALSE);
|
stopButton->EnableWindow (FALSE);
|
||||||
closeButton->EnableWindow (TRUE);
|
closeButton->EnableWindow (TRUE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunnerDlg::freeState ()
|
void TestRunnerDlg::freeState ()
|
||||||
{
|
{
|
||||||
delete _activeTest;
|
delete _activeTest;
|
||||||
delete _result;
|
delete _result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunnerDlg::reset ()
|
void TestRunnerDlg::reset ()
|
||||||
{
|
{
|
||||||
_testsRun = 0;
|
_testsRun = 0;
|
||||||
_errors = 0;
|
_errors = 0;
|
||||||
_failures = 0;
|
_failures = 0;
|
||||||
_testEndTime = _testStartTime;
|
_testEndTime = _testStartTime;
|
||||||
|
|
||||||
updateCountsDisplay ();
|
updateCountsDisplay ();
|
||||||
|
|
||||||
_activeTest = 0;
|
_activeTest = 0;
|
||||||
_result = 0;
|
_result = 0;
|
||||||
|
|
||||||
CListCtrl *listCtrl = (CListCtrl *)GetDlgItem (IDC_LIST);
|
CListCtrl *listCtrl = (CListCtrl *)GetDlgItem (IDC_LIST);
|
||||||
|
|
||||||
listCtrl->DeleteAllItems ();
|
listCtrl->DeleteAllItems ();
|
||||||
_testsProgress->reset ();
|
_testsProgress->reset ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunnerDlg::updateCountsDisplay ()
|
void TestRunnerDlg::updateCountsDisplay ()
|
||||||
{
|
{
|
||||||
CStatic *statTestsRun = (CStatic *)GetDlgItem (IDC_STATIC_RUNS);
|
CStatic *statTestsRun = (CStatic *)GetDlgItem (IDC_STATIC_RUNS);
|
||||||
CStatic *statErrors = (CStatic *)GetDlgItem (IDC_STATIC_ERRORS);
|
CStatic *statErrors = (CStatic *)GetDlgItem (IDC_STATIC_ERRORS);
|
||||||
CStatic *statFailures = (CStatic *)GetDlgItem (IDC_STATIC_FAILURES);
|
CStatic *statFailures = (CStatic *)GetDlgItem (IDC_STATIC_FAILURES);
|
||||||
CEdit *editTime = (CEdit *)GetDlgItem (IDC_EDIT_TIME);
|
CEdit *editTime = (CEdit *)GetDlgItem (IDC_EDIT_TIME);
|
||||||
|
|
||||||
CString argumentString;
|
CString argumentString;
|
||||||
|
|
||||||
argumentString.Format ("%d", _testsRun);
|
argumentString.Format ("%d", _testsRun);
|
||||||
statTestsRun ->SetWindowText (argumentString);
|
statTestsRun ->SetWindowText (argumentString);
|
||||||
|
|
||||||
argumentString.Format ("%d", _errors);
|
argumentString.Format ("%d", _errors);
|
||||||
statErrors ->SetWindowText (argumentString);
|
statErrors ->SetWindowText (argumentString);
|
||||||
|
|
||||||
argumentString.Format ("%d", _failures);
|
argumentString.Format ("%d", _failures);
|
||||||
statFailures ->SetWindowText (argumentString);
|
statFailures ->SetWindowText (argumentString);
|
||||||
|
|
||||||
argumentString.Format ("Execution time: %3.3lf seconds", (_testEndTime - _testStartTime) / 1000.0);
|
argumentString.Format ("Execution time: %3.3lf seconds", (_testEndTime - _testStartTime) / 1000.0);
|
||||||
editTime ->SetWindowText (argumentString);
|
editTime ->SetWindowText (argumentString);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunnerDlg::OnStop()
|
void TestRunnerDlg::OnStop()
|
||||||
{
|
{
|
||||||
if (_result)
|
if (_result)
|
||||||
_result->stop ();
|
_result->stop ();
|
||||||
|
|
||||||
beIdle ();
|
beIdle ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunnerDlg::OnOK()
|
void TestRunnerDlg::OnOK()
|
||||||
{
|
{
|
||||||
if (_result)
|
if (_result)
|
||||||
_result->stop ();
|
_result->stop ();
|
||||||
|
|
||||||
CDialog::OnOK ();
|
CDialog::OnOK ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunnerDlg::OnSelchangeComboTest()
|
void TestRunnerDlg::OnSelchangeComboTest()
|
||||||
{
|
{
|
||||||
CComboBox *testsSelection = (CComboBox *)GetDlgItem (IDC_COMBO_TEST);
|
CComboBox *testsSelection = (CComboBox *)GetDlgItem (IDC_COMBO_TEST);
|
||||||
|
|
||||||
int currentSelection = testsSelection->GetCurSel ();
|
int currentSelection = testsSelection->GetCurSel ();
|
||||||
|
|
||||||
if (currentSelection >= 0 && currentSelection < _tests.size ())
|
if (currentSelection >= 0 && currentSelection < _tests.size ())
|
||||||
{
|
{
|
||||||
_selectedTest = (_tests.begin () + currentSelection)->pTest;
|
_selectedTest = (_tests.begin () + currentSelection)->pTest;
|
||||||
beIdle ();
|
beIdle ();
|
||||||
CWinApp* pApp = AfxGetApp();
|
CWinApp* pApp = AfxGetApp();
|
||||||
pApp->WriteProfileString("Tests", "lastTest", _selectedTest->toString().c_str());
|
pApp->WriteProfileString("Tests", "lastTest", _selectedTest->toString().c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_selectedTest = 0;
|
_selectedTest = 0;
|
||||||
beRunDisabled ();
|
beRunDisabled ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
freeState ();
|
freeState ();
|
||||||
reset ();
|
reset ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunnerDlg::OnBnClickedAutorun()
|
void TestRunnerDlg::OnBnClickedAutorun()
|
||||||
{
|
{
|
||||||
CButton *autoRunBtn = (CButton *)GetDlgItem (IDC_CHK_AUTORUN);
|
CButton *autoRunBtn = (CButton *)GetDlgItem (IDC_CHK_AUTORUN);
|
||||||
CWinApp* pApp = AfxGetApp();
|
CWinApp* pApp = AfxGetApp();
|
||||||
pApp->WriteProfileInt("Tests", "autoRun", autoRunBtn->GetCheck());
|
pApp->WriteProfileInt("Tests", "autoRun", autoRunBtn->GetCheck());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunnerDlg::OnPaint()
|
void TestRunnerDlg::OnPaint()
|
||||||
{
|
{
|
||||||
CPaintDC dc (this);
|
CPaintDC dc (this);
|
||||||
|
|
||||||
_testsProgress->paint (dc);
|
_testsProgress->paint (dc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunnerDlg::setTests(const std::vector<Test*>& tests)
|
void TestRunnerDlg::setTests(const std::vector<Test*>& tests)
|
||||||
{
|
{
|
||||||
_tests.clear();
|
_tests.clear();
|
||||||
for (std::vector<Test*>::const_iterator it = tests.begin(); it != tests.end(); ++it)
|
for (std::vector<Test*>::const_iterator it = tests.begin(); it != tests.end(); ++it)
|
||||||
{
|
{
|
||||||
addTest(*it, 0);
|
addTest(*it, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunnerDlg::addTest(Test* pTest, int level)
|
void TestRunnerDlg::addTest(Test* pTest, int level)
|
||||||
{
|
{
|
||||||
TestInfo ti;
|
TestInfo ti;
|
||||||
ti.pTest = pTest;
|
ti.pTest = pTest;
|
||||||
ti.level = level;
|
ti.level = level;
|
||||||
_tests.push_back(ti);
|
_tests.push_back(ti);
|
||||||
TestSuite* pSuite = dynamic_cast<TestSuite*>(pTest);
|
TestSuite* pSuite = dynamic_cast<TestSuite*>(pTest);
|
||||||
if (pSuite)
|
if (pSuite)
|
||||||
{
|
{
|
||||||
const std::vector<Test*>& tests = pSuite->tests();
|
const std::vector<Test*>& tests = pSuite->tests();
|
||||||
for (std::vector<Test*>::const_iterator it = tests.begin(); it != tests.end(); ++it)
|
for (std::vector<Test*>::const_iterator it = tests.begin(); it != tests.end(); ++it)
|
||||||
{
|
{
|
||||||
addTest(*it, level + 1);
|
addTest(*it, level + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|||||||
@@ -1,92 +1,92 @@
|
|||||||
//
|
//
|
||||||
// TestRunnerDlg.h
|
// TestRunnerDlg.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/TestRunnerDlg.h#1 $
|
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/TestRunnerDlg.h#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef TestRunnerDlg_INCLUDED
|
#ifndef TestRunnerDlg_INCLUDED
|
||||||
#define TestRunnerDlg_INCLUDED
|
#define TestRunnerDlg_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/CppUnit.h"
|
#include "CppUnit/CppUnit.h"
|
||||||
#include "CppUnit/CppUnitException.h"
|
#include "CppUnit/CppUnitException.h"
|
||||||
#include "ActiveTest.h"
|
#include "ActiveTest.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "../res/Resource.h"
|
#include "../res/Resource.h"
|
||||||
#include <afxwin.h>
|
#include <afxwin.h>
|
||||||
#include "afxwin.h"
|
#include "afxwin.h"
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
class ProgressBar;
|
class ProgressBar;
|
||||||
|
|
||||||
|
|
||||||
class TestRunnerDlg: public CDialog
|
class TestRunnerDlg: public CDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TestRunnerDlg(CWnd* pParent = NULL);
|
TestRunnerDlg(CWnd* pParent = NULL);
|
||||||
~TestRunnerDlg();
|
~TestRunnerDlg();
|
||||||
|
|
||||||
void setTests(const std::vector<Test*>& tests);
|
void setTests(const std::vector<Test*>& tests);
|
||||||
|
|
||||||
void addError(TestResult* result, Test* test, CppUnitException* e);
|
void addError(TestResult* result, Test* test, CppUnitException* e);
|
||||||
void addFailure(TestResult* result, Test* test, CppUnitException* e);
|
void addFailure(TestResult* result, Test* test, CppUnitException* e);
|
||||||
void endTest(TestResult* result, Test* test);
|
void endTest(TestResult* result, Test* test);
|
||||||
|
|
||||||
//{{AFX_DATA(TestRunnerDlg)
|
//{{AFX_DATA(TestRunnerDlg)
|
||||||
enum { IDD = IDD_DIALOG_TESTRUNNER };
|
enum { IDD = IDD_DIALOG_TESTRUNNER };
|
||||||
// NOTE: the ClassWizard will add data members here
|
// NOTE: the ClassWizard will add data members here
|
||||||
//}}AFX_DATA
|
//}}AFX_DATA
|
||||||
|
|
||||||
//{{AFX_VIRTUAL(TestRunnerDlg)
|
//{{AFX_VIRTUAL(TestRunnerDlg)
|
||||||
protected:
|
protected:
|
||||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||||
//}}AFX_VIRTUAL
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//{{AFX_MSG(TestRunnerDlg)
|
//{{AFX_MSG(TestRunnerDlg)
|
||||||
virtual BOOL OnInitDialog();
|
virtual BOOL OnInitDialog();
|
||||||
afx_msg void OnRun();
|
afx_msg void OnRun();
|
||||||
afx_msg void OnStop();
|
afx_msg void OnStop();
|
||||||
virtual void OnOK();
|
virtual void OnOK();
|
||||||
afx_msg void OnSelchangeComboTest();
|
afx_msg void OnSelchangeComboTest();
|
||||||
afx_msg void OnBnClickedAutorun();
|
afx_msg void OnBnClickedAutorun();
|
||||||
afx_msg void OnPaint();
|
afx_msg void OnPaint();
|
||||||
//}}AFX_MSG
|
//}}AFX_MSG
|
||||||
DECLARE_MESSAGE_MAP()
|
DECLARE_MESSAGE_MAP()
|
||||||
|
|
||||||
void addListEntry(const std::string& type, TestResult* result, Test* test, CppUnitException* e);
|
void addListEntry(const std::string& type, TestResult* result, Test* test, CppUnitException* e);
|
||||||
void beIdle();
|
void beIdle();
|
||||||
void beRunning();
|
void beRunning();
|
||||||
void beRunDisabled();
|
void beRunDisabled();
|
||||||
void reset();
|
void reset();
|
||||||
void freeState();
|
void freeState();
|
||||||
void updateCountsDisplay();
|
void updateCountsDisplay();
|
||||||
void addTest(Test* pTest, int level);
|
void addTest(Test* pTest, int level);
|
||||||
|
|
||||||
struct TestInfo
|
struct TestInfo
|
||||||
{
|
{
|
||||||
Test* pTest;
|
Test* pTest;
|
||||||
int level;
|
int level;
|
||||||
};
|
};
|
||||||
std::vector<TestInfo> _tests;
|
std::vector<TestInfo> _tests;
|
||||||
ProgressBar* _testsProgress;
|
ProgressBar* _testsProgress;
|
||||||
Test* _selectedTest;
|
Test* _selectedTest;
|
||||||
ActiveTest* _activeTest;
|
ActiveTest* _activeTest;
|
||||||
TestResult* _result;
|
TestResult* _result;
|
||||||
int _testsRun;
|
int _testsRun;
|
||||||
int _errors;
|
int _errors;
|
||||||
int _failures;
|
int _failures;
|
||||||
DWORD _testStartTime;
|
DWORD _testStartTime;
|
||||||
DWORD _testEndTime;
|
DWORD _testEndTime;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|
||||||
|
|
||||||
#endif // TestRunnerDlg_INCLUDED
|
#endif // TestRunnerDlg_INCLUDED
|
||||||
|
|
||||||
|
|||||||
@@ -1,64 +1,64 @@
|
|||||||
//
|
//
|
||||||
// WinTestRunner.cpp
|
// WinTestRunner.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/WinTestRunner.cpp#1 $
|
// $Id: //poco/1.2/CppUnit/WinTestRunner/src/WinTestRunner.cpp#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#include "WinTestRunner/WinTestRunner.h"
|
#include "WinTestRunner/WinTestRunner.h"
|
||||||
#include "TestRunnerDlg.h"
|
#include "TestRunnerDlg.h"
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
WinTestRunner::WinTestRunner()
|
WinTestRunner::WinTestRunner()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WinTestRunner::~WinTestRunner()
|
WinTestRunner::~WinTestRunner()
|
||||||
{
|
{
|
||||||
for (std::vector<Test*>::iterator it = _tests.begin(); it != _tests.end(); ++it)
|
for (std::vector<Test*>::iterator it = _tests.begin(); it != _tests.end(); ++it)
|
||||||
delete *it;
|
delete *it;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinTestRunner::run()
|
void WinTestRunner::run()
|
||||||
{
|
{
|
||||||
TestRunnerDlg dlg;
|
TestRunnerDlg dlg;
|
||||||
|
|
||||||
dlg.setTests(_tests);
|
dlg.setTests(_tests);
|
||||||
dlg.DoModal();
|
dlg.DoModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinTestRunner::addTest(Test* pTest)
|
void WinTestRunner::addTest(Test* pTest)
|
||||||
{
|
{
|
||||||
_tests.push_back(pTest);
|
_tests.push_back(pTest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BEGIN_MESSAGE_MAP(WinTestRunnerApp, CWinApp)
|
BEGIN_MESSAGE_MAP(WinTestRunnerApp, CWinApp)
|
||||||
END_MESSAGE_MAP()
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
|
||||||
BOOL WinTestRunnerApp::InitInstance()
|
BOOL WinTestRunnerApp::InitInstance()
|
||||||
{
|
{
|
||||||
AllocConsole();
|
AllocConsole();
|
||||||
SetConsoleTitle("CppUnit WinTestRunner Console");
|
SetConsoleTitle("CppUnit WinTestRunner Console");
|
||||||
freopen("CONOUT$", "w", stdout);
|
freopen("CONOUT$", "w", stdout);
|
||||||
freopen("CONOUT$", "w", stderr);
|
freopen("CONOUT$", "w", stderr);
|
||||||
freopen("CONIN$", "r", stdin);
|
freopen("CONIN$", "r", stdin);
|
||||||
TestMain();
|
TestMain();
|
||||||
FreeConsole();
|
FreeConsole();
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinTestRunnerApp::TestMain()
|
void WinTestRunnerApp::TestMain()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
#
|
#
|
||||||
# buildfiles.vms
|
# buildfiles.vms
|
||||||
#
|
#
|
||||||
# $Id: //poco/CppUnit/cppunit.vmsbuild#1 $
|
# $Id: //poco/CppUnit/cppunit.vmsbuild#1 $
|
||||||
#
|
#
|
||||||
LIB=CppUnit
|
LIB=CppUnit
|
||||||
CppUnitException
|
CppUnitException
|
||||||
TestCase
|
TestCase
|
||||||
TestDecorator
|
TestDecorator
|
||||||
TestFailure
|
TestFailure
|
||||||
TestResult
|
TestResult
|
||||||
TestRunner
|
TestRunner
|
||||||
TestSuite
|
TestSuite
|
||||||
TextTestResult
|
TextTestResult
|
||||||
|
|||||||
@@ -1,75 +1,75 @@
|
|||||||
<HTML>
|
<HTML>
|
||||||
<HEAD>
|
<HEAD>
|
||||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
|
||||||
<META NAME="Generator" CONTENT="Microsoft Word 97">
|
<META NAME="Generator" CONTENT="Microsoft Word 97">
|
||||||
<TITLE>CppUnit 1.5</TITLE>
|
<TITLE>CppUnit 1.5</TITLE>
|
||||||
<META NAME="Template" CONTENT="C:\Program Files\MSOffice\Office\html.dot">
|
<META NAME="Template" CONTENT="C:\Program Files\MSOffice\Office\html.dot">
|
||||||
</HEAD>
|
</HEAD>
|
||||||
<BODY LINK="#0000ff" VLINK="#800080">
|
<BODY LINK="#0000ff" VLINK="#800080">
|
||||||
|
|
||||||
<P><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"></P>
|
<P><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"></P>
|
||||||
<H1>CppUnit 1.5</H1>
|
<H1>CppUnit 1.5</H1>
|
||||||
<P>Last Revision: 12/15/99 - Michael Feathers (mfeathers@acm.org) - written in standard C++, tested under Microsoft Visual C++ 6.0</P>
|
<P>Last Revision: 12/15/99 - Michael Feathers (mfeathers@acm.org) - written in standard C++, tested under Microsoft Visual C++ 6.0</P>
|
||||||
<P><HR></P>
|
<P><HR></P>
|
||||||
<H3>Background</H3>
|
<H3>Background</H3>
|
||||||
<P>CppUnit is a simple unit test framework for C++. It is a port from JUnit, a testing framework for Java, developed by Kent Beck and Erich Gamma. </P>
|
<P>CppUnit is a simple unit test framework for C++. It is a port from JUnit, a testing framework for Java, developed by Kent Beck and Erich Gamma. </P>
|
||||||
<H3>Contents</H3>
|
<H3>Contents</H3>
|
||||||
<PRE>README.html this file
|
<PRE>README.html this file
|
||||||
|
|
||||||
test the source code
|
test the source code
|
||||||
framework the testing framework
|
framework the testing framework
|
||||||
		extensions	some framework extension classes
|
		extensions	some framework extension classes
|
||||||
textui a command line interface to run tests
|
textui a command line interface to run tests
|
||||||
ms code for a Microsoft specific TestRunner
|
ms code for a Microsoft specific TestRunner
|
||||||
samples some example test cases and extensions to the framework
|
samples some example test cases and extensions to the framework
|
||||||
multicaster a sample illustrating a publish/subscribe
|
multicaster a sample illustrating a publish/subscribe
|
||||||
				multicaster under test
|
				multicaster under test
|
||||||
doc documentation</PRE>
|
doc documentation</PRE>
|
||||||
<H3>Installation</H3>
|
<H3>Installation</H3>
|
||||||
<P>To use the test framework, create a makefile or load all files in test\framework into your IDE. In this incarnation of CppUnit, all includes assume the current directory first. A makefile or project can be used to resolve the dependencies. </P>
|
<P>To use the test framework, create a makefile or load all files in test\framework into your IDE. In this incarnation of CppUnit, all includes assume the current directory first. A makefile or project can be used to resolve the dependencies. </P>
|
||||||
<P>The directory test\textui contains a simple command line example that uses the framework.</P>
|
<P>The directory test\textui contains a simple command line example that uses the framework.</P>
|
||||||
<H3>Documentation</H3>
|
<H3>Documentation</H3>
|
||||||
<P>CppUnit comes with the following documentation: </P>
|
<P>CppUnit comes with the following documentation: </P>
|
||||||
|
|
||||||
<UL>
|
<UL>
|
||||||
<LI>a cookbook: doc\cookbook.htm </LI>
|
<LI>a cookbook: doc\cookbook.htm </LI>
|
||||||
<LI>this file </LI></UL>
|
<LI>this file </LI></UL>
|
||||||
|
|
||||||
<H3>Samples</H3>
|
<H3>Samples</H3>
|
||||||
<P>You can find several sample test cases in the samples directory: </P>
|
<P>You can find several sample test cases in the samples directory: </P>
|
||||||
|
|
||||||
<UL>
|
<UL>
|
||||||
<LI>ExampleTestCase - some simple tests </LI>
|
<LI>ExampleTestCase - some simple tests </LI>
|
||||||
<LI>Multicaster - test cases for a sample publish/subscribe multicaster class </LI></UL>
|
<LI>Multicaster - test cases for a sample publish/subscribe multicaster class </LI></UL>
|
||||||
|
|
||||||
<P>Also, the wiki page <a HREF="http://c2.com/cgi/wiki?ClassHierarchyTestingInCppUnit">http://c2.com/cgi/wiki?ClassHierarchyTestingInCppUnit</a> shows how to automatically apply tests of classes to the classes' subclasses.</P>
|
<P>Also, the wiki page <a HREF="http://c2.com/cgi/wiki?ClassHierarchyTestingInCppUnit">http://c2.com/cgi/wiki?ClassHierarchyTestingInCppUnit</a> shows how to automatically apply tests of classes to the classes' subclasses.</P>
|
||||||
|
|
||||||
<H3>Extensions</H3>
|
<H3>Extensions</H3>
|
||||||
<P>You can find several classes that illustrate framework extensions in the extensions directory: </P>
|
<P>You can find several classes that illustrate framework extensions in the extensions directory: </P>
|
||||||
|
|
||||||
<UL>
|
<UL>
|
||||||
<LI>TestDecorator - A Decorator for Test. You can use it as the base class for decorators that extend test cases. </LI>
|
<LI>TestDecorator - A Decorator for Test. You can use it as the base class for decorators that extend test cases. </LI>
|
||||||
<LI>TestSetup - A Decorator that can be used to set up and tear down additional fixture state. Subclass TestSetup and insert it into your tests when you want to set up additional state once before the test is run. </LI>
|
<LI>TestSetup - A Decorator that can be used to set up and tear down additional fixture state. Subclass TestSetup and insert it into your tests when you want to set up additional state once before the test is run. </LI>
|
||||||
<LI>Orthodox - a template class which can be used to verify operations on an arbitrary class.</LI></UL>
|
<LI>Orthodox - a template class which can be used to verify operations on an arbitrary class.</LI></UL>
|
||||||
|
|
||||||
|
|
||||||
<H3>Notes</H3>
|
<H3>Notes</H3>
|
||||||
<P>Porting this framework has been fun. I've tried to maintain the spirit and utility of JUnit in a C++ environment. Naturally, the move from Java to standard C++ forces out several nice JUnit features:</P>
|
<P>Porting this framework has been fun. I've tried to maintain the spirit and utility of JUnit in a C++ environment. Naturally, the move from Java to standard C++ forces out several nice JUnit features:</P>
|
||||||
<OL>
|
<OL>
|
||||||
|
|
||||||
<LI>Platform independent GUI.</LI>
|
<LI>Platform independent GUI.</LI>
|
||||||
<LI>Stack traces of test failures</LI>
|
<LI>Stack traces of test failures</LI>
|
||||||
<LI>Active (threaded) tests</LI>
|
<LI>Active (threaded) tests</LI>
|
||||||
<LI>Direct invocation of test cases via reflection</LI>
|
<LI>Direct invocation of test cases via reflection</LI>
|
||||||
<LI>Run-time loading of new tests</LI></OL>
|
<LI>Run-time loading of new tests</LI></OL>
|
||||||
|
|
||||||
<P>In addition, the lack of garbage collection in C++ requires some careful use of the framework classes. In particular, TestSuites are composites that manage the lifetime of any tests added to them. Holding onto a TestResult past the lifetime of the tests which filled it is a bad idea. This is because TestResults hold TestFailures and TestFailures hold pointers to the Tests that generated them.</P>
|
<P>In addition, the lack of garbage collection in C++ requires some careful use of the framework classes. In particular, TestSuites are composites that manage the lifetime of any tests added to them. Holding onto a TestResult past the lifetime of the tests which filled it is a bad idea. This is because TestResults hold TestFailures and TestFailures hold pointers to the Tests that generated them.</P>
|
||||||
<P>On the plus side, we can use the C++ macro preprocessor to get the exact line at which a failure occurs, along with the actual text inside the assert () call that detected the failure. The features of C++ that enable this are the __LINE__ and __FILE__ preprocessor definitions, along with the <I>stringizing</I> operator. If you find that generating this much literal text bulks up your test executables, you can use the CPP_UNIT_SOURCEANNOT define to disable that portion of the reporting.</P>
|
<P>On the plus side, we can use the C++ macro preprocessor to get the exact line at which a failure occurs, along with the actual text inside the assert () call that detected the failure. The features of C++ that enable this are the __LINE__ and __FILE__ preprocessor definitions, along with the <I>stringizing</I> operator. If you find that generating this much literal text bulks up your test executables, you can use the CPP_UNIT_SOURCEANNOT define to disable that portion of the reporting.</P>
|
||||||
<P>Note: If you use the C++ macro "assert ()" in your code, or include assert.h, you may have a name clash with CppUnit's assert macro. This can be remedied by changing the name of the macro to "cu_assert ()" in TestCase.h.</P>
|
<P>Note: If you use the C++ macro "assert ()" in your code, or include assert.h, you may have a name clash with CppUnit's assert macro. This can be remedied by changing the name of the macro to "cu_assert ()" in TestCase.h.</P>
|
||||||
<P>I'd like to thank Kent Beck and Erich Gamma for the inspiration, design, and a wonderful cookbook that was easily/shamelessly mutated to describe CppUnit. Double thanks to Erich for thinking up a way to implement TestCaller. Additional thanks to Kent, Ward Cunningham, Ron Jeffries, Martin Fowler, and several other netizens of the WikiWikiWeb. I don't think any other bunch of people could have convinced me that rapid development with unit tests can be both effective and easy.</P>
|
<P>I'd like to thank Kent Beck and Erich Gamma for the inspiration, design, and a wonderful cookbook that was easily/shamelessly mutated to describe CppUnit. Double thanks to Erich for thinking up a way to implement TestCaller. Additional thanks to Kent, Ward Cunningham, Ron Jeffries, Martin Fowler, and several other netizens of the WikiWikiWeb. I don't think any other bunch of people could have convinced me that rapid development with unit tests can be both effective and easy.</P>
|
||||||
<P>Thanks also to Fred Huls for mentioning the idea of template-based testing. The <EM>orthodox</EM> template class demonstrates only a small part of what can be done with templated test cases.</P>
|
<P>Thanks also to Fred Huls for mentioning the idea of template-based testing. The <EM>orthodox</EM> template class demonstrates only a small part of what can be done with templated test cases.</P>
|
||||||
<H3>History Of Changes</H3>
|
<H3>History Of Changes</H3>
|
||||||
<P>1.2 -- Added the TestCaller template class. There is now no need to use the CPP_UNIT_TESTCASEDISPATCH macro unless you are using a C++ compiler which does not support templates well. CPP_UNIT_TESTCASEDISPATCH remains in TestCase.h for backward compatibility. I've also kept the use of the macro in the Multicaster sample to leave in an example.</P>
|
<P>1.2 -- Added the TestCaller template class. There is now no need to use the CPP_UNIT_TESTCASEDISPATCH macro unless you are using a C++ compiler which does not support templates well. CPP_UNIT_TESTCASEDISPATCH remains in TestCase.h for backward compatibility. I've also kept the use of the macro in the Multicaster sample to leave in an example.</P>
|
||||||
<P>1.3 -- Retired the CPP_UNIT_TESTCASEDISPATCH macro and cleaned up the include structure. Fixed bug in the textui version.</P>
|
<P>1.3 -- Retired the CPP_UNIT_TESTCASEDISPATCH macro and cleaned up the include structure. Fixed bug in the textui version.</P>
|
||||||
<P>1.4 -- Removed using directives for std in CppUnit headers. Merged the old AssertionFailedError into CppUnitException. Fixed a memory leak in the TestRunner class of the MS GUI TestRunner. Removed CppUnit.h file. Now headers for each class must be included directly.</P></BODY></HTML>
|
<P>1.4 -- Removed using directives for std in CppUnit headers. Merged the old AssertionFailedError into CppUnitException. Fixed a memory leak in the TestRunner class of the MS GUI TestRunner. Removed CppUnit.h file. Now headers for each class must be included directly.</P></BODY></HTML>
|
||||||
<P>1.5 -- Upgraded projects from VC++ 5.0 to 6.0.</P></BODY></HTML>
|
<P>1.5 -- Upgraded projects from VC++ 5.0 to 6.0.</P></BODY></HTML>
|
||||||
|
|||||||
@@ -1,164 +1,164 @@
|
|||||||
<HTML>
|
<HTML>
|
||||||
<HEAD>
|
<HEAD>
|
||||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
|
||||||
<META NAME="Generator" CONTENT="Microsoft Word 97">
|
<META NAME="Generator" CONTENT="Microsoft Word 97">
|
||||||
<TITLE>CppUnit Cookbook</TITLE>
|
<TITLE>CppUnit Cookbook</TITLE>
|
||||||
<META NAME="Template" CONTENT="C:\Program Files\MSOffice\Office\html.dot">
|
<META NAME="Template" CONTENT="C:\Program Files\MSOffice\Office\html.dot">
|
||||||
</HEAD>
|
</HEAD>
|
||||||
<BODY LINK="#0000ff" VLINK="#800080">
|
<BODY LINK="#0000ff" VLINK="#800080">
|
||||||
|
|
||||||
<P><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"></P>
|
<P><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"></P>
|
||||||
<H1>CppUnit Cookbook</H1>
|
<H1>CppUnit Cookbook</H1>
|
||||||
<P>Here is a short cookbook to help you get started. </P>
|
<P>Here is a short cookbook to help you get started. </P>
|
||||||
<H2>Simple Test Case</H2>
|
<H2>Simple Test Case</H2>
|
||||||
<P>You want to know whether your code is working. How do you do it? There are many ways. Stepping through a debugger or littering your code with stream output calls are two of the simpler ways, but they both have drawbacks. Stepping through your code is a good idea, but it is not automatic. You have to do it every time you make changes. Streaming out text is also fine, but it makes code ugly and it generates far more information than you need most of the time.</P>
|
<P>You want to know whether your code is working. How do you do it? There are many ways. Stepping through a debugger or littering your code with stream output calls are two of the simpler ways, but they both have drawbacks. Stepping through your code is a good idea, but it is not automatic. You have to do it every time you make changes. Streaming out text is also fine, but it makes code ugly and it generates far more information than you need most of the time.</P>
|
||||||
<P>Tests in CppUnit can be run automatically. They are easy to set up and once you have written them, they are always there to help you keep confidence in the quality of your code.</P>
|
<P>Tests in CppUnit can be run automatically. They are easy to set up and once you have written them, they are always there to help you keep confidence in the quality of your code.</P>
|
||||||
<P>To make a simple test, here is what you do:</P>
|
<P>To make a simple test, here is what you do:</P>
|
||||||
<P>Subclass the TestCase class. Override the method "runTest ()". When you want to check a value, call "assert (bool)" and pass in an expression that is true if the test succeeds. </P>
|
<P>Subclass the TestCase class. Override the method "runTest ()". When you want to check a value, call "assert (bool)" and pass in an expression that is true if the test succeeds. </P>
|
||||||
<P>For example, to test the equality comparison for a Complex number class, write:</P>
|
<P>For example, to test the equality comparison for a Complex number class, write:</P>
|
||||||
<TT><PRE>	class ComplexNumberTest : public TestCase {
|
<TT><PRE>	class ComplexNumberTest : public TestCase {
|
||||||
	public:
|
	public:
|
||||||
ComplexNumberTest (string name) : TestCase (name) {}
|
ComplexNumberTest (string name) : TestCase (name) {}
|
||||||
void runTest () {
|
void runTest () {
|
||||||
assert (Complex (10, 1) == Complex (10, 1));
|
assert (Complex (10, 1) == Complex (10, 1));
|
||||||
assert (!(Complex (1, 1) == Complex (2, 2)));
|
assert (!(Complex (1, 1) == Complex (2, 2)));
|
||||||
}
|
}
|
||||||
};</PRE>
|
};</PRE>
|
||||||
</TT><P>That was a very simple test. Ordinarily, you'll have many little test cases that you'll want to run on the same set of objects. To do this, use a fixture.</P>
|
</TT><P>That was a very simple test. Ordinarily, you'll have many little test cases that you'll want to run on the same set of objects. To do this, use a fixture.</P>
|
||||||
<P> </P>
|
<P> </P>
|
||||||
<H2>Fixture</H2>
|
<H2>Fixture</H2>
|
||||||
<P>A fixture is a known set of objects that serves as a base for a set of test cases. Fixtures come in very handy when you are testing as you develop. Let's try out this style of development and learn about fixtures along the away. Suppose that we are really developing a complex number class. Let's start by defining a empty class named Complex.</P>
|
<P>A fixture is a known set of objects that serves as a base for a set of test cases. Fixtures come in very handy when you are testing as you develop. Let's try out this style of development and learn about fixtures along the away. Suppose that we are really developing a complex number class. Let's start by defining a empty class named Complex.</P>
|
||||||
<TT><PRE>	class Complex {}; </PRE>
|
<TT><PRE>	class Complex {}; </PRE>
|
||||||
</TT><P>Now create an instance of ComplexNumberTest above, compile the code and see what happens. The first thing we notice is a few compiler errors. The test uses operator==, but it is not defined. Let's fix that.</P>
|
</TT><P>Now create an instance of ComplexNumberTest above, compile the code and see what happens. The first thing we notice is a few compiler errors. The test uses operator==, but it is not defined. Let's fix that.</P>
|
||||||
<TT><PRE>	bool operator== (const Complex& a, const Complex& b) { return true; }</PRE>
|
<TT><PRE>	bool operator== (const Complex& a, const Complex& b) { return true; }</PRE>
|
||||||
</TT><P>Now compile the test, and run it. This time it compiles but the test fails. We need a bit more to get an operator== working correctly, so we revisit the code.</P>
|
</TT><P>Now compile the test, and run it. This time it compiles but the test fails. We need a bit more to get an operator== working correctly, so we revisit the code.</P>
|
||||||
<TT><PRE>	class Complex {
|
<TT><PRE>	class Complex {
|
||||||
friend bool operator== (const Complex& a, const Complex& b);
|
friend bool operator== (const Complex& a, const Complex& b);
|
||||||
double real, imaginary;
|
double real, imaginary;
|
||||||
public:
|
public:
|
||||||
Complex () {
|
Complex () {
|
||||||
real = imaginary = 0.0;
|
real = imaginary = 0.0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
bool operator== (const Complex& a, const Complex& b)
|
bool operator== (const Complex& a, const Complex& b)
|
||||||
{ return eq(a.real,b.real) && eq(a.imaginary,b.imaginary); }</PRE>
|
{ return eq(a.real,b.real) && eq(a.imaginary,b.imaginary); }</PRE>
|
||||||
</TT><P>If we compile now and run our test it will pass. </P>
|
</TT><P>If we compile now and run our test it will pass. </P>
|
||||||
<P>Now we are ready to add new operations and new tests. At this point a fixture would be handy. We would probably be better off when doing our tests if we decided to instantiate three or four complex numbers and reuse them across our tests. </P>
|
<P>Now we are ready to add new operations and new tests. At this point a fixture would be handy. We would probably be better off when doing our tests if we decided to instantiate three or four complex numbers and reuse them across our tests. </P>
|
||||||
<P>Here is how we do it:</P>
|
<P>Here is how we do it:</P>
|
||||||
<OL>
|
<OL>
|
||||||
|
|
||||||
<LI>Add member variables for each part of the fixture </LI>
|
<LI>Add member variables for each part of the fixture </LI>
|
||||||
<LI>Override "setUp ()" to initialize the variables </LI>
|
<LI>Override "setUp ()" to initialize the variables </LI>
|
||||||
<LI>Override "tearDown ()" to release any permanent resources you allocated in "setUp ()"</LI></OL>
|
<LI>Override "tearDown ()" to release any permanent resources you allocated in "setUp ()"</LI></OL>
|
||||||
|
|
||||||
<TT><PRE>	class ComplexNumberTest : public TestCase {
|
<TT><PRE>	class ComplexNumberTest : public TestCase {
|
||||||
	private:
|
	private:
|
||||||
Complex 	*m_10_1, *m_1_1; *m_11_2;
|
Complex 	*m_10_1, *m_1_1; *m_11_2;
|
||||||
	protected:
|
	protected:
|
||||||
	void		setUp () {
|
	void		setUp () {
|
||||||
			 m_10_1 = new Complex (10, 1);
|
			 m_10_1 = new Complex (10, 1);
|
||||||
			 m_1_1 = new Complex (1, 1);
|
			 m_1_1 = new Complex (1, 1);
|
||||||
			 m_11_2 = new Complex (11, 2);
|
			 m_11_2 = new Complex (11, 2);
|
||||||
}
|
}
|
||||||
	void		tearDown () {
|
	void		tearDown () {
|
||||||
			 delete m_10_1, delete m_1_1, delete m_11_2;
|
			 delete m_10_1, delete m_1_1, delete m_11_2;
|
||||||
			}
|
			}
|
||||||
	};</PRE>
|
	};</PRE>
|
||||||
</TT><P>Once we have this fixture, we can add the complex addition test case any any others that we need over the course of our development.</P>
|
</TT><P>Once we have this fixture, we can add the complex addition test case any any others that we need over the course of our development.</P>
|
||||||
<P> </P>
|
<P> </P>
|
||||||
<H2>Test Case</H2>
|
<H2>Test Case</H2>
|
||||||
<P>How do you write and invoke individual tests using a fixture? </P>
|
<P>How do you write and invoke individual tests using a fixture? </P>
|
||||||
<P>There are two steps to this process:</P>
|
<P>There are two steps to this process:</P>
|
||||||
<OL>
|
<OL>
|
||||||
|
|
||||||
<LI>Write the test case as a method in the fixture class</LI>
|
<LI>Write the test case as a method in the fixture class</LI>
|
||||||
<LI>Create a TestCaller which runs that particular method</LI></OL>
|
<LI>Create a TestCaller which runs that particular method</LI></OL>
|
||||||
|
|
||||||
<P>Here is our test case class with a few extra case methods:</P>
|
<P>Here is our test case class with a few extra case methods:</P>
|
||||||
<TT><PRE>	class ComplexNumberTest : public TestCase {
|
<TT><PRE>	class ComplexNumberTest : public TestCase {
|
||||||
	private:
|
	private:
|
||||||
Complex 	*m_10_1, *m_1_1; *m_11_2;
|
Complex 	*m_10_1, *m_1_1; *m_11_2;
|
||||||
	protected:
|
	protected:
|
||||||
	void		setUp () {
|
	void		setUp () {
|
||||||
			 m_10_1 = new Complex (10, 1);
|
			 m_10_1 = new Complex (10, 1);
|
||||||
			 m_1_1 = new Complex (1, 1);
|
			 m_1_1 = new Complex (1, 1);
|
||||||
			 m_11_2 = new Complex (11, 2);
|
			 m_11_2 = new Complex (11, 2);
|
||||||
}
|
}
|
||||||
	void		tearDown () {
|
	void		tearDown () {
|
||||||
			 delete m_10_1, delete m_1_1, delete m_11_2;
|
			 delete m_10_1, delete m_1_1, delete m_11_2;
|
||||||
			}
|
			}
|
||||||
	void		testEquality () {
|
	void		testEquality () {
|
||||||
			 assert (*m_10_1 == *m_10_1);
|
			 assert (*m_10_1 == *m_10_1);
|
||||||
			 assert (!(*m_10_1 == *m_11_2));
|
			 assert (!(*m_10_1 == *m_11_2));
|
||||||
			}
|
			}
|
||||||
	void		testAddition () {
|
	void		testAddition () {
|
||||||
			 assert (*m_10_1 + *m_1_1 == *m_11_2);
|
			 assert (*m_10_1 + *m_1_1 == *m_11_2);
|
||||||
	}
|
	}
|
||||||
	};</PRE>
|
	};</PRE>
|
||||||
</TT><P>Create and run instances for each test case like this:</P>
|
</TT><P>Create and run instances for each test case like this:</P>
|
||||||
<TT><PRE>	test = new TestCaller<ComplexNumberTest>("testEquality", ComplexNumberTest::testEquality);
|
<TT><PRE>	test = new TestCaller<ComplexNumberTest>("testEquality", ComplexNumberTest::testEquality);
|
||||||
test->run (); </PRE>
|
test->run (); </PRE>
|
||||||
</TT><P>The second argument to the test caller constructor is the address of a method on ComplexNumberTest. When the test caller is run, that specific method will be run.</P>
|
</TT><P>The second argument to the test caller constructor is the address of a method on ComplexNumberTest. When the test caller is run, that specific method will be run.</P>
|
||||||
<P>Once you have several tests, organize them into a suite.</P>
|
<P>Once you have several tests, organize them into a suite.</P>
|
||||||
<P> </P>
|
<P> </P>
|
||||||
<H2>Suite</H2>
|
<H2>Suite</H2>
|
||||||
<P>How do you set up your tests so that you can run them all at once?<BR>
|
<P>How do you set up your tests so that you can run them all at once?<BR>
|
||||||
<BR>
|
<BR>
|
||||||
CppUnit provides a TestSuite class that runs any number of TestCases together. For example, to run a single test case, you execute:</P>
|
CppUnit provides a TestSuite class that runs any number of TestCases together. For example, to run a single test case, you execute:</P>
|
||||||
<TT><PRE>	TestResult result;
|
<TT><PRE>	TestResult result;
|
||||||
	TestCaller<ComplexNumberTest> test ("testAddition", ComplexNumberTest::testAddition);
|
	TestCaller<ComplexNumberTest> test ("testAddition", ComplexNumberTest::testAddition);
|
||||||
	Test.run (&result);</PRE>
|
	Test.run (&result);</PRE>
|
||||||
</TT><P> </P>
|
</TT><P> </P>
|
||||||
<P>To create a suite of two or more tests, you do the following:</P>
|
<P>To create a suite of two or more tests, you do the following:</P>
|
||||||
<TT><PRE>	TestSuite suite;
|
<TT><PRE>	TestSuite suite;
|
||||||
	TestResult result;
|
	TestResult result;
|
||||||
	suite.addTest (new TestCaller<ComplexNumberTest>("testEquality", ComplexNumberTest::testEquality));
|
	suite.addTest (new TestCaller<ComplexNumberTest>("testEquality", ComplexNumberTest::testEquality));
|
||||||
	suite.addTest (new TestCaller<ComplexNumberTest>("testAddition", ComplexNumberTest::testAddition));
|
	suite.addTest (new TestCaller<ComplexNumberTest>("testAddition", ComplexNumberTest::testAddition));
|
||||||
	suite.run (&result);
|
	suite.run (&result);
|
||||||
</PRE>
|
</PRE>
|
||||||
</TT><P>TestSuites don't only have to contain callers for TestCases. They can contain any object that implements the Test interface. For example, you can create a TestSuite in your code and I can create one in mine, and we can run them together by creating a TestSuite that contains both: </P>
|
</TT><P>TestSuites don't only have to contain callers for TestCases. They can contain any object that implements the Test interface. For example, you can create a TestSuite in your code and I can create one in mine, and we can run them together by creating a TestSuite that contains both: </P>
|
||||||
<TT><PRE>	TestSuite suite;
|
<TT><PRE>	TestSuite suite;
|
||||||
	suite.addTest (ComplexNumberTest.suite ());
|
	suite.addTest (ComplexNumberTest.suite ());
|
||||||
	suite.addTest (SurrealNumberTest.suite ());
|
	suite.addTest (SurrealNumberTest.suite ());
|
||||||
	suite.run (&result);</PRE>
|
	suite.run (&result);</PRE>
|
||||||
</TT><P> </P>
|
</TT><P> </P>
|
||||||
<H2>TestRunner</H2>
|
<H2>TestRunner</H2>
|
||||||
<P>How do you run your tests and collect their results? </P>
|
<P>How do you run your tests and collect their results? </P>
|
||||||
<P>Once you have a test suite, you'll want to run it. CppUnit provides tools to define the suite to be run and to display its results. You make your suite accessible to a TestRunner program with a static method <I>suite</I> that returns a test suite. <BR>
|
<P>Once you have a test suite, you'll want to run it. CppUnit provides tools to define the suite to be run and to display its results. You make your suite accessible to a TestRunner program with a static method <I>suite</I> that returns a test suite. <BR>
|
||||||
For example, to make a ComplexNumberTest suite available to a TestRunner, add the following code to ComplexNumberTest: </P>
|
For example, to make a ComplexNumberTest suite available to a TestRunner, add the following code to ComplexNumberTest: </P>
|
||||||
<TT><PRE>	public: static Test *suite () {
|
<TT><PRE>	public: static Test *suite () {
|
||||||
	 TestSuite *suiteOfTests = new TestSuite;
|
	 TestSuite *suiteOfTests = new TestSuite;
|
||||||
	 suiteOfTests->addTest (new TestCaller<ComplexNumberTest>("testEquality", testEquality));
|
	 suiteOfTests->addTest (new TestCaller<ComplexNumberTest>("testEquality", testEquality));
|
||||||
	 suiteOfTests->addTest (new TestCaller<ComplexNumberTest>("testAddition", testAddition));
|
	 suiteOfTests->addTest (new TestCaller<ComplexNumberTest>("testAddition", testAddition));
|
||||||
return suiteOfTests;
|
return suiteOfTests;
|
||||||
	}</PRE>
|
	}</PRE>
|
||||||
</TT><P>CppUnit provides both a textual version of a TestRunner tool, and a Micosoft Visual C++ 5.0 graphical version. If you are running on another platform, take a look at the graphical version. It is easy to port.</P>
|
</TT><P>CppUnit provides both a textual version of a TestRunner tool, and a Micosoft Visual C++ 5.0 graphical version. If you are running on another platform, take a look at the graphical version. It is easy to port.</P>
|
||||||
<P>To use the text version, include the header file for the test in TestRunner.cpp:</P>
|
<P>To use the text version, include the header file for the test in TestRunner.cpp:</P>
|
||||||
<TT><PRE>	#include "ExampleTestCase.h"
|
<TT><PRE>	#include "ExampleTestCase.h"
|
||||||
	#include "ComplexNumberTest.h"</PRE>
|
	#include "ComplexNumberTest.h"</PRE>
|
||||||
</TT><P>And add a call to "addTest (string, Test *) in the "main ()" function:</P>
|
</TT><P>And add a call to "addTest (string, Test *) in the "main ()" function:</P>
|
||||||
<TT><PRE>	int main (int ac, char **av) {
|
<TT><PRE>	int main (int ac, char **av) {
|
||||||
	 TestRunner runner;
|
	 TestRunner runner;
|
||||||
	 runner.addTest (ExampleTestCase::suite ());
|
	 runner.addTest (ExampleTestCase::suite ());
|
||||||
	 runner.addTest (ComplexNumberTest::suite ());
|
	 runner.addTest (ComplexNumberTest::suite ());
|
||||||
	 runner.run ();
|
	 runner.run ();
|
||||||
	 return 0;
|
	 return 0;
|
||||||
	}</PRE>
|
	}</PRE>
|
||||||
</TT><P>The TestRunner will run the tests. If all the tests pass, you'll get an informative message. If any fail, you'll get the following information:</P>
|
</TT><P>The TestRunner will run the tests. If all the tests pass, you'll get an informative message. If any fail, you'll get the following information:</P>
|
||||||
<OL>
|
<OL>
|
||||||
|
|
||||||
<LI>The name of the test case that failed</LI>
|
<LI>The name of the test case that failed</LI>
|
||||||
<LI>The name of the source file that contains the test</LI>
|
<LI>The name of the source file that contains the test</LI>
|
||||||
<LI>The line number where the failure occurred</LI>
|
<LI>The line number where the failure occurred</LI>
|
||||||
<LI>All of the text inside the call to assert which detected the failure</LI></OL>
|
<LI>All of the text inside the call to assert which detected the failure</LI></OL>
|
||||||
|
|
||||||
<P>CppUnit distinguishes between <I>failures</I> and <I>errors</I>. A failure is anticipated and checked for with assertions. Errors are unanticipated problems like division by zero and other exceptions thrown by the C++ runtime or your code.</P>
|
<P>CppUnit distinguishes between <I>failures</I> and <I>errors</I>. A failure is anticipated and checked for with assertions. Errors are unanticipated problems like division by zero and other exceptions thrown by the C++ runtime or your code.</P>
|
||||||
<P>If you are running MS Developer's Studio, you can build the GUI version rather easily. There are three projects: culib, TestRunner, and HostApp. They make a static library for the framework, a dialog based TestRunner in a DLL and an example Hosting application, respectively. To incorporate a TestRunner in an application you are developing, link with the static library and the TestRunner DLL. Note that the TestRunner DLL must be in the home directory of your application, the system directory or the path. In your application, create an instance of TestRunnerDlg whenever you want to run tests. Pass tests you want to run to the dialog object and then execute.</P>
|
<P>If you are running MS Developer's Studio, you can build the GUI version rather easily. There are three projects: culib, TestRunner, and HostApp. They make a static library for the framework, a dialog based TestRunner in a DLL and an example Hosting application, respectively. To incorporate a TestRunner in an application you are developing, link with the static library and the TestRunner DLL. Note that the TestRunner DLL must be in the home directory of your application, the system directory or the path. In your application, create an instance of TestRunnerDlg whenever you want to run tests. Pass tests you want to run to the dialog object and then execute.</P>
|
||||||
<P>Here is a screen shot of the TestRunner in use:</P>
|
<P>Here is a screen shot of the TestRunner in use:</P>
|
||||||
<P><IMG SRC="test.gif" WIDTH=574 HEIGHT=351></P>
|
<P><IMG SRC="test.gif" WIDTH=574 HEIGHT=351></P>
|
||||||
<P> </P>
|
<P> </P>
|
||||||
<P>More notes about the implementation of CppUnit can be found in README.HTML.</P>
|
<P>More notes about the implementation of CppUnit can be found in README.HTML.</P>
|
||||||
<P> </P>
|
<P> </P>
|
||||||
<P> </P></BODY>
|
<P> </P></BODY>
|
||||||
</HTML>
|
</HTML>
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<HTML>
|
<HTML>
|
||||||
<HEAD>
|
<HEAD>
|
||||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
|
||||||
<META NAME="Generator" CONTENT="Microsoft Word 97">
|
<META NAME="Generator" CONTENT="Microsoft Word 97">
|
||||||
<TITLE>License Agreement</TITLE>
|
<TITLE>License Agreement</TITLE>
|
||||||
<META NAME="Template" CONTENT="C:\Program Files\MSOffice\Office\html.dot">
|
<META NAME="Template" CONTENT="C:\Program Files\MSOffice\Office\html.dot">
|
||||||
</HEAD>
|
</HEAD>
|
||||||
<BODY LINK="#0000ff" VLINK="#800080">
|
<BODY LINK="#0000ff" VLINK="#800080">
|
||||||
|
|
||||||
<P>Permission to reproduce and create derivative works from the Software ("Software Derivative Works") is hereby granted to you under the copyright of Michael Feathers. Michael Feathers also grants you the right to distribute the Software and Software Derivative Works. </P>
|
<P>Permission to reproduce and create derivative works from the Software ("Software Derivative Works") is hereby granted to you under the copyright of Michael Feathers. Michael Feathers also grants you the right to distribute the Software and Software Derivative Works. </P>
|
||||||
<P>Michael Feathers licenses the Software to you on an "AS IS" basis, without warranty of any kind. Michael Feathers HEREBY EXPRESSLY DISCLAIMS ALL WARRANTIES OR CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, NON INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using the Software and assume all risks associated with the use and distribution of this Software, including but not limited to the risks of program errors, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. MICHAEL FEATHERS WILL NOT BE LIABLE FOR ANY DIRECT DAMAGES OR FOR ANY SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF MICHAEL FEATHERS HAD BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Michael Feathers will not be liable for the loss of, or damage to, your records or data, or any damages claimed by you based on a third party claim. </P>
|
<P>Michael Feathers licenses the Software to you on an "AS IS" basis, without warranty of any kind. Michael Feathers HEREBY EXPRESSLY DISCLAIMS ALL WARRANTIES OR CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, NON INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using the Software and assume all risks associated with the use and distribution of this Software, including but not limited to the risks of program errors, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. MICHAEL FEATHERS WILL NOT BE LIABLE FOR ANY DIRECT DAMAGES OR FOR ANY SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF MICHAEL FEATHERS HAD BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Michael Feathers will not be liable for the loss of, or damage to, your records or data, or any damages claimed by you based on a third party claim. </P>
|
||||||
<P>You agree to distribute the Software and any Software Derivatives under a license agreement that: 1) is sufficient to notify all licensees of the Software and Software Derivatives that Michael Feathers assumes no liability for any claim that may arise regarding the Software or Software Derivatives, and 2) that disclaims all warranties, both express and implied, from Michael Feathers regarding the Software and Software Derivatives. (If you include this Agreement with any distribution of the Software and Software Derivatives you will have meet this requirement). You agree that you will not delete any copyright notices in the Software. </P>
|
<P>You agree to distribute the Software and any Software Derivatives under a license agreement that: 1) is sufficient to notify all licensees of the Software and Software Derivatives that Michael Feathers assumes no liability for any claim that may arise regarding the Software or Software Derivatives, and 2) that disclaims all warranties, both express and implied, from Michael Feathers regarding the Software and Software Derivatives. (If you include this Agreement with any distribution of the Software and Software Derivatives you will have meet this requirement). You agree that you will not delete any copyright notices in the Software. </P>
|
||||||
<P>This Agreement is the exclusive statement of your rights in the Software as provided by Michael Feathers. Except for the licenses granted to you in the second paragraph above, no other licenses are granted hereunder, by estoppel, implication or otherwise. <BR>
|
<P>This Agreement is the exclusive statement of your rights in the Software as provided by Michael Feathers. Except for the licenses granted to you in the second paragraph above, no other licenses are granted hereunder, by estoppel, implication or otherwise. <BR>
|
||||||
</P></BODY>
|
</P></BODY>
|
||||||
</HTML>
|
</HTML>
|
||||||
|
|||||||
@@ -1,56 +1,56 @@
|
|||||||
//
|
//
|
||||||
// CppUnit.h
|
// CppUnit.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/include/CppUnit/CppUnit.h#1 $
|
// $Id: //poco/1.2/CppUnit/include/CppUnit/CppUnit.h#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef CppUnit_CppUnit_INCLUDED
|
#ifndef CppUnit_CppUnit_INCLUDED
|
||||||
#define CppUnit_CppUnit_INCLUDED
|
#define CppUnit_CppUnit_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Ensure that POCO_DLL is default unless POCO_STATIC is defined
|
// Ensure that POCO_DLL is default unless POCO_STATIC is defined
|
||||||
//
|
//
|
||||||
#if defined(_WIN32) && defined(_DLL)
|
#if defined(_WIN32) && defined(_DLL)
|
||||||
#if !defined(POCO_DLL) && !defined(POCO_STATIC)
|
#if !defined(POCO_DLL) && !defined(POCO_STATIC)
|
||||||
#define POCO_DLL
|
#define POCO_DLL
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// The following block is the standard way of creating macros which make exporting
|
// The following block is the standard way of creating macros which make exporting
|
||||||
// from a DLL simpler. All files within this DLL are compiled with the CppUnit_EXPORTS
|
// from a DLL simpler. All files within this DLL are compiled with the CppUnit_EXPORTS
|
||||||
// symbol defined on the command line. this symbol should not be defined on any project
|
// symbol defined on the command line. this symbol should not be defined on any project
|
||||||
// that uses this DLL. This way any other project whose source files include this file see
|
// that uses this DLL. This way any other project whose source files include this file see
|
||||||
// CppUnit_API functions as being imported from a DLL, wheras this DLL sees symbols
|
// CppUnit_API functions as being imported from a DLL, wheras this DLL sees symbols
|
||||||
// defined with this macro as being exported.
|
// defined with this macro as being exported.
|
||||||
//
|
//
|
||||||
#if defined(_WIN32) && defined(POCO_DLL)
|
#if defined(_WIN32) && defined(POCO_DLL)
|
||||||
#if defined(CppUnit_EXPORTS)
|
#if defined(CppUnit_EXPORTS)
|
||||||
#define CppUnit_API __declspec(dllexport)
|
#define CppUnit_API __declspec(dllexport)
|
||||||
#else
|
#else
|
||||||
#define CppUnit_API __declspec(dllimport)
|
#define CppUnit_API __declspec(dllimport)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if !defined(CppUnit_API)
|
#if !defined(CppUnit_API)
|
||||||
#define CppUnit_API
|
#define CppUnit_API
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// Turn off some annoying warnings
|
// Turn off some annoying warnings
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(disable:4786) // identifier truncation warning
|
#pragma warning(disable:4786) // identifier truncation warning
|
||||||
#pragma warning(disable:4503) // decorated name length exceeded - mainly a problem with STLPort
|
#pragma warning(disable:4503) // decorated name length exceeded - mainly a problem with STLPort
|
||||||
#pragma warning(disable:4018) // signed/unsigned comparison
|
#pragma warning(disable:4018) // signed/unsigned comparison
|
||||||
#pragma warning(disable:4284) // return type for operator -> is not UDT
|
#pragma warning(disable:4284) // return type for operator -> is not UDT
|
||||||
#pragma warning(disable:4251) // ... needs to have dll-interface warning
|
#pragma warning(disable:4251) // ... needs to have dll-interface warning
|
||||||
#pragma warning(disable:4273)
|
#pragma warning(disable:4273)
|
||||||
#pragma warning(disable:4275) // ... non dll-interface class used as base for dll-interface class
|
#pragma warning(disable:4275) // ... non dll-interface class used as base for dll-interface class
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif // CppUnit_CppUnit_INCLUDED
|
#endif // CppUnit_CppUnit_INCLUDED
|
||||||
|
|||||||
@@ -1,141 +1,141 @@
|
|||||||
//
|
//
|
||||||
// CppUnitException.h
|
// CppUnitException.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/include/CppUnit/CppUnitException.h#1 $
|
// $Id: //poco/1.2/CppUnit/include/CppUnit/CppUnitException.h#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef CppUnit_CppUnitException_INCLUDED
|
#ifndef CppUnit_CppUnitException_INCLUDED
|
||||||
#define CppUnit_CppUnitException_INCLUDED
|
#define CppUnit_CppUnitException_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/CppUnit.h"
|
#include "CppUnit/CppUnit.h"
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
class CppUnit_API CppUnitException: public std::exception
|
class CppUnit_API CppUnitException: public std::exception
|
||||||
/// CppUnitException is an exception that serves
|
/// CppUnitException is an exception that serves
|
||||||
/// descriptive strings through its what() method
|
/// descriptive strings through its what() method
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CppUnitException(const std::string& message = "",
|
CppUnitException(const std::string& message = "",
|
||||||
long lineNumber = CPPUNIT_UNKNOWNLINENUMBER,
|
long lineNumber = CPPUNIT_UNKNOWNLINENUMBER,
|
||||||
const std::string& fileName = CPPUNIT_UNKNOWNFILENAME);
|
const std::string& fileName = CPPUNIT_UNKNOWNFILENAME);
|
||||||
CppUnitException(const std::string& message,
|
CppUnitException(const std::string& message,
|
||||||
long lineNumber,
|
long lineNumber,
|
||||||
long data1lineNumber,
|
long data1lineNumber,
|
||||||
const std::string& fileName);
|
const std::string& fileName);
|
||||||
CppUnitException(const std::string& message,
|
CppUnitException(const std::string& message,
|
||||||
long lineNumber,
|
long lineNumber,
|
||||||
long data1lineNumber,
|
long data1lineNumber,
|
||||||
long data2lineNumber,
|
long data2lineNumber,
|
||||||
const std::string& fileName);
|
const std::string& fileName);
|
||||||
CppUnitException(const CppUnitException& other);
|
CppUnitException(const CppUnitException& other);
|
||||||
virtual ~CppUnitException() throw();
|
virtual ~CppUnitException() throw();
|
||||||
|
|
||||||
CppUnitException& operator = (const CppUnitException& other);
|
CppUnitException& operator = (const CppUnitException& other);
|
||||||
|
|
||||||
const char* what() const throw ();
|
const char* what() const throw ();
|
||||||
|
|
||||||
long lineNumber() const;
|
long lineNumber() const;
|
||||||
long data1LineNumber() const;
|
long data1LineNumber() const;
|
||||||
long data2LineNumber() const;
|
long data2LineNumber() const;
|
||||||
const std::string& fileName() const;
|
const std::string& fileName() const;
|
||||||
|
|
||||||
static const std::string CPPUNIT_UNKNOWNFILENAME;
|
static const std::string CPPUNIT_UNKNOWNFILENAME;
|
||||||
static const int CPPUNIT_UNKNOWNLINENUMBER;
|
static const int CPPUNIT_UNKNOWNLINENUMBER;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string _message;
|
std::string _message;
|
||||||
long _lineNumber;
|
long _lineNumber;
|
||||||
long _data1lineNumber;
|
long _data1lineNumber;
|
||||||
long _data2lineNumber;
|
long _data2lineNumber;
|
||||||
std::string _fileName;
|
std::string _fileName;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
inline CppUnitException::CppUnitException(const CppUnitException& other): exception (other)
|
inline CppUnitException::CppUnitException(const CppUnitException& other): exception (other)
|
||||||
{
|
{
|
||||||
_message = other._message;
|
_message = other._message;
|
||||||
_lineNumber = other._lineNumber;
|
_lineNumber = other._lineNumber;
|
||||||
_data1lineNumber = other._data1lineNumber;
|
_data1lineNumber = other._data1lineNumber;
|
||||||
_data2lineNumber = other._data2lineNumber;
|
_data2lineNumber = other._data2lineNumber;
|
||||||
_fileName = other._fileName;
|
_fileName = other._fileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline CppUnitException::CppUnitException (const std::string& message, long lineNumber, const std::string& fileName): _message(message), _lineNumber(lineNumber), _data1lineNumber(CPPUNIT_UNKNOWNLINENUMBER), _data2lineNumber(CPPUNIT_UNKNOWNLINENUMBER), _fileName(fileName)
|
inline CppUnitException::CppUnitException (const std::string& message, long lineNumber, const std::string& fileName): _message(message), _lineNumber(lineNumber), _data1lineNumber(CPPUNIT_UNKNOWNLINENUMBER), _data2lineNumber(CPPUNIT_UNKNOWNLINENUMBER), _fileName(fileName)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline CppUnitException::CppUnitException (const std::string& message, long lineNumber, long data1lineNumber, const std::string& fileName): _message(message), _lineNumber(lineNumber), _data1lineNumber(data1lineNumber), _data2lineNumber(CPPUNIT_UNKNOWNLINENUMBER), _fileName(fileName)
|
inline CppUnitException::CppUnitException (const std::string& message, long lineNumber, long data1lineNumber, const std::string& fileName): _message(message), _lineNumber(lineNumber), _data1lineNumber(data1lineNumber), _data2lineNumber(CPPUNIT_UNKNOWNLINENUMBER), _fileName(fileName)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline CppUnitException::CppUnitException (const std::string& message, long lineNumber, long data1lineNumber, long data2lineNumber, const std::string& fileName): _message(message), _lineNumber(lineNumber), _data1lineNumber(data1lineNumber), _data2lineNumber(data2lineNumber), _fileName(fileName)
|
inline CppUnitException::CppUnitException (const std::string& message, long lineNumber, long data1lineNumber, long data2lineNumber, const std::string& fileName): _message(message), _lineNumber(lineNumber), _data1lineNumber(data1lineNumber), _data2lineNumber(data2lineNumber), _fileName(fileName)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline CppUnitException::~CppUnitException () throw()
|
inline CppUnitException::~CppUnitException () throw()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline CppUnitException& CppUnitException::operator = (const CppUnitException& other)
|
inline CppUnitException& CppUnitException::operator = (const CppUnitException& other)
|
||||||
{
|
{
|
||||||
exception::operator= (other);
|
exception::operator= (other);
|
||||||
|
|
||||||
if (&other != this)
|
if (&other != this)
|
||||||
{
|
{
|
||||||
_message = other._message;
|
_message = other._message;
|
||||||
_lineNumber = other._lineNumber;
|
_lineNumber = other._lineNumber;
|
||||||
_data1lineNumber = other._data1lineNumber;
|
_data1lineNumber = other._data1lineNumber;
|
||||||
_data2lineNumber = other._data2lineNumber;
|
_data2lineNumber = other._data2lineNumber;
|
||||||
_fileName = other._fileName;
|
_fileName = other._fileName;
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const char* CppUnitException::what() const throw ()
|
inline const char* CppUnitException::what() const throw ()
|
||||||
{
|
{
|
||||||
return _message.c_str();
|
return _message.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline long CppUnitException::lineNumber() const
|
inline long CppUnitException::lineNumber() const
|
||||||
{
|
{
|
||||||
return _lineNumber;
|
return _lineNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline long CppUnitException::data1LineNumber() const
|
inline long CppUnitException::data1LineNumber() const
|
||||||
{
|
{
|
||||||
return _data1lineNumber;
|
return _data1lineNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline long CppUnitException::data2LineNumber() const
|
inline long CppUnitException::data2LineNumber() const
|
||||||
{
|
{
|
||||||
return _data2lineNumber;
|
return _data2lineNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// The file in which the error occurred
|
// The file in which the error occurred
|
||||||
inline const std::string& CppUnitException::fileName() const
|
inline const std::string& CppUnitException::fileName() const
|
||||||
{
|
{
|
||||||
return _fileName;
|
return _fileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|
||||||
|
|
||||||
#endif // CppUnit_CppUnitException_INCLUDED
|
#endif // CppUnit_CppUnitException_INCLUDED
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
//
|
//
|
||||||
// Guards.h
|
// Guards.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/include/CppUnit/Guards.h#1 $
|
// $Id: //poco/1.2/CppUnit/include/CppUnit/Guards.h#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef CppUnit_Guards_INCLUDED
|
#ifndef CppUnit_Guards_INCLUDED
|
||||||
#define CppUnit_Guards_INCLUDED
|
#define CppUnit_Guards_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
// Prevent copy construction and assignment for a class
|
// Prevent copy construction and assignment for a class
|
||||||
#define REFERENCEOBJECT(className) \
|
#define REFERENCEOBJECT(className) \
|
||||||
private: \
|
private: \
|
||||||
className(const className& other); \
|
className(const className& other); \
|
||||||
className& operator = (const className& other);
|
className& operator = (const className& other);
|
||||||
|
|
||||||
|
|
||||||
#endif // CppUnit_Guards_INCLUDED
|
#endif // CppUnit_Guards_INCLUDED
|
||||||
|
|||||||
@@ -1,105 +1,105 @@
|
|||||||
//
|
//
|
||||||
// Orthodox.h
|
// Orthodox.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/include/CppUnit/Orthodox.h#1 $
|
// $Id: //poco/1.2/CppUnit/include/CppUnit/Orthodox.h#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef CppUnit_Orthodox_INCLUDED
|
#ifndef CppUnit_Orthodox_INCLUDED
|
||||||
#define CppUnit_Orthodox_INCLUDED
|
#define CppUnit_Orthodox_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/CppUnit.h"
|
#include "CppUnit/CppUnit.h"
|
||||||
#include "CppUnit/TestCase.h"
|
#include "CppUnit/TestCase.h"
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Orthodox performs a simple set of tests on an arbitary
|
* Orthodox performs a simple set of tests on an arbitary
|
||||||
* class to make sure that it supports at least the
|
* class to make sure that it supports at least the
|
||||||
* following operations:
|
* following operations:
|
||||||
*
|
*
|
||||||
* default construction - constructor
|
* default construction - constructor
|
||||||
* equality/inequality - operator== && operator!=
|
* equality/inequality - operator== && operator!=
|
||||||
* assignment - operator=
|
* assignment - operator=
|
||||||
* negation - operator!
|
* negation - operator!
|
||||||
* safe passage - copy construction
|
* safe passage - copy construction
|
||||||
*
|
*
|
||||||
* If operations for each of these are not declared
|
* If operations for each of these are not declared
|
||||||
* the template will not instantiate. If it does
|
* the template will not instantiate. If it does
|
||||||
* instantiate, tests are performed to make sure
|
* instantiate, tests are performed to make sure
|
||||||
* that the operations have correct semantics.
|
* that the operations have correct semantics.
|
||||||
*
|
*
|
||||||
* Adding an orthodox test to a suite is very
|
* Adding an orthodox test to a suite is very
|
||||||
* easy:
|
* easy:
|
||||||
*
|
*
|
||||||
* public: Test *suite () {
|
* public: Test *suite () {
|
||||||
* TestSuite *suiteOfTests = new TestSuite;
|
* TestSuite *suiteOfTests = new TestSuite;
|
||||||
* suiteOfTests->addTest (new ComplexNumberTest ("testAdd");
|
* suiteOfTests->addTest (new ComplexNumberTest ("testAdd");
|
||||||
* suiteOfTests->addTest (new TestCaller<Orthodox<Complex> > ());
|
* suiteOfTests->addTest (new TestCaller<Orthodox<Complex> > ());
|
||||||
* return suiteOfTests;
|
* return suiteOfTests;
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* Templated test cases be very useful when you are want to
|
* Templated test cases be very useful when you are want to
|
||||||
* make sure that a group of classes have the same form.
|
* make sure that a group of classes have the same form.
|
||||||
*
|
*
|
||||||
* see TestSuite
|
* see TestSuite
|
||||||
*/
|
*/
|
||||||
template <class ClassUnderTest>
|
template <class ClassUnderTest>
|
||||||
class Orthodox: public TestCase
|
class Orthodox: public TestCase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Orthodox(): TestCase("Orthodox")
|
Orthodox(): TestCase("Orthodox")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ClassUnderTest call(ClassUnderTest object);
|
ClassUnderTest call(ClassUnderTest object);
|
||||||
void runTest ();
|
void runTest ();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Run an orthodoxy test
|
// Run an orthodoxy test
|
||||||
template <class ClassUnderTest>
|
template <class ClassUnderTest>
|
||||||
void Orthodox<ClassUnderTest>::runTest()
|
void Orthodox<ClassUnderTest>::runTest()
|
||||||
{
|
{
|
||||||
// make sure we have a default constructor
|
// make sure we have a default constructor
|
||||||
ClassUnderTest a, b, c;
|
ClassUnderTest a, b, c;
|
||||||
|
|
||||||
// make sure we have an equality operator
|
// make sure we have an equality operator
|
||||||
assert (a == b);
|
assert (a == b);
|
||||||
|
|
||||||
// check the inverse
|
// check the inverse
|
||||||
b.operator= (a.operator! ());
|
b.operator= (a.operator! ());
|
||||||
assert (a != b);
|
assert (a != b);
|
||||||
|
|
||||||
// double inversion
|
// double inversion
|
||||||
b = !!a;
|
b = !!a;
|
||||||
assert (a == b);
|
assert (a == b);
|
||||||
|
|
||||||
// invert again
|
// invert again
|
||||||
b = !a;
|
b = !a;
|
||||||
|
|
||||||
// check calls
|
// check calls
|
||||||
c = a;
|
c = a;
|
||||||
assert (c == call (a));
|
assert (c == call (a));
|
||||||
|
|
||||||
c = b;
|
c = b;
|
||||||
assert (c == call (b));
|
assert (c == call (b));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Exercise a call
|
// Exercise a call
|
||||||
template <class ClassUnderTest>
|
template <class ClassUnderTest>
|
||||||
ClassUnderTest Orthodox<ClassUnderTest>::call(ClassUnderTest object)
|
ClassUnderTest Orthodox<ClassUnderTest>::call(ClassUnderTest object)
|
||||||
{
|
{
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|
||||||
|
|
||||||
#endif // CppUnit_Orthodox_INCLUDED
|
#endif // CppUnit_Orthodox_INCLUDED
|
||||||
|
|||||||
@@ -1,77 +1,77 @@
|
|||||||
//
|
//
|
||||||
// RepeatedTest.h
|
// RepeatedTest.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/include/CppUnit/RepeatedTest.h#1 $
|
// $Id: //poco/1.2/CppUnit/include/CppUnit/RepeatedTest.h#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef CppUnit_RepeatedTest_INCLUDED
|
#ifndef CppUnit_RepeatedTest_INCLUDED
|
||||||
#define CppUnit_RepeatedTest_INCLUDED
|
#define CppUnit_RepeatedTest_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/CppUnit.h"
|
#include "CppUnit/CppUnit.h"
|
||||||
#include "CppUnit/Guards.h"
|
#include "CppUnit/Guards.h"
|
||||||
#include "CppUnit/TestDecorator.h"
|
#include "CppUnit/TestDecorator.h"
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
class Test;
|
class Test;
|
||||||
class TestResult;
|
class TestResult;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A decorator that runs a test repeatedly.
|
* A decorator that runs a test repeatedly.
|
||||||
* Does not assume ownership of the test it decorates
|
* Does not assume ownership of the test it decorates
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class CppUnit_API RepeatedTest: public TestDecorator
|
class CppUnit_API RepeatedTest: public TestDecorator
|
||||||
{
|
{
|
||||||
REFERENCEOBJECT (RepeatedTest)
|
REFERENCEOBJECT (RepeatedTest)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RepeatedTest(Test* test, int timesRepeat): TestDecorator (test), _timesRepeat (timesRepeat)
|
RepeatedTest(Test* test, int timesRepeat): TestDecorator (test), _timesRepeat (timesRepeat)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
int countTestCases();
|
int countTestCases();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
void run(TestResult *result);
|
void run(TestResult *result);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const int _timesRepeat;
|
const int _timesRepeat;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Counts the number of test cases that will be run by this test.
|
// Counts the number of test cases that will be run by this test.
|
||||||
inline RepeatedTest::countTestCases ()
|
inline RepeatedTest::countTestCases ()
|
||||||
{
|
{
|
||||||
return TestDecorator::countTestCases() * _timesRepeat;
|
return TestDecorator::countTestCases() * _timesRepeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Returns the name of the test instance.
|
// Returns the name of the test instance.
|
||||||
inline std::string RepeatedTest::toString()
|
inline std::string RepeatedTest::toString()
|
||||||
{
|
{
|
||||||
return TestDecorator::toString() + " (repeated)";
|
return TestDecorator::toString() + " (repeated)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Runs a repeated test
|
// Runs a repeated test
|
||||||
inline void RepeatedTest::run(TestResult *result)
|
inline void RepeatedTest::run(TestResult *result)
|
||||||
{
|
{
|
||||||
for (int n = 0; n < _timesRepeat; n++)
|
for (int n = 0; n < _timesRepeat; n++)
|
||||||
{
|
{
|
||||||
if (result->shouldStop())
|
if (result->shouldStop())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
TestDecorator::run(result);
|
TestDecorator::run(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|
||||||
|
|
||||||
#endif // CppUnit_RepeatedTest_INCLUDED
|
#endif // CppUnit_RepeatedTest_INCLUDED
|
||||||
|
|||||||
@@ -1,65 +1,65 @@
|
|||||||
//
|
//
|
||||||
// Test.h
|
// Test.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/include/CppUnit/Test.h#1 $
|
// $Id: //poco/1.2/CppUnit/include/CppUnit/Test.h#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef CppUnit_Test_INCLUDED
|
#ifndef CppUnit_Test_INCLUDED
|
||||||
#define CppUnit_Test_INCLUDED
|
#define CppUnit_Test_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/CppUnit.h"
|
#include "CppUnit/CppUnit.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
class TestResult;
|
class TestResult;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A Test can be run and collect its results.
|
* A Test can be run and collect its results.
|
||||||
* See TestResult.
|
* See TestResult.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class CppUnit_API Test
|
class CppUnit_API Test
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~Test() = 0;
|
virtual ~Test() = 0;
|
||||||
virtual void run(TestResult* result) = 0;
|
virtual void run(TestResult* result) = 0;
|
||||||
virtual int countTestCases() = 0;
|
virtual int countTestCases() = 0;
|
||||||
virtual std::string toString() = 0;
|
virtual std::string toString() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
inline Test::~Test()
|
inline Test::~Test()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Runs a test and collects its result in a TestResult instance.
|
// Runs a test and collects its result in a TestResult instance.
|
||||||
inline void Test::run(TestResult *result)
|
inline void Test::run(TestResult *result)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Counts the number of test cases that will be run by this test.
|
// Counts the number of test cases that will be run by this test.
|
||||||
inline int Test::countTestCases()
|
inline int Test::countTestCases()
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Returns the name of the test instance.
|
// Returns the name of the test instance.
|
||||||
inline std::string Test::toString()
|
inline std::string Test::toString()
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|
||||||
|
|
||||||
#endif // CppUnit_Test_INCLUDED
|
#endif // CppUnit_Test_INCLUDED
|
||||||
|
|||||||
@@ -1,95 +1,95 @@
|
|||||||
//
|
//
|
||||||
// TestCaller.h
|
// TestCaller.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestCaller.h#1 $
|
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestCaller.h#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef CppUnit_TestCaller_INCLUDED
|
#ifndef CppUnit_TestCaller_INCLUDED
|
||||||
#define CppUnit_TestCaller_INCLUDED
|
#define CppUnit_TestCaller_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/CppUnit.h"
|
#include "CppUnit/CppUnit.h"
|
||||||
#include "Guards.h"
|
#include "Guards.h"
|
||||||
#include "TestCase.h"
|
#include "TestCase.h"
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A test caller provides access to a test case method
|
* A test caller provides access to a test case method
|
||||||
* on a test case class. Test callers are useful when
|
* on a test case class. Test callers are useful when
|
||||||
* you want to run an individual test or add it to a
|
* you want to run an individual test or add it to a
|
||||||
* suite.
|
* suite.
|
||||||
*
|
*
|
||||||
* Here is an example:
|
* Here is an example:
|
||||||
*
|
*
|
||||||
* class MathTest : public TestCase {
|
* class MathTest : public TestCase {
|
||||||
* ...
|
* ...
|
||||||
* public:
|
* public:
|
||||||
* void setUp ();
|
* void setUp ();
|
||||||
* void tearDown ();
|
* void tearDown ();
|
||||||
*
|
*
|
||||||
* void testAdd ();
|
* void testAdd ();
|
||||||
* void testSubtract ();
|
* void testSubtract ();
|
||||||
* };
|
* };
|
||||||
*
|
*
|
||||||
* Test *MathTest::suite () {
|
* Test *MathTest::suite () {
|
||||||
* TestSuite *suite = new TestSuite;
|
* TestSuite *suite = new TestSuite;
|
||||||
*
|
*
|
||||||
* suite->addTest (new TestCaller<MathTest> ("testAdd", testAdd));
|
* suite->addTest (new TestCaller<MathTest> ("testAdd", testAdd));
|
||||||
* return suite;
|
* return suite;
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* You can use a TestCaller to bind any test method on a TestCase
|
* You can use a TestCaller to bind any test method on a TestCase
|
||||||
* class, as long as it returns accepts void and returns void.
|
* class, as long as it returns accepts void and returns void.
|
||||||
*
|
*
|
||||||
* See TestCase
|
* See TestCase
|
||||||
*/
|
*/
|
||||||
template <class Fixture>
|
template <class Fixture>
|
||||||
class TestCaller: public TestCase
|
class TestCaller: public TestCase
|
||||||
{
|
{
|
||||||
REFERENCEOBJECT (TestCaller)
|
REFERENCEOBJECT (TestCaller)
|
||||||
|
|
||||||
typedef void (Fixture::*TestMethod)();
|
typedef void (Fixture::*TestMethod)();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TestCaller(const std::string& name, TestMethod test):
|
TestCaller(const std::string& name, TestMethod test):
|
||||||
TestCase(name),
|
TestCase(name),
|
||||||
_test(test),
|
_test(test),
|
||||||
_fixture(new Fixture(name))
|
_fixture(new Fixture(name))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void runTest()
|
void runTest()
|
||||||
{
|
{
|
||||||
(_fixture.get()->*_test)();
|
(_fixture.get()->*_test)();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setUp()
|
void setUp()
|
||||||
{
|
{
|
||||||
_fixture.get()->setUp();
|
_fixture.get()->setUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
void tearDown()
|
void tearDown()
|
||||||
{
|
{
|
||||||
_fixture.get()->tearDown();
|
_fixture.get()->tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TestMethod _test;
|
TestMethod _test;
|
||||||
std::auto_ptr<Fixture> _fixture;
|
std::auto_ptr<Fixture> _fixture;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|
||||||
|
|
||||||
#define CppUnit_addTest(suite, cls, mth) \
|
#define CppUnit_addTest(suite, cls, mth) \
|
||||||
suite->addTest(new CppUnit::TestCaller<cls>(#mth, &cls::mth))
|
suite->addTest(new CppUnit::TestCaller<cls>(#mth, &cls::mth))
|
||||||
|
|
||||||
|
|
||||||
#endif // CppUnit_TestCaller_INCLUDED
|
#endif // CppUnit_TestCaller_INCLUDED
|
||||||
|
|||||||
@@ -1,249 +1,249 @@
|
|||||||
//
|
//
|
||||||
// TestCase.h
|
// TestCase.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestCase.h#1 $
|
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestCase.h#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef CppUnit_TestCase_INCLUDED
|
#ifndef CppUnit_TestCase_INCLUDED
|
||||||
#define CppUnit_TestCase_INCLUDED
|
#define CppUnit_TestCase_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/CppUnit.h"
|
#include "CppUnit/CppUnit.h"
|
||||||
#include "CppUnit/Guards.h"
|
#include "CppUnit/Guards.h"
|
||||||
#include "CppUnit/Test.h"
|
#include "CppUnit/Test.h"
|
||||||
#include "CppUnit/CppUnitException.h"
|
#include "CppUnit/CppUnitException.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
class TestResult;
|
class TestResult;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A test case defines the fixture to run multiple tests. To define a test case
|
* A test case defines the fixture to run multiple tests. To define a test case
|
||||||
* 1) implement a subclass of TestCase
|
* 1) implement a subclass of TestCase
|
||||||
* 2) define instance variables that store the state of the fixture
|
* 2) define instance variables that store the state of the fixture
|
||||||
* 3) initialize the fixture state by overriding setUp
|
* 3) initialize the fixture state by overriding setUp
|
||||||
* 4) clean-up after a test by overriding tearDown.
|
* 4) clean-up after a test by overriding tearDown.
|
||||||
*
|
*
|
||||||
* Each test runs in its own fixture so there
|
* Each test runs in its own fixture so there
|
||||||
* can be no side effects among test runs.
|
* can be no side effects among test runs.
|
||||||
* Here is an example:
|
* Here is an example:
|
||||||
*
|
*
|
||||||
* class MathTest : public TestCase {
|
* class MathTest : public TestCase {
|
||||||
* protected: int m_value1;
|
* protected: int m_value1;
|
||||||
* protected: int m_value2;
|
* protected: int m_value2;
|
||||||
*
|
*
|
||||||
* public: MathTest (std::string name)
|
* public: MathTest (std::string name)
|
||||||
* : TestCase (name) {
|
* : TestCase (name) {
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* protected: void setUp () {
|
* protected: void setUp () {
|
||||||
* m_value1 = 2;
|
* m_value1 = 2;
|
||||||
* m_value2 = 3;
|
* m_value2 = 3;
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* For each test implement a method which interacts
|
* For each test implement a method which interacts
|
||||||
* with the fixture. Verify the expected results with assertions specified
|
* with the fixture. Verify the expected results with assertions specified
|
||||||
* by calling assert on the expression you want to test:
|
* by calling assert on the expression you want to test:
|
||||||
*
|
*
|
||||||
* protected: void testAdd () {
|
* protected: void testAdd () {
|
||||||
* int result = value1 + value2;
|
* int result = value1 + value2;
|
||||||
* assert (result == 5);
|
* assert (result == 5);
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* Once the methods are defined you can run them. To do this, use
|
* Once the methods are defined you can run them. To do this, use
|
||||||
* a TestCaller.
|
* a TestCaller.
|
||||||
*
|
*
|
||||||
* Test *test = new TestCaller<MathTest>("testAdd", MathTest::testAdd);
|
* Test *test = new TestCaller<MathTest>("testAdd", MathTest::testAdd);
|
||||||
* test->run ();
|
* test->run ();
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* The tests to be run can be collected into a TestSuite. CppUnit provides
|
* The tests to be run can be collected into a TestSuite. CppUnit provides
|
||||||
* different test runners which can run a test suite and collect the results.
|
* different test runners which can run a test suite and collect the results.
|
||||||
* The test runners expect a static method suite as the entry
|
* The test runners expect a static method suite as the entry
|
||||||
* point to get a test to run.
|
* point to get a test to run.
|
||||||
*
|
*
|
||||||
* public: static MathTest::suite () {
|
* public: static MathTest::suite () {
|
||||||
* TestSuite *suiteOfTests = new TestSuite;
|
* TestSuite *suiteOfTests = new TestSuite;
|
||||||
* suiteOfTests->addTest(new TestCaller<MathTest>("testAdd", testAdd));
|
* suiteOfTests->addTest(new TestCaller<MathTest>("testAdd", testAdd));
|
||||||
* suiteOfTests->addTest(new TestCaller<MathTest>("testDivideByZero", testDivideByZero));
|
* suiteOfTests->addTest(new TestCaller<MathTest>("testDivideByZero", testDivideByZero));
|
||||||
* return suiteOfTests;
|
* return suiteOfTests;
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* Note that the caller of suite assumes lifetime control
|
* Note that the caller of suite assumes lifetime control
|
||||||
* for the returned suite.
|
* for the returned suite.
|
||||||
*
|
*
|
||||||
* see TestResult, TestSuite and TestCaller
|
* see TestResult, TestSuite and TestCaller
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class CppUnit_API TestCase: public Test
|
class CppUnit_API TestCase: public Test
|
||||||
{
|
{
|
||||||
REFERENCEOBJECT (TestCase)
|
REFERENCEOBJECT (TestCase)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TestCase(const std::string& Name);
|
TestCase(const std::string& Name);
|
||||||
~TestCase();
|
~TestCase();
|
||||||
|
|
||||||
virtual void run(TestResult* result);
|
virtual void run(TestResult* result);
|
||||||
virtual TestResult* run();
|
virtual TestResult* run();
|
||||||
virtual int countTestCases();
|
virtual int countTestCases();
|
||||||
const std::string& name() const;
|
const std::string& name() const;
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
virtual void setUp();
|
virtual void setUp();
|
||||||
virtual void tearDown();
|
virtual void tearDown();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void runTest();
|
virtual void runTest();
|
||||||
TestResult* defaultResult();
|
TestResult* defaultResult();
|
||||||
|
|
||||||
void assertImplementation(bool condition,
|
void assertImplementation(bool condition,
|
||||||
const std::string& conditionExpression = "",
|
const std::string& conditionExpression = "",
|
||||||
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
||||||
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
|
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
|
||||||
|
|
||||||
void loop1assertImplementation(bool condition,
|
void loop1assertImplementation(bool condition,
|
||||||
const std::string& conditionExpression = "",
|
const std::string& conditionExpression = "",
|
||||||
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
||||||
long dataLineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
long dataLineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
||||||
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
|
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
|
||||||
|
|
||||||
void loop2assertImplementation(bool condition,
|
void loop2assertImplementation(bool condition,
|
||||||
const std::string& conditionExpression = "",
|
const std::string& conditionExpression = "",
|
||||||
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
||||||
long data1LineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
long data1LineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
||||||
long data2LineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
long data2LineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
||||||
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
|
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
|
||||||
|
|
||||||
void assertEquals(long expected,
|
void assertEquals(long expected,
|
||||||
long actual,
|
long actual,
|
||||||
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
||||||
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
|
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
|
||||||
|
|
||||||
void assertEquals(double expected,
|
void assertEquals(double expected,
|
||||||
double actual,
|
double actual,
|
||||||
double delta,
|
double delta,
|
||||||
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
||||||
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
|
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
|
||||||
|
|
||||||
void assertEquals(const std::string& expected,
|
void assertEquals(const std::string& expected,
|
||||||
const std::string& actual,
|
const std::string& actual,
|
||||||
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
||||||
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
|
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
|
||||||
|
|
||||||
void assertEquals(const void* expected,
|
void assertEquals(const void* expected,
|
||||||
const void* actual,
|
const void* actual,
|
||||||
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
||||||
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
|
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
|
||||||
|
|
||||||
std::string notEqualsMessage(long expected, long actual);
|
std::string notEqualsMessage(long expected, long actual);
|
||||||
std::string notEqualsMessage(double expected, double actual);
|
std::string notEqualsMessage(double expected, double actual);
|
||||||
std::string notEqualsMessage(const void* expected, const void* actual);
|
std::string notEqualsMessage(const void* expected, const void* actual);
|
||||||
std::string notEqualsMessage(const std::string& expected, const std::string& actual);
|
std::string notEqualsMessage(const std::string& expected, const std::string& actual);
|
||||||
|
|
||||||
void assertNotNull(const void* pointer,
|
void assertNotNull(const void* pointer,
|
||||||
const std::string& pointerExpression = "",
|
const std::string& pointerExpression = "",
|
||||||
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
||||||
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
|
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
|
||||||
|
|
||||||
void assertNull(const void* pointer,
|
void assertNull(const void* pointer,
|
||||||
const std::string& pointerExpression = "",
|
const std::string& pointerExpression = "",
|
||||||
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
||||||
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
|
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
|
||||||
|
|
||||||
void fail(const std::string&message = "",
|
void fail(const std::string&message = "",
|
||||||
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER,
|
||||||
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
|
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const std::string _name;
|
const std::string _name;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Constructs a test case
|
// Constructs a test case
|
||||||
inline TestCase::TestCase(const std::string& name): _name (name)
|
inline TestCase::TestCase(const std::string& name): _name (name)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Destructs a test case
|
// Destructs a test case
|
||||||
inline TestCase::~TestCase()
|
inline TestCase::~TestCase()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Returns a count of all the tests executed
|
// Returns a count of all the tests executed
|
||||||
inline int TestCase::countTestCases()
|
inline int TestCase::countTestCases()
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Returns the name of the test case
|
// Returns the name of the test case
|
||||||
inline const std::string& TestCase::name() const
|
inline const std::string& TestCase::name() const
|
||||||
{
|
{
|
||||||
return _name;
|
return _name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// A hook for fixture set up
|
// A hook for fixture set up
|
||||||
inline void TestCase::setUp()
|
inline void TestCase::setUp()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// A hook for fixture tear down
|
// A hook for fixture tear down
|
||||||
inline void TestCase::tearDown()
|
inline void TestCase::tearDown()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Returns the name of the test case instance
|
// Returns the name of the test case instance
|
||||||
inline std::string TestCase::toString()
|
inline std::string TestCase::toString()
|
||||||
{
|
{
|
||||||
const std::type_info& thisClass = typeid(*this);
|
const std::type_info& thisClass = typeid(*this);
|
||||||
return std::string(thisClass.name()) + "." + name();
|
return std::string(thisClass.name()) + "." + name();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// A set of macros which allow us to get the line number
|
// A set of macros which allow us to get the line number
|
||||||
// and file name at the point of an error.
|
// and file name at the point of an error.
|
||||||
// Just goes to show that preprocessors do have some
|
// Just goes to show that preprocessors do have some
|
||||||
// redeeming qualities.
|
// redeeming qualities.
|
||||||
#undef assert
|
#undef assert
|
||||||
#define assert(condition) \
|
#define assert(condition) \
|
||||||
(this->assertImplementation((condition), (#condition), __LINE__, __FILE__))
|
(this->assertImplementation((condition), (#condition), __LINE__, __FILE__))
|
||||||
|
|
||||||
#define loop_1_assert(data1line, condition) \
|
#define loop_1_assert(data1line, condition) \
|
||||||
(this->loop1assertImplementation((condition), (#condition), __LINE__, data1line, __FILE__))
|
(this->loop1assertImplementation((condition), (#condition), __LINE__, data1line, __FILE__))
|
||||||
|
|
||||||
#define loop_2_assert(data1line, data2line, condition) \
|
#define loop_2_assert(data1line, data2line, condition) \
|
||||||
(this->loop2assertImplementation((condition), (#condition), __LINE__, data1line, data2line, __FILE__))
|
(this->loop2assertImplementation((condition), (#condition), __LINE__, data1line, data2line, __FILE__))
|
||||||
|
|
||||||
#define assertEqualDelta(expected, actual, delta) \
|
#define assertEqualDelta(expected, actual, delta) \
|
||||||
(this->assertEquals((expected), (actual), (delta), __LINE__, __FILE__))
|
(this->assertEquals((expected), (actual), (delta), __LINE__, __FILE__))
|
||||||
|
|
||||||
#define assertEqual(expected, actual) \
|
#define assertEqual(expected, actual) \
|
||||||
(this->assertEquals((expected), (actual), __LINE__, __FILE__))
|
(this->assertEquals((expected), (actual), __LINE__, __FILE__))
|
||||||
|
|
||||||
#define assertNullPtr(ptr) \
|
#define assertNullPtr(ptr) \
|
||||||
(this->assertNull((ptr), #ptr, __LINE__, __FILE__))
|
(this->assertNull((ptr), #ptr, __LINE__, __FILE__))
|
||||||
|
|
||||||
#define assertNotNullPtr(ptr) \
|
#define assertNotNullPtr(ptr) \
|
||||||
(this->assertNotNull((ptr), #ptr, __LINE__, __FILE__))
|
(this->assertNotNull((ptr), #ptr, __LINE__, __FILE__))
|
||||||
|
|
||||||
#define failmsg(msg) \
|
#define failmsg(msg) \
|
||||||
(this->fail(msg, __LINE__, __FILE__))
|
(this->fail(msg, __LINE__, __FILE__))
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|
||||||
|
|
||||||
#endif // CppUnit_TestCase_INCLUDED
|
#endif // CppUnit_TestCase_INCLUDED
|
||||||
|
|||||||
@@ -1,52 +1,52 @@
|
|||||||
//
|
//
|
||||||
// TestDecorator.h
|
// TestDecorator.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestDecorator.h#1 $
|
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestDecorator.h#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef CppUnit_TestDecorator_INCLUDED
|
#ifndef CppUnit_TestDecorator_INCLUDED
|
||||||
#define CppUnit_TestDecorator_INCLUDED
|
#define CppUnit_TestDecorator_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/CppUnit.h"
|
#include "CppUnit/CppUnit.h"
|
||||||
#include "CppUnit/Guards.h"
|
#include "CppUnit/Guards.h"
|
||||||
#include "CppUnit/Test.h"
|
#include "CppUnit/Test.h"
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
class TestResult;
|
class TestResult;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A Decorator for Tests
|
* A Decorator for Tests
|
||||||
*
|
*
|
||||||
* Does not assume ownership of the test it decorates
|
* Does not assume ownership of the test it decorates
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class CppUnit_API TestDecorator: public Test
|
class CppUnit_API TestDecorator: public Test
|
||||||
{
|
{
|
||||||
REFERENCEOBJECT(TestDecorator)
|
REFERENCEOBJECT(TestDecorator)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TestDecorator(Test* test);
|
TestDecorator(Test* test);
|
||||||
|
|
||||||
virtual ~TestDecorator();
|
virtual ~TestDecorator();
|
||||||
|
|
||||||
int countTestCases();
|
int countTestCases();
|
||||||
|
|
||||||
void run(TestResult* result);
|
void run(TestResult* result);
|
||||||
|
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Test* _test;
|
Test* _test;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|
||||||
|
|
||||||
#endif // CppUnit_TestDecorator_INCLUDED
|
#endif // CppUnit_TestDecorator_INCLUDED
|
||||||
|
|||||||
@@ -1,86 +1,86 @@
|
|||||||
//
|
//
|
||||||
// TestFailure.h
|
// TestFailure.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestFailure.h#1 $
|
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestFailure.h#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef CppUnit_TestFailure_INCLUDED
|
#ifndef CppUnit_TestFailure_INCLUDED
|
||||||
#define CppUnit_TestFailure_INCLUDED
|
#define CppUnit_TestFailure_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/CppUnit.h"
|
#include "CppUnit/CppUnit.h"
|
||||||
#include "CppUnit/CppUnitException.h"
|
#include "CppUnit/CppUnitException.h"
|
||||||
#include "CppUnit/Guards.h"
|
#include "CppUnit/Guards.h"
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
class Test;
|
class Test;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A TestFailure collects a failed test together with
|
* A TestFailure collects a failed test together with
|
||||||
* the caught exception.
|
* the caught exception.
|
||||||
*
|
*
|
||||||
* TestFailure assumes lifetime control for any exception
|
* TestFailure assumes lifetime control for any exception
|
||||||
* passed to it. The lifetime of tests is handled by
|
* passed to it. The lifetime of tests is handled by
|
||||||
* their TestSuite (if they have been added to one) or
|
* their TestSuite (if they have been added to one) or
|
||||||
* whomever creates them.
|
* whomever creates them.
|
||||||
*
|
*
|
||||||
* see TestResult
|
* see TestResult
|
||||||
* see TestSuite
|
* see TestSuite
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class CppUnit_API TestFailure
|
class CppUnit_API TestFailure
|
||||||
{
|
{
|
||||||
REFERENCEOBJECT (TestFailure)
|
REFERENCEOBJECT (TestFailure)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TestFailure(Test* failedTest, CppUnitException* thrownException);
|
TestFailure(Test* failedTest, CppUnitException* thrownException);
|
||||||
~TestFailure();
|
~TestFailure();
|
||||||
|
|
||||||
Test* failedTest();
|
Test* failedTest();
|
||||||
CppUnitException* thrownException();
|
CppUnitException* thrownException();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Test* _failedTest;
|
Test* _failedTest;
|
||||||
CppUnitException *_thrownException;
|
CppUnitException *_thrownException;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Constructs a TestFailure with the given test and exception.
|
// Constructs a TestFailure with the given test and exception.
|
||||||
inline TestFailure::TestFailure(Test* failedTest, CppUnitException* thrownException): _failedTest(failedTest), _thrownException(thrownException)
|
inline TestFailure::TestFailure(Test* failedTest, CppUnitException* thrownException): _failedTest(failedTest), _thrownException(thrownException)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Deletes the owned exception.
|
// Deletes the owned exception.
|
||||||
inline TestFailure::~TestFailure()
|
inline TestFailure::~TestFailure()
|
||||||
{
|
{
|
||||||
delete _thrownException;
|
delete _thrownException;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Gets the failed test.
|
// Gets the failed test.
|
||||||
inline Test* TestFailure::failedTest()
|
inline Test* TestFailure::failedTest()
|
||||||
{
|
{
|
||||||
return _failedTest;
|
return _failedTest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Gets the thrown exception.
|
// Gets the thrown exception.
|
||||||
inline CppUnitException* TestFailure::thrownException()
|
inline CppUnitException* TestFailure::thrownException()
|
||||||
{
|
{
|
||||||
return _thrownException;
|
return _thrownException;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|
||||||
|
|
||||||
#endif // CppUnit_TestFailure_INCLUDED
|
#endif // CppUnit_TestFailure_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,231 +1,231 @@
|
|||||||
//
|
//
|
||||||
// TestResult.h
|
// TestResult.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestResult.h#1 $
|
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestResult.h#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef CppUnit_TestResult_INCLUDED
|
#ifndef CppUnit_TestResult_INCLUDED
|
||||||
#define CppUnit_TestResult_INCLUDED
|
#define CppUnit_TestResult_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/CppUnit.h"
|
#include "CppUnit/CppUnit.h"
|
||||||
#include "CppUnit/Guards.h"
|
#include "CppUnit/Guards.h"
|
||||||
#include "CppUnit/TestFailure.h"
|
#include "CppUnit/TestFailure.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
class CppUnitException;
|
class CppUnitException;
|
||||||
class Test;
|
class Test;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A TestResult collects the results of executing a test case. It is an
|
* A TestResult collects the results of executing a test case. It is an
|
||||||
* instance of the Collecting Parameter pattern.
|
* instance of the Collecting Parameter pattern.
|
||||||
*
|
*
|
||||||
* The test framework distinguishes between failures and errors.
|
* The test framework distinguishes between failures and errors.
|
||||||
* A failure is anticipated and checked for with assertions. Errors are
|
* A failure is anticipated and checked for with assertions. Errors are
|
||||||
* unanticipated problems signified by exceptions that are not generated
|
* unanticipated problems signified by exceptions that are not generated
|
||||||
* by the framework.
|
* by the framework.
|
||||||
*
|
*
|
||||||
* TestResult supplies a template method 'setSynchronizationObject ()'
|
* TestResult supplies a template method 'setSynchronizationObject ()'
|
||||||
* so that subclasses can provide mutual exclusion in the face of multiple
|
* so that subclasses can provide mutual exclusion in the face of multiple
|
||||||
* threads. This can be useful when tests execute in one thread and
|
* threads. This can be useful when tests execute in one thread and
|
||||||
* they fill a subclass of TestResult which effects change in another
|
* they fill a subclass of TestResult which effects change in another
|
||||||
* thread. To have mutual exclusion, override setSynchronizationObject ()
|
* thread. To have mutual exclusion, override setSynchronizationObject ()
|
||||||
* and make sure that you create an instance of ExclusiveZone at the
|
* and make sure that you create an instance of ExclusiveZone at the
|
||||||
* beginning of each method.
|
* beginning of each method.
|
||||||
*
|
*
|
||||||
* see Test
|
* see Test
|
||||||
*/
|
*/
|
||||||
class CppUnit_API TestResult
|
class CppUnit_API TestResult
|
||||||
{
|
{
|
||||||
REFERENCEOBJECT (TestResult)
|
REFERENCEOBJECT (TestResult)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TestResult();
|
TestResult();
|
||||||
virtual ~TestResult();
|
virtual ~TestResult();
|
||||||
|
|
||||||
virtual void addError(Test* test, CppUnitException* e);
|
virtual void addError(Test* test, CppUnitException* e);
|
||||||
virtual void addFailure(Test* test, CppUnitException* e);
|
virtual void addFailure(Test* test, CppUnitException* e);
|
||||||
virtual void startTest(Test* test);
|
virtual void startTest(Test* test);
|
||||||
virtual void endTest(Test* test);
|
virtual void endTest(Test* test);
|
||||||
virtual int runTests();
|
virtual int runTests();
|
||||||
virtual int testErrors();
|
virtual int testErrors();
|
||||||
virtual int testFailures();
|
virtual int testFailures();
|
||||||
virtual bool wasSuccessful();
|
virtual bool wasSuccessful();
|
||||||
virtual bool shouldStop();
|
virtual bool shouldStop();
|
||||||
virtual void stop();
|
virtual void stop();
|
||||||
|
|
||||||
virtual std::vector<TestFailure*>& errors();
|
virtual std::vector<TestFailure*>& errors();
|
||||||
virtual std::vector<TestFailure*>& failures();
|
virtual std::vector<TestFailure*>& failures();
|
||||||
|
|
||||||
class SynchronizationObject
|
class SynchronizationObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SynchronizationObject()
|
SynchronizationObject()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~SynchronizationObject()
|
virtual ~SynchronizationObject()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void lock()
|
virtual void lock()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void unlock()
|
virtual void unlock()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class ExclusiveZone
|
class ExclusiveZone
|
||||||
{
|
{
|
||||||
SynchronizationObject* m_syncObject;
|
SynchronizationObject* m_syncObject;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ExclusiveZone(SynchronizationObject* syncObject): m_syncObject(syncObject)
|
ExclusiveZone(SynchronizationObject* syncObject): m_syncObject(syncObject)
|
||||||
{
|
{
|
||||||
m_syncObject->lock();
|
m_syncObject->lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
~ExclusiveZone()
|
~ExclusiveZone()
|
||||||
{
|
{
|
||||||
m_syncObject->unlock();
|
m_syncObject->unlock();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void setSynchronizationObject(SynchronizationObject* syncObject);
|
virtual void setSynchronizationObject(SynchronizationObject* syncObject);
|
||||||
|
|
||||||
std::vector<TestFailure*> _errors;
|
std::vector<TestFailure*> _errors;
|
||||||
std::vector<TestFailure*> _failures;
|
std::vector<TestFailure*> _failures;
|
||||||
int _runTests;
|
int _runTests;
|
||||||
bool _stop;
|
bool _stop;
|
||||||
SynchronizationObject* _syncObject;
|
SynchronizationObject* _syncObject;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Construct a TestResult
|
// Construct a TestResult
|
||||||
inline TestResult::TestResult(): _syncObject(new SynchronizationObject())
|
inline TestResult::TestResult(): _syncObject(new SynchronizationObject())
|
||||||
{
|
{
|
||||||
_runTests = 0;
|
_runTests = 0;
|
||||||
_stop = false;
|
_stop = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Adds an error to the list of errors. The passed in exception
|
// Adds an error to the list of errors. The passed in exception
|
||||||
// caused the error
|
// caused the error
|
||||||
inline void TestResult::addError(Test* test, CppUnitException* e)
|
inline void TestResult::addError(Test* test, CppUnitException* e)
|
||||||
{
|
{
|
||||||
ExclusiveZone zone(_syncObject);
|
ExclusiveZone zone(_syncObject);
|
||||||
_errors.push_back(new TestFailure(test, e));
|
_errors.push_back(new TestFailure(test, e));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Adds a failure to the list of failures. The passed in exception
|
// Adds a failure to the list of failures. The passed in exception
|
||||||
// caused the failure.
|
// caused the failure.
|
||||||
inline void TestResult::addFailure(Test* test, CppUnitException* e)
|
inline void TestResult::addFailure(Test* test, CppUnitException* e)
|
||||||
{
|
{
|
||||||
ExclusiveZone zone(_syncObject);
|
ExclusiveZone zone(_syncObject);
|
||||||
_failures.push_back(new TestFailure(test, e));
|
_failures.push_back(new TestFailure(test, e));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Informs the result that a test will be started.
|
// Informs the result that a test will be started.
|
||||||
inline void TestResult::startTest(Test* test)
|
inline void TestResult::startTest(Test* test)
|
||||||
{
|
{
|
||||||
ExclusiveZone zone(_syncObject);
|
ExclusiveZone zone(_syncObject);
|
||||||
_runTests++;
|
_runTests++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Informs the result that a test was completed.
|
// Informs the result that a test was completed.
|
||||||
inline void TestResult::endTest(Test* test)
|
inline void TestResult::endTest(Test* test)
|
||||||
{
|
{
|
||||||
ExclusiveZone zone(_syncObject);
|
ExclusiveZone zone(_syncObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Gets the number of run tests.
|
// Gets the number of run tests.
|
||||||
inline int TestResult::runTests()
|
inline int TestResult::runTests()
|
||||||
{
|
{
|
||||||
ExclusiveZone zone(_syncObject);
|
ExclusiveZone zone(_syncObject);
|
||||||
return _runTests;
|
return _runTests;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Gets the number of detected errors.
|
// Gets the number of detected errors.
|
||||||
inline int TestResult::testErrors()
|
inline int TestResult::testErrors()
|
||||||
{
|
{
|
||||||
ExclusiveZone zone(_syncObject);
|
ExclusiveZone zone(_syncObject);
|
||||||
return (int) _errors.size();
|
return (int) _errors.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Gets the number of detected failures.
|
// Gets the number of detected failures.
|
||||||
inline int TestResult::testFailures()
|
inline int TestResult::testFailures()
|
||||||
{
|
{
|
||||||
ExclusiveZone zone(_syncObject);
|
ExclusiveZone zone(_syncObject);
|
||||||
return (int) _failures.size();
|
return (int) _failures.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Returns whether the entire test was successful or not.
|
// Returns whether the entire test was successful or not.
|
||||||
inline bool TestResult::wasSuccessful()
|
inline bool TestResult::wasSuccessful()
|
||||||
{
|
{
|
||||||
ExclusiveZone zone(_syncObject);
|
ExclusiveZone zone(_syncObject);
|
||||||
return _failures.size() == 0 && _errors.size () == 0;
|
return _failures.size() == 0 && _errors.size () == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Returns a std::vector of the errors.
|
// Returns a std::vector of the errors.
|
||||||
inline std::vector<TestFailure*>& TestResult::errors()
|
inline std::vector<TestFailure*>& TestResult::errors()
|
||||||
{
|
{
|
||||||
ExclusiveZone zone(_syncObject);
|
ExclusiveZone zone(_syncObject);
|
||||||
return _errors;
|
return _errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Returns a std::vector of the failures.
|
// Returns a std::vector of the failures.
|
||||||
inline std::vector<TestFailure*>& TestResult::failures()
|
inline std::vector<TestFailure*>& TestResult::failures()
|
||||||
{
|
{
|
||||||
ExclusiveZone zone(_syncObject);
|
ExclusiveZone zone(_syncObject);
|
||||||
return _failures;
|
return _failures;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Returns whether testing should be stopped
|
// Returns whether testing should be stopped
|
||||||
inline bool TestResult::shouldStop()
|
inline bool TestResult::shouldStop()
|
||||||
{
|
{
|
||||||
ExclusiveZone zone(_syncObject);
|
ExclusiveZone zone(_syncObject);
|
||||||
return _stop;
|
return _stop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Stop testing
|
// Stop testing
|
||||||
inline void TestResult::stop()
|
inline void TestResult::stop()
|
||||||
{
|
{
|
||||||
ExclusiveZone zone(_syncObject);
|
ExclusiveZone zone(_syncObject);
|
||||||
_stop = true;
|
_stop = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Accept a new synchronization object for protection of this instance
|
// Accept a new synchronization object for protection of this instance
|
||||||
// TestResult assumes ownership of the object
|
// TestResult assumes ownership of the object
|
||||||
inline void TestResult::setSynchronizationObject(SynchronizationObject* syncObject)
|
inline void TestResult::setSynchronizationObject(SynchronizationObject* syncObject)
|
||||||
{
|
{
|
||||||
delete _syncObject;
|
delete _syncObject;
|
||||||
_syncObject = syncObject;
|
_syncObject = syncObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|
||||||
|
|
||||||
#endif // CppUnit_TestResult_INCLUDED
|
#endif // CppUnit_TestResult_INCLUDED
|
||||||
|
|||||||
@@ -1,75 +1,75 @@
|
|||||||
//
|
//
|
||||||
// TestRunner.h
|
// TestRunner.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestRunner.h#1 $
|
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestRunner.h#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef CppUnit_TestRunner_INCLUDED
|
#ifndef CppUnit_TestRunner_INCLUDED
|
||||||
#define CppUnit_TestRunner_INCLUDED
|
#define CppUnit_TestRunner_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/CppUnit.h"
|
#include "CppUnit/CppUnit.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
class Test;
|
class Test;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A command line based tool to run tests.
|
* A command line based tool to run tests.
|
||||||
* TestRunner expects as its only argument the name of a TestCase class.
|
* TestRunner expects as its only argument the name of a TestCase class.
|
||||||
* TestRunner prints out a trace as the tests are executed followed by a
|
* TestRunner prints out a trace as the tests are executed followed by a
|
||||||
* summary at the end.
|
* summary at the end.
|
||||||
*
|
*
|
||||||
* You can add to the tests that the TestRunner knows about by
|
* You can add to the tests that the TestRunner knows about by
|
||||||
* making additional calls to "addTest (...)" in main.
|
* making additional calls to "addTest (...)" in main.
|
||||||
*
|
*
|
||||||
* Here is the synopsis:
|
* Here is the synopsis:
|
||||||
*
|
*
|
||||||
* TestRunner [-all] [-print] [-wait] ExampleTestCase
|
* TestRunner [-all] [-print] [-wait] ExampleTestCase
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class CppUnit_API TestRunner
|
class CppUnit_API TestRunner
|
||||||
{
|
{
|
||||||
typedef std::pair<std::string, Test*> Mapping;
|
typedef std::pair<std::string, Test*> Mapping;
|
||||||
typedef std::vector<Mapping> Mappings;
|
typedef std::vector<Mapping> Mappings;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TestRunner();
|
TestRunner();
|
||||||
~TestRunner();
|
~TestRunner();
|
||||||
|
|
||||||
bool run(const std::vector<std::string>& args);
|
bool run(const std::vector<std::string>& args);
|
||||||
void addTest(const std::string& name, Test* test);
|
void addTest(const std::string& name, Test* test);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool run(Test* test);
|
bool run(Test* test);
|
||||||
void printBanner();
|
void printBanner();
|
||||||
void print(const std::string& name, Test* pTest, int indent);
|
void print(const std::string& name, Test* pTest, int indent);
|
||||||
Test* find(const std::string& name, Test* pTest, const std::string& testName);
|
Test* find(const std::string& name, Test* pTest, const std::string& testName);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Mappings _mappings;
|
Mappings _mappings;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|
||||||
|
|
||||||
#define CppUnitMain(testCase) \
|
#define CppUnitMain(testCase) \
|
||||||
int main(int ac, char **av) \
|
int main(int ac, char **av) \
|
||||||
{ \
|
{ \
|
||||||
std::vector<std::string> args; \
|
std::vector<std::string> args; \
|
||||||
for (int i = 0; i < ac; ++i) \
|
for (int i = 0; i < ac; ++i) \
|
||||||
args.push_back(std::string(av[i])); \
|
args.push_back(std::string(av[i])); \
|
||||||
CppUnit::TestRunner runner; \
|
CppUnit::TestRunner runner; \
|
||||||
runner.addTest(#testCase, testCase::suite()); \
|
runner.addTest(#testCase, testCase::suite()); \
|
||||||
return runner.run(args) ? 0 : 1; \
|
return runner.run(args) ? 0 : 1; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // CppUnit_TestRunner_INCLUDED
|
#endif // CppUnit_TestRunner_INCLUDED
|
||||||
|
|||||||
@@ -1,57 +1,57 @@
|
|||||||
//
|
//
|
||||||
// TestSetup.h
|
// TestSetup.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestSetup.h#1 $
|
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestSetup.h#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef CppUnit_TestSetup_INCLUDED
|
#ifndef CppUnit_TestSetup_INCLUDED
|
||||||
#define CppUnit_TestSetup_INCLUDED
|
#define CppUnit_TestSetup_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/CppUnit.h"
|
#include "CppUnit/CppUnit.h"
|
||||||
#include "CppUnit/Guards.h"
|
#include "CppUnit/Guards.h"
|
||||||
#include "CppUnit/TestDecorator.h"
|
#include "CppUnit/TestDecorator.h"
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
class Test;
|
class Test;
|
||||||
class TestResult;
|
class TestResult;
|
||||||
|
|
||||||
|
|
||||||
class CppUnit_API TestSetup: public TestDecorator
|
class CppUnit_API TestSetup: public TestDecorator
|
||||||
{
|
{
|
||||||
REFERENCEOBJECT (TestSetup)
|
REFERENCEOBJECT (TestSetup)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TestSetup(Test* test): TestDecorator(test)
|
TestSetup(Test* test): TestDecorator(test)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void run(TestResult* result);
|
void run(TestResult* result);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setUp()
|
void setUp()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void tearDown()
|
void tearDown()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
inline void TestSetup::run(TestResult* result)
|
inline void TestSetup::run(TestResult* result)
|
||||||
{
|
{
|
||||||
setUp();
|
setUp();
|
||||||
TestDecorator::run(result);
|
TestDecorator::run(result);
|
||||||
tearDown();
|
tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|
||||||
|
|
||||||
#endif // CppUnit_TestSetup_INCLUDED
|
#endif // CppUnit_TestSetup_INCLUDED
|
||||||
|
|||||||
@@ -1,98 +1,98 @@
|
|||||||
//
|
//
|
||||||
// TestSuite.h
|
// TestSuite.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestSuite.h#1 $
|
// $Id: //poco/1.2/CppUnit/include/CppUnit/TestSuite.h#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef CppUnit_TestSuite_INCLUDED
|
#ifndef CppUnit_TestSuite_INCLUDED
|
||||||
#define CppUnit_TestSuite_INCLUDED
|
#define CppUnit_TestSuite_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/CppUnit.h"
|
#include "CppUnit/CppUnit.h"
|
||||||
#include "CppUnit/Guards.h"
|
#include "CppUnit/Guards.h"
|
||||||
#include "CppUnit/Test.h"
|
#include "CppUnit/Test.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
class TestResult;
|
class TestResult;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A TestSuite is a Composite of Tests.
|
* A TestSuite is a Composite of Tests.
|
||||||
* It runs a collection of test cases. Here is an example.
|
* It runs a collection of test cases. Here is an example.
|
||||||
*
|
*
|
||||||
* TestSuite *suite= new TestSuite();
|
* TestSuite *suite= new TestSuite();
|
||||||
* suite->addTest(new TestCaller<MathTest> ("testAdd", testAdd));
|
* suite->addTest(new TestCaller<MathTest> ("testAdd", testAdd));
|
||||||
* suite->addTest(new TestCaller<MathTest> ("testDivideByZero", testDivideByZero));
|
* suite->addTest(new TestCaller<MathTest> ("testDivideByZero", testDivideByZero));
|
||||||
*
|
*
|
||||||
* Note that TestSuites assume lifetime
|
* Note that TestSuites assume lifetime
|
||||||
* control for any tests added to them.
|
* control for any tests added to them.
|
||||||
*
|
*
|
||||||
* see Test and TestCaller
|
* see Test and TestCaller
|
||||||
*/
|
*/
|
||||||
class CppUnit_API TestSuite: public Test
|
class CppUnit_API TestSuite: public Test
|
||||||
{
|
{
|
||||||
REFERENCEOBJECT (TestSuite)
|
REFERENCEOBJECT (TestSuite)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TestSuite(const std::string& name = "");
|
TestSuite(const std::string& name = "");
|
||||||
~TestSuite();
|
~TestSuite();
|
||||||
|
|
||||||
void run(TestResult* result);
|
void run(TestResult* result);
|
||||||
int countTestCases();
|
int countTestCases();
|
||||||
void addTest(Test* test);
|
void addTest(Test* test);
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
virtual void deleteContents();
|
virtual void deleteContents();
|
||||||
|
|
||||||
const std::vector<Test*> tests() const;
|
const std::vector<Test*> tests() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<Test*> _tests;
|
std::vector<Test*> _tests;
|
||||||
const std::string _name;
|
const std::string _name;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Default constructor
|
// Default constructor
|
||||||
inline TestSuite::TestSuite(const std::string& name): _name(name)
|
inline TestSuite::TestSuite(const std::string& name): _name(name)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
inline TestSuite::~TestSuite()
|
inline TestSuite::~TestSuite()
|
||||||
{
|
{
|
||||||
deleteContents();
|
deleteContents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Adds a test to the suite.
|
// Adds a test to the suite.
|
||||||
inline void TestSuite::addTest(Test* test)
|
inline void TestSuite::addTest(Test* test)
|
||||||
{
|
{
|
||||||
_tests.push_back(test);
|
_tests.push_back(test);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Returns a std::string representation of the test suite.
|
// Returns a std::string representation of the test suite.
|
||||||
inline std::string TestSuite::toString()
|
inline std::string TestSuite::toString()
|
||||||
{
|
{
|
||||||
return "suite " + _name;
|
return "suite " + _name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Returns all tests
|
// Returns all tests
|
||||||
inline const std::vector<Test*> TestSuite::tests() const
|
inline const std::vector<Test*> TestSuite::tests() const
|
||||||
{
|
{
|
||||||
return _tests;
|
return _tests;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|
||||||
|
|
||||||
#endif // CppUnit_TestSuite_INCLUDED
|
#endif // CppUnit_TestSuite_INCLUDED
|
||||||
|
|||||||
@@ -1,47 +1,47 @@
|
|||||||
//
|
//
|
||||||
// TextTestResult.h
|
// TextTestResult.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/include/CppUnit/TextTestResult.h#1 $
|
// $Id: //poco/1.2/CppUnit/include/CppUnit/TextTestResult.h#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef CppUnit_TextTestResult_INCLUDED
|
#ifndef CppUnit_TextTestResult_INCLUDED
|
||||||
#define CppUnit_TextTestResult_INCLUDED
|
#define CppUnit_TextTestResult_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/CppUnit.h"
|
#include "CppUnit/CppUnit.h"
|
||||||
#include "CppUnit/TestResult.h"
|
#include "CppUnit/TestResult.h"
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
class CppUnit_API TextTestResult: public TestResult
|
class CppUnit_API TextTestResult: public TestResult
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void addError(Test* test, CppUnitException* e);
|
virtual void addError(Test* test, CppUnitException* e);
|
||||||
virtual void addFailure(Test* test, CppUnitException* e);
|
virtual void addFailure(Test* test, CppUnitException* e);
|
||||||
virtual void startTest(Test* test);
|
virtual void startTest(Test* test);
|
||||||
virtual void print(std::ostream& stream);
|
virtual void print(std::ostream& stream);
|
||||||
virtual void printErrors(std::ostream& stream);
|
virtual void printErrors(std::ostream& stream);
|
||||||
virtual void printFailures(std::ostream& stream);
|
virtual void printFailures(std::ostream& stream);
|
||||||
virtual void printHeader(std::ostream& stream);
|
virtual void printHeader(std::ostream& stream);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::string shortName(const std::string& testName);
|
std::string shortName(const std::string& testName);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* insertion operator for easy output */
|
/* insertion operator for easy output */
|
||||||
inline std::ostream& operator<< (std::ostream& stream, TextTestResult& result)
|
inline std::ostream& operator<< (std::ostream& stream, TextTestResult& result)
|
||||||
{
|
{
|
||||||
result.print(stream);
|
result.print(stream);
|
||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|
||||||
|
|
||||||
#endif // CppUnit_TextTestResult_INCLUDED
|
#endif // CppUnit_TextTestResult_INCLUDED
|
||||||
|
|||||||
@@ -1,73 +1,73 @@
|
|||||||
//
|
//
|
||||||
// estring.h
|
// estring.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/include/CppUnit/estring.h#1 $
|
// $Id: //poco/1.2/CppUnit/include/CppUnit/estring.h#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef CppUnit_estring_INCLUDED
|
#ifndef CppUnit_estring_INCLUDED
|
||||||
#define CppUnit_estring_INCLUDED
|
#define CppUnit_estring_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/CppUnit.h"
|
#include "CppUnit/CppUnit.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
// Create a std::string from a const char pointer
|
// Create a std::string from a const char pointer
|
||||||
inline std::string estring(const char *cstring)
|
inline std::string estring(const char *cstring)
|
||||||
{
|
{
|
||||||
return std::string(cstring);
|
return std::string(cstring);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Create a std::string from a std::string (for uniformities' sake)
|
// Create a std::string from a std::string (for uniformities' sake)
|
||||||
inline std::string estring(std::string& expandedString)
|
inline std::string estring(std::string& expandedString)
|
||||||
{
|
{
|
||||||
return expandedString;
|
return expandedString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Create a std::string from an int
|
// Create a std::string from an int
|
||||||
inline std::string estring(int number)
|
inline std::string estring(int number)
|
||||||
{
|
{
|
||||||
char buffer[50];
|
char buffer[50];
|
||||||
sprintf(buffer, "%d", number);
|
sprintf(buffer, "%d", number);
|
||||||
return std::string (buffer);
|
return std::string (buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Create a string from a long
|
// Create a string from a long
|
||||||
inline std::string estring(long number)
|
inline std::string estring(long number)
|
||||||
{
|
{
|
||||||
char buffer[50];
|
char buffer[50];
|
||||||
sprintf(buffer, "%ld", number);
|
sprintf(buffer, "%ld", number);
|
||||||
return std::string (buffer);
|
return std::string (buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Create a std::string from a double
|
// Create a std::string from a double
|
||||||
inline std::string estring(double number)
|
inline std::string estring(double number)
|
||||||
{
|
{
|
||||||
char buffer[50];
|
char buffer[50];
|
||||||
sprintf(buffer, "%lf", number);
|
sprintf(buffer, "%lf", number);
|
||||||
return std::string(buffer);
|
return std::string(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Create a std::string from a double
|
// Create a std::string from a double
|
||||||
inline std::string estring(const void* ptr)
|
inline std::string estring(const void* ptr)
|
||||||
{
|
{
|
||||||
char buffer[50];
|
char buffer[50];
|
||||||
sprintf(buffer, "%p", ptr);
|
sprintf(buffer, "%p", ptr);
|
||||||
return std::string(buffer);
|
return std::string(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|
||||||
|
|
||||||
#endif // CppUnit_estring_INCLUDED
|
#endif // CppUnit_estring_INCLUDED
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
//
|
//
|
||||||
// CppUnitException.cpp
|
// CppUnitException.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/src/CppUnitException.cpp#1 $
|
// $Id: //poco/1.2/CppUnit/src/CppUnitException.cpp#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/CppUnitException.h"
|
#include "CppUnit/CppUnitException.h"
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
const std::string CppUnitException::CPPUNIT_UNKNOWNFILENAME = "<unknown>";
|
const std::string CppUnitException::CPPUNIT_UNKNOWNFILENAME = "<unknown>";
|
||||||
const int CppUnitException::CPPUNIT_UNKNOWNLINENUMBER = -1;
|
const int CppUnitException::CPPUNIT_UNKNOWNLINENUMBER = -1;
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|||||||
@@ -1,182 +1,182 @@
|
|||||||
//
|
//
|
||||||
// TestCase.cpp
|
// TestCase.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/src/TestCase.cpp#1 $
|
// $Id: //poco/1.2/CppUnit/src/TestCase.cpp#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "CppUnit/TestCase.h"
|
#include "CppUnit/TestCase.h"
|
||||||
#include "CppUnit/TestResult.h"
|
#include "CppUnit/TestResult.h"
|
||||||
#include "CppUnit/estring.h"
|
#include "CppUnit/estring.h"
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
// Create a default TestResult
|
// Create a default TestResult
|
||||||
TestResult* TestCase::defaultResult()
|
TestResult* TestCase::defaultResult()
|
||||||
{
|
{
|
||||||
return new TestResult;
|
return new TestResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Check for a failed general assertion
|
// Check for a failed general assertion
|
||||||
void TestCase::assertImplementation(bool condition, const std::string& conditionExpression, long lineNumber, const std::string& fileName)
|
void TestCase::assertImplementation(bool condition, const std::string& conditionExpression, long lineNumber, const std::string& fileName)
|
||||||
{
|
{
|
||||||
if (!condition)
|
if (!condition)
|
||||||
throw CppUnitException(conditionExpression, lineNumber, fileName);
|
throw CppUnitException(conditionExpression, lineNumber, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestCase::loop1assertImplementation(bool condition, const std::string& conditionExpression, long lineNumber, long data1lineNumber, const std::string& fileName)
|
void TestCase::loop1assertImplementation(bool condition, const std::string& conditionExpression, long lineNumber, long data1lineNumber, const std::string& fileName)
|
||||||
{
|
{
|
||||||
if (!condition)
|
if (!condition)
|
||||||
throw CppUnitException(conditionExpression, lineNumber, data1lineNumber, fileName);
|
throw CppUnitException(conditionExpression, lineNumber, data1lineNumber, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestCase::loop2assertImplementation(bool condition, const std::string& conditionExpression, long lineNumber, long data1lineNumber, long data2lineNumber, const std::string& fileName)
|
void TestCase::loop2assertImplementation(bool condition, const std::string& conditionExpression, long lineNumber, long data1lineNumber, long data2lineNumber, const std::string& fileName)
|
||||||
{
|
{
|
||||||
if (!condition)
|
if (!condition)
|
||||||
throw CppUnitException(conditionExpression, lineNumber, data1lineNumber, data2lineNumber, fileName);
|
throw CppUnitException(conditionExpression, lineNumber, data1lineNumber, data2lineNumber, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Check for a failed equality assertion
|
// Check for a failed equality assertion
|
||||||
void TestCase::assertEquals(long expected, long actual, long lineNumber, const std::string& fileName)
|
void TestCase::assertEquals(long expected, long actual, long lineNumber, const std::string& fileName)
|
||||||
{
|
{
|
||||||
if (expected != actual)
|
if (expected != actual)
|
||||||
assertImplementation(false, notEqualsMessage(expected, actual), lineNumber, fileName);
|
assertImplementation(false, notEqualsMessage(expected, actual), lineNumber, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Check for a failed equality assertion
|
// Check for a failed equality assertion
|
||||||
void TestCase::assertEquals(double expected, double actual, double delta, long lineNumber, const std::string& fileName)
|
void TestCase::assertEquals(double expected, double actual, double delta, long lineNumber, const std::string& fileName)
|
||||||
{
|
{
|
||||||
if (fabs(expected - actual) > delta)
|
if (fabs(expected - actual) > delta)
|
||||||
assertImplementation(false, notEqualsMessage(expected, actual), lineNumber, fileName);
|
assertImplementation(false, notEqualsMessage(expected, actual), lineNumber, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Check for a failed equality assertion
|
// Check for a failed equality assertion
|
||||||
void TestCase::assertEquals(const void* expected, const void* actual, long lineNumber, const std::string& fileName)
|
void TestCase::assertEquals(const void* expected, const void* actual, long lineNumber, const std::string& fileName)
|
||||||
{
|
{
|
||||||
if (expected != actual)
|
if (expected != actual)
|
||||||
assertImplementation(false, notEqualsMessage(expected, actual), lineNumber, fileName);
|
assertImplementation(false, notEqualsMessage(expected, actual), lineNumber, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Check for a failed equality assertion
|
// Check for a failed equality assertion
|
||||||
void TestCase::assertEquals(const std::string& expected, const std::string& actual, long lineNumber, const std::string& fileName)
|
void TestCase::assertEquals(const std::string& expected, const std::string& actual, long lineNumber, const std::string& fileName)
|
||||||
{
|
{
|
||||||
if (expected != actual)
|
if (expected != actual)
|
||||||
assertImplementation(false, notEqualsMessage(expected, actual), lineNumber, fileName);
|
assertImplementation(false, notEqualsMessage(expected, actual), lineNumber, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestCase::assertNotNull(const void* pointer, const std::string& pointerExpression, long lineNumber, const std::string& fileName)
|
void TestCase::assertNotNull(const void* pointer, const std::string& pointerExpression, long lineNumber, const std::string& fileName)
|
||||||
{
|
{
|
||||||
if (pointer == NULL)
|
if (pointer == NULL)
|
||||||
throw CppUnitException(pointerExpression + " must not be NULL", lineNumber, fileName);
|
throw CppUnitException(pointerExpression + " must not be NULL", lineNumber, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestCase::assertNull(const void* pointer, const std::string& pointerExpression, long lineNumber, const std::string& fileName)
|
void TestCase::assertNull(const void* pointer, const std::string& pointerExpression, long lineNumber, const std::string& fileName)
|
||||||
{
|
{
|
||||||
if (pointer != NULL)
|
if (pointer != NULL)
|
||||||
throw CppUnitException(pointerExpression + " must be NULL", lineNumber, fileName);
|
throw CppUnitException(pointerExpression + " must be NULL", lineNumber, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestCase::fail (const std::string& message, long lineNumber, const std::string& fileName)
|
void TestCase::fail (const std::string& message, long lineNumber, const std::string& fileName)
|
||||||
{
|
{
|
||||||
throw CppUnitException(std::string("fail: ") + message, lineNumber, fileName);
|
throw CppUnitException(std::string("fail: ") + message, lineNumber, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Run the test and catch any exceptions that are triggered by it
|
// Run the test and catch any exceptions that are triggered by it
|
||||||
void TestCase::run(TestResult *result)
|
void TestCase::run(TestResult *result)
|
||||||
{
|
{
|
||||||
result->startTest(this);
|
result->startTest(this);
|
||||||
|
|
||||||
setUp();
|
setUp();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
runTest();
|
runTest();
|
||||||
}
|
}
|
||||||
catch (CppUnitException& e)
|
catch (CppUnitException& e)
|
||||||
{
|
{
|
||||||
CppUnitException* copy = new CppUnitException(e);
|
CppUnitException* copy = new CppUnitException(e);
|
||||||
result->addFailure(this, copy);
|
result->addFailure(this, copy);
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
std::string msg(typeid(e).name());
|
std::string msg(typeid(e).name());
|
||||||
msg.append(": ");
|
msg.append(": ");
|
||||||
msg.append(e.what());
|
msg.append(e.what());
|
||||||
result->addError(this, new CppUnitException(msg));
|
result->addError(this, new CppUnitException(msg));
|
||||||
|
|
||||||
}
|
}
|
||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
CppUnitException *e = new CppUnitException ("unknown exception");
|
CppUnitException *e = new CppUnitException ("unknown exception");
|
||||||
result->addError (this, e);
|
result->addError (this, e);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
tearDown ();
|
tearDown ();
|
||||||
result->endTest(this);
|
result->endTest(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// A default run method
|
// A default run method
|
||||||
TestResult* TestCase::run()
|
TestResult* TestCase::run()
|
||||||
{
|
{
|
||||||
TestResult* result = defaultResult();
|
TestResult* result = defaultResult();
|
||||||
|
|
||||||
run(result);
|
run(result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// All the work for runTest is deferred to subclasses
|
// All the work for runTest is deferred to subclasses
|
||||||
void TestCase::runTest()
|
void TestCase::runTest()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Build a message about a failed equality check
|
// Build a message about a failed equality check
|
||||||
std::string TestCase::notEqualsMessage(long expected, long actual)
|
std::string TestCase::notEqualsMessage(long expected, long actual)
|
||||||
{
|
{
|
||||||
return "expected: " + estring(expected) + " but was: " + estring(actual);
|
return "expected: " + estring(expected) + " but was: " + estring(actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Build a message about a failed equality check
|
// Build a message about a failed equality check
|
||||||
std::string TestCase::notEqualsMessage(double expected, double actual)
|
std::string TestCase::notEqualsMessage(double expected, double actual)
|
||||||
{
|
{
|
||||||
return "expected: " + estring(expected) + " but was: " + estring(actual);
|
return "expected: " + estring(expected) + " but was: " + estring(actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Build a message about a failed equality check
|
// Build a message about a failed equality check
|
||||||
std::string TestCase::notEqualsMessage(const void* expected, const void* actual)
|
std::string TestCase::notEqualsMessage(const void* expected, const void* actual)
|
||||||
{
|
{
|
||||||
return "expected: " + estring(expected) + " but was: " + estring(actual);
|
return "expected: " + estring(expected) + " but was: " + estring(actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Build a message about a failed equality check
|
// Build a message about a failed equality check
|
||||||
std::string TestCase::notEqualsMessage(const std::string& expected, const std::string& actual)
|
std::string TestCase::notEqualsMessage(const std::string& expected, const std::string& actual)
|
||||||
{
|
{
|
||||||
return "expected: \"" + expected + "\" but was: \"" + actual + "\"";
|
return "expected: \"" + expected + "\" but was: \"" + actual + "\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|||||||
@@ -1,43 +1,43 @@
|
|||||||
//
|
//
|
||||||
// TestDecorator.cpp
|
// TestDecorator.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/src/TestDecorator.cpp#1 $
|
// $Id: //poco/1.2/CppUnit/src/TestDecorator.cpp#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/TestDecorator.h"
|
#include "CppUnit/TestDecorator.h"
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
TestDecorator::TestDecorator(Test* test)
|
TestDecorator::TestDecorator(Test* test)
|
||||||
{
|
{
|
||||||
_test = test;
|
_test = test;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TestDecorator::~TestDecorator()
|
TestDecorator::~TestDecorator()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int TestDecorator::countTestCases()
|
int TestDecorator::countTestCases()
|
||||||
{
|
{
|
||||||
return _test->countTestCases();
|
return _test->countTestCases();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestDecorator::run(TestResult* result)
|
void TestDecorator::run(TestResult* result)
|
||||||
{
|
{
|
||||||
_test->run(result);
|
_test->run(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string TestDecorator::toString()
|
std::string TestDecorator::toString()
|
||||||
{
|
{
|
||||||
return _test->toString();
|
return _test->toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
//
|
//
|
||||||
// TestFailure.cpp
|
// TestFailure.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/src/TestFailure.cpp#1 $
|
// $Id: //poco/1.2/CppUnit/src/TestFailure.cpp#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/TestFailure.h"
|
#include "CppUnit/TestFailure.h"
|
||||||
#include "CppUnit/Test.h"
|
#include "CppUnit/Test.h"
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
// Returns a short description of the failure.
|
// Returns a short description of the failure.
|
||||||
std::string TestFailure::toString()
|
std::string TestFailure::toString()
|
||||||
{
|
{
|
||||||
return _failedTest->toString () + ": " + _thrownException->what();
|
return _failedTest->toString () + ": " + _thrownException->what();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|||||||
@@ -1,29 +1,29 @@
|
|||||||
//
|
//
|
||||||
// TestResult.cpp
|
// TestResult.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/src/TestResult.cpp#1 $
|
// $Id: //poco/1.2/CppUnit/src/TestResult.cpp#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/TestResult.h"
|
#include "CppUnit/TestResult.h"
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
// Destroys a test result
|
// Destroys a test result
|
||||||
TestResult::~TestResult()
|
TestResult::~TestResult()
|
||||||
{
|
{
|
||||||
std::vector<TestFailure*>::iterator it;
|
std::vector<TestFailure*>::iterator it;
|
||||||
|
|
||||||
for (it = _errors.begin(); it != _errors.end(); ++it)
|
for (it = _errors.begin(); it != _errors.end(); ++it)
|
||||||
delete *it;
|
delete *it;
|
||||||
|
|
||||||
for (it = _failures.begin(); it != _failures.end(); ++it)
|
for (it = _failures.begin(); it != _failures.end(); ++it)
|
||||||
delete *it;
|
delete *it;
|
||||||
|
|
||||||
delete _syncObject;
|
delete _syncObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|||||||
@@ -1,181 +1,181 @@
|
|||||||
//
|
//
|
||||||
// TestRunner.cpp
|
// TestRunner.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/src/TestRunner.cpp#1 $
|
// $Id: //poco/1.2/CppUnit/src/TestRunner.cpp#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/TestRunner.h"
|
#include "CppUnit/TestRunner.h"
|
||||||
#include "CppUnit/Test.h"
|
#include "CppUnit/Test.h"
|
||||||
#include "CppUnit/TestSuite.h"
|
#include "CppUnit/TestSuite.h"
|
||||||
#include "CppUnit/TextTestResult.h"
|
#include "CppUnit/TextTestResult.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
TestRunner::TestRunner()
|
TestRunner::TestRunner()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TestRunner::~TestRunner()
|
TestRunner::~TestRunner()
|
||||||
{
|
{
|
||||||
for (Mappings::iterator it = _mappings.begin(); it != _mappings.end(); ++it)
|
for (Mappings::iterator it = _mappings.begin(); it != _mappings.end(); ++it)
|
||||||
delete it->second;
|
delete it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunner::printBanner()
|
void TestRunner::printBanner()
|
||||||
{
|
{
|
||||||
std::cout
|
std::cout
|
||||||
<< "Usage: driver [-all] [-print] [-wait] [name] ..." << std::endl
|
<< "Usage: driver [-all] [-print] [-wait] [name] ..." << std::endl
|
||||||
<< " where name is the name of a test case class" << std::endl;
|
<< " where name is the name of a test case class" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TestRunner::run(const std::vector<std::string>& args)
|
bool TestRunner::run(const std::vector<std::string>& args)
|
||||||
{
|
{
|
||||||
std::string testCase;
|
std::string testCase;
|
||||||
int numberOfTests = 0;
|
int numberOfTests = 0;
|
||||||
bool success = true;
|
bool success = true;
|
||||||
bool all = false;
|
bool all = false;
|
||||||
bool wait = false;
|
bool wait = false;
|
||||||
bool printed = false;
|
bool printed = false;
|
||||||
|
|
||||||
for (int i = 1; i < args.size(); i++)
|
for (int i = 1; i < args.size(); i++)
|
||||||
{
|
{
|
||||||
const std::string& arg = args[i];
|
const std::string& arg = args[i];
|
||||||
if (arg == "-wait")
|
if (arg == "-wait")
|
||||||
{
|
{
|
||||||
wait = true;
|
wait = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (arg == "-all")
|
else if (arg == "-all")
|
||||||
{
|
{
|
||||||
all = true;
|
all = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (arg == "-print")
|
else if (arg == "-print")
|
||||||
{
|
{
|
||||||
for (Mappings::iterator it = _mappings.begin(); it != _mappings.end(); ++it)
|
for (Mappings::iterator it = _mappings.begin(); it != _mappings.end(); ++it)
|
||||||
{
|
{
|
||||||
print(it->first, it->second, 0);
|
print(it->first, it->second, 0);
|
||||||
}
|
}
|
||||||
printed = true;
|
printed = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!all)
|
if (!all)
|
||||||
{
|
{
|
||||||
testCase = arg;
|
testCase = arg;
|
||||||
|
|
||||||
if (testCase == "")
|
if (testCase == "")
|
||||||
{
|
{
|
||||||
printBanner();
|
printBanner();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Test* testToRun = 0;
|
Test* testToRun = 0;
|
||||||
for (Mappings::iterator it = _mappings.begin(); !testToRun && it != _mappings.end(); ++it)
|
for (Mappings::iterator it = _mappings.begin(); !testToRun && it != _mappings.end(); ++it)
|
||||||
{
|
{
|
||||||
testToRun = find(testCase, it->second, it->first);
|
testToRun = find(testCase, it->second, it->first);
|
||||||
}
|
}
|
||||||
if (testToRun)
|
if (testToRun)
|
||||||
{
|
{
|
||||||
if (!run(testToRun)) success = false;
|
if (!run(testToRun)) success = false;
|
||||||
}
|
}
|
||||||
numberOfTests++;
|
numberOfTests++;
|
||||||
|
|
||||||
if (!testToRun)
|
if (!testToRun)
|
||||||
{
|
{
|
||||||
std::cout << "Test " << testCase << " not found." << std::endl;
|
std::cout << "Test " << testCase << " not found." << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (all)
|
if (all)
|
||||||
{
|
{
|
||||||
for (Mappings::iterator it = _mappings.begin(); it != _mappings.end(); ++it)
|
for (Mappings::iterator it = _mappings.begin(); it != _mappings.end(); ++it)
|
||||||
{
|
{
|
||||||
if (!run(it->second)) success = false;
|
if (!run(it->second)) success = false;
|
||||||
numberOfTests++;
|
numberOfTests++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numberOfTests == 0 && !printed)
|
if (numberOfTests == 0 && !printed)
|
||||||
{
|
{
|
||||||
printBanner();
|
printBanner();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wait)
|
if (wait)
|
||||||
{
|
{
|
||||||
std::cout << "<RETURN> to continue" << std::endl;
|
std::cout << "<RETURN> to continue" << std::endl;
|
||||||
std::cin.get();
|
std::cin.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TestRunner::run(Test* test)
|
bool TestRunner::run(Test* test)
|
||||||
{
|
{
|
||||||
TextTestResult result;
|
TextTestResult result;
|
||||||
|
|
||||||
test->run(&result);
|
test->run(&result);
|
||||||
std::cout << result << std::endl;
|
std::cout << result << std::endl;
|
||||||
|
|
||||||
return result.wasSuccessful();
|
return result.wasSuccessful();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunner::addTest(const std::string& name, Test* test)
|
void TestRunner::addTest(const std::string& name, Test* test)
|
||||||
{
|
{
|
||||||
_mappings.push_back(Mapping(name, test));
|
_mappings.push_back(Mapping(name, test));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TestRunner::print(const std::string& name, Test* pTest, int indent)
|
void TestRunner::print(const std::string& name, Test* pTest, int indent)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < indent; ++i)
|
for (int i = 0; i < indent; ++i)
|
||||||
std::cout << " ";
|
std::cout << " ";
|
||||||
std::cout << name << std::endl;
|
std::cout << name << std::endl;
|
||||||
TestSuite* pSuite = dynamic_cast<TestSuite*>(pTest);
|
TestSuite* pSuite = dynamic_cast<TestSuite*>(pTest);
|
||||||
if (pSuite)
|
if (pSuite)
|
||||||
{
|
{
|
||||||
const std::vector<Test*>& tests = pSuite->tests();
|
const std::vector<Test*>& tests = pSuite->tests();
|
||||||
for (std::vector<Test*>::const_iterator it = tests.begin(); it != tests.end(); ++it)
|
for (std::vector<Test*>::const_iterator it = tests.begin(); it != tests.end(); ++it)
|
||||||
{
|
{
|
||||||
print((*it)->toString(), *it, indent + 1);
|
print((*it)->toString(), *it, indent + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Test* TestRunner::find(const std::string& name, Test* pTest, const std::string& testName)
|
Test* TestRunner::find(const std::string& name, Test* pTest, const std::string& testName)
|
||||||
{
|
{
|
||||||
if (testName.find(name) != std::string::npos)
|
if (testName.find(name) != std::string::npos)
|
||||||
{
|
{
|
||||||
return pTest;
|
return pTest;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TestSuite* pSuite = dynamic_cast<TestSuite*>(pTest);
|
TestSuite* pSuite = dynamic_cast<TestSuite*>(pTest);
|
||||||
if (pSuite)
|
if (pSuite)
|
||||||
{
|
{
|
||||||
const std::vector<Test*>& tests = pSuite->tests();
|
const std::vector<Test*>& tests = pSuite->tests();
|
||||||
for (std::vector<Test*>::const_iterator it = tests.begin(); it != tests.end(); ++it)
|
for (std::vector<Test*>::const_iterator it = tests.begin(); it != tests.end(); ++it)
|
||||||
{
|
{
|
||||||
Test* result = find(name, *it, (*it)->toString());
|
Test* result = find(name, *it, (*it)->toString());
|
||||||
if (result) return result;
|
if (result) return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|||||||
@@ -1,49 +1,49 @@
|
|||||||
//
|
//
|
||||||
// TestSuite.cpp
|
// TestSuite.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/src/TestSuite.cpp#1 $
|
// $Id: //poco/1.2/CppUnit/src/TestSuite.cpp#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/TestSuite.h"
|
#include "CppUnit/TestSuite.h"
|
||||||
#include "CppUnit/TestResult.h"
|
#include "CppUnit/TestResult.h"
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
// Deletes all tests in the suite.
|
// Deletes all tests in the suite.
|
||||||
void TestSuite::deleteContents()
|
void TestSuite::deleteContents()
|
||||||
{
|
{
|
||||||
for (std::vector<Test*>::iterator it = _tests.begin(); it != _tests.end(); ++it)
|
for (std::vector<Test*>::iterator it = _tests.begin(); it != _tests.end(); ++it)
|
||||||
delete *it;
|
delete *it;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Runs the tests and collects their result in a TestResult.
|
// Runs the tests and collects their result in a TestResult.
|
||||||
void TestSuite::run(TestResult *result)
|
void TestSuite::run(TestResult *result)
|
||||||
{
|
{
|
||||||
for (std::vector<Test*>::iterator it = _tests.begin(); it != _tests.end(); ++it)
|
for (std::vector<Test*>::iterator it = _tests.begin(); it != _tests.end(); ++it)
|
||||||
{
|
{
|
||||||
if (result->shouldStop ())
|
if (result->shouldStop ())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
Test *test = *it;
|
Test *test = *it;
|
||||||
test->run(result);
|
test->run(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Counts the number of test cases that will be run by this test.
|
// Counts the number of test cases that will be run by this test.
|
||||||
int TestSuite::countTestCases()
|
int TestSuite::countTestCases()
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
for (std::vector<Test*>::iterator it = _tests.begin (); it != _tests.end (); ++it)
|
for (std::vector<Test*>::iterator it = _tests.begin (); it != _tests.end (); ++it)
|
||||||
count += (*it)->countTestCases();
|
count += (*it)->countTestCases();
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|||||||
@@ -1,174 +1,174 @@
|
|||||||
//
|
//
|
||||||
// TextTestResult.cpp
|
// TextTestResult.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.2/CppUnit/src/TextTestResult.cpp#1 $
|
// $Id: //poco/1.2/CppUnit/src/TextTestResult.cpp#1 $
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#include "CppUnit/TextTestResult.h"
|
#include "CppUnit/TextTestResult.h"
|
||||||
#include "CppUnit/CppUnitException.h"
|
#include "CppUnit/CppUnitException.h"
|
||||||
#include "CppUnit/Test.h"
|
#include "CppUnit/Test.h"
|
||||||
#include "CppUnit/estring.h"
|
#include "CppUnit/estring.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
|
|
||||||
namespace CppUnit {
|
namespace CppUnit {
|
||||||
|
|
||||||
|
|
||||||
void TextTestResult::addError(Test* test, CppUnitException* e)
|
void TextTestResult::addError(Test* test, CppUnitException* e)
|
||||||
{
|
{
|
||||||
TestResult::addError(test, e);
|
TestResult::addError(test, e);
|
||||||
std::cerr << "ERROR" << std::flush;
|
std::cerr << "ERROR" << std::flush;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TextTestResult::addFailure(Test* test, CppUnitException* e)
|
void TextTestResult::addFailure(Test* test, CppUnitException* e)
|
||||||
{
|
{
|
||||||
TestResult::addFailure(test, e);
|
TestResult::addFailure(test, e);
|
||||||
std::cerr << "FAILURE" << std::flush;
|
std::cerr << "FAILURE" << std::flush;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TextTestResult::startTest(Test* test)
|
void TextTestResult::startTest(Test* test)
|
||||||
{
|
{
|
||||||
TestResult::startTest(test);
|
TestResult::startTest(test);
|
||||||
std::cerr << "\n" << shortName(test->toString()) << ": ";
|
std::cerr << "\n" << shortName(test->toString()) << ": ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TextTestResult::printErrors(std::ostream& stream)
|
void TextTestResult::printErrors(std::ostream& stream)
|
||||||
{
|
{
|
||||||
if (testErrors() != 0)
|
if (testErrors() != 0)
|
||||||
{
|
{
|
||||||
stream << "\n";
|
stream << "\n";
|
||||||
|
|
||||||
if (testErrors() == 1)
|
if (testErrors() == 1)
|
||||||
stream << "There was " << testErrors() << " error: " << std::endl;
|
stream << "There was " << testErrors() << " error: " << std::endl;
|
||||||
else
|
else
|
||||||
stream << "There were " << testErrors() << " errors: " << std::endl;
|
stream << "There were " << testErrors() << " errors: " << std::endl;
|
||||||
|
|
||||||
int i = 1;
|
int i = 1;
|
||||||
for (std::vector<TestFailure*>::iterator it = errors().begin(); it != errors().end(); ++it)
|
for (std::vector<TestFailure*>::iterator it = errors().begin(); it != errors().end(); ++it)
|
||||||
{
|
{
|
||||||
TestFailure* failure = *it;
|
TestFailure* failure = *it;
|
||||||
CppUnitException* e = failure->thrownException();
|
CppUnitException* e = failure->thrownException();
|
||||||
|
|
||||||
stream << std::setw(2) << i
|
stream << std::setw(2) << i
|
||||||
<< ": "
|
<< ": "
|
||||||
<< failure->failedTest()->toString() << "\n"
|
<< failure->failedTest()->toString() << "\n"
|
||||||
<< " \"" << (e ? e->what() : "") << "\"\n"
|
<< " \"" << (e ? e->what() : "") << "\"\n"
|
||||||
<< " in \""
|
<< " in \""
|
||||||
<< (e ? e->fileName() : std::string())
|
<< (e ? e->fileName() : std::string())
|
||||||
<< "\", line ";
|
<< "\", line ";
|
||||||
if (e == 0)
|
if (e == 0)
|
||||||
{
|
{
|
||||||
stream << "0";
|
stream << "0";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stream << e->lineNumber();
|
stream << e->lineNumber();
|
||||||
if (e->data2LineNumber() != CppUnitException::CPPUNIT_UNKNOWNLINENUMBER)
|
if (e->data2LineNumber() != CppUnitException::CPPUNIT_UNKNOWNLINENUMBER)
|
||||||
{
|
{
|
||||||
stream << " data lines " << e->data1LineNumber()
|
stream << " data lines " << e->data1LineNumber()
|
||||||
<< ", " << e->data2LineNumber();
|
<< ", " << e->data2LineNumber();
|
||||||
}
|
}
|
||||||
else if (e->data1LineNumber() != CppUnitException::CPPUNIT_UNKNOWNLINENUMBER)
|
else if (e->data1LineNumber() != CppUnitException::CPPUNIT_UNKNOWNLINENUMBER)
|
||||||
{
|
{
|
||||||
stream << " data line " << e->data1LineNumber();
|
stream << " data line " << e->data1LineNumber();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stream << "\n";
|
stream << "\n";
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TextTestResult::printFailures(std::ostream& stream)
|
void TextTestResult::printFailures(std::ostream& stream)
|
||||||
{
|
{
|
||||||
if (testFailures() != 0)
|
if (testFailures() != 0)
|
||||||
{
|
{
|
||||||
stream << "\n";
|
stream << "\n";
|
||||||
if (testFailures() == 1)
|
if (testFailures() == 1)
|
||||||
stream << "There was " << testFailures() << " failure: " << std::endl;
|
stream << "There was " << testFailures() << " failure: " << std::endl;
|
||||||
else
|
else
|
||||||
stream << "There were " << testFailures() << " failures: " << std::endl;
|
stream << "There were " << testFailures() << " failures: " << std::endl;
|
||||||
|
|
||||||
int i = 1;
|
int i = 1;
|
||||||
|
|
||||||
for (std::vector<TestFailure*>::iterator it = failures().begin(); it != failures().end(); ++it)
|
for (std::vector<TestFailure*>::iterator it = failures().begin(); it != failures().end(); ++it)
|
||||||
{
|
{
|
||||||
TestFailure* failure = *it;
|
TestFailure* failure = *it;
|
||||||
CppUnitException* e = failure->thrownException();
|
CppUnitException* e = failure->thrownException();
|
||||||
|
|
||||||
stream << std::setw(2) << i
|
stream << std::setw(2) << i
|
||||||
<< ": "
|
<< ": "
|
||||||
<< failure->failedTest()->toString() << "\n"
|
<< failure->failedTest()->toString() << "\n"
|
||||||
<< " \"" << (e ? e->what() : "") << "\"\n"
|
<< " \"" << (e ? e->what() : "") << "\"\n"
|
||||||
<< " in \""
|
<< " in \""
|
||||||
<< (e ? e->fileName() : std::string())
|
<< (e ? e->fileName() : std::string())
|
||||||
<< "\", line ";
|
<< "\", line ";
|
||||||
if (e == 0)
|
if (e == 0)
|
||||||
{
|
{
|
||||||
stream << "0";
|
stream << "0";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stream << e->lineNumber();
|
stream << e->lineNumber();
|
||||||
if (e->data2LineNumber() != CppUnitException::CPPUNIT_UNKNOWNLINENUMBER)
|
if (e->data2LineNumber() != CppUnitException::CPPUNIT_UNKNOWNLINENUMBER)
|
||||||
{
|
{
|
||||||
stream << " data lines "
|
stream << " data lines "
|
||||||
<< e->data1LineNumber()
|
<< e->data1LineNumber()
|
||||||
<< ", " << e->data2LineNumber();
|
<< ", " << e->data2LineNumber();
|
||||||
}
|
}
|
||||||
else if (e->data1LineNumber() != CppUnitException::CPPUNIT_UNKNOWNLINENUMBER)
|
else if (e->data1LineNumber() != CppUnitException::CPPUNIT_UNKNOWNLINENUMBER)
|
||||||
{
|
{
|
||||||
stream << " data line " << e->data1LineNumber();
|
stream << " data line " << e->data1LineNumber();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stream << "\n";
|
stream << "\n";
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TextTestResult::print(std::ostream& stream)
|
void TextTestResult::print(std::ostream& stream)
|
||||||
{
|
{
|
||||||
printHeader(stream);
|
printHeader(stream);
|
||||||
printErrors(stream);
|
printErrors(stream);
|
||||||
printFailures(stream);
|
printFailures(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TextTestResult::printHeader(std::ostream& stream)
|
void TextTestResult::printHeader(std::ostream& stream)
|
||||||
{
|
{
|
||||||
std::cout << "\n\n";
|
std::cout << "\n\n";
|
||||||
if (wasSuccessful())
|
if (wasSuccessful())
|
||||||
std::cout << "OK ("
|
std::cout << "OK ("
|
||||||
<< runTests() << " tests)"
|
<< runTests() << " tests)"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
else
|
else
|
||||||
std::cout << "!!!FAILURES!!!" << std::endl
|
std::cout << "!!!FAILURES!!!" << std::endl
|
||||||
<< "Runs: "
|
<< "Runs: "
|
||||||
<< runTests ()
|
<< runTests ()
|
||||||
<< " Failures: "
|
<< " Failures: "
|
||||||
<< testFailures ()
|
<< testFailures ()
|
||||||
<< " Errors: "
|
<< " Errors: "
|
||||||
<< testErrors ()
|
<< testErrors ()
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string TextTestResult::shortName(const std::string& testName)
|
std::string TextTestResult::shortName(const std::string& testName)
|
||||||
{
|
{
|
||||||
std::string::size_type pos = testName.rfind('.');
|
std::string::size_type pos = testName.rfind('.');
|
||||||
if (pos != std::string::npos)
|
if (pos != std::string::npos)
|
||||||
return std::string(testName, pos + 1);
|
return std::string(testName, pos + 1);
|
||||||
else
|
else
|
||||||
return testName;
|
return testName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace CppUnit
|
} // namespace CppUnit
|
||||||
|
|||||||
Reference in New Issue
Block a user