Added Visual Studio project and fixed up some warnings showing in VS

This commit is contained in:
Phil Nash 2010-11-12 19:32:13 +00:00
parent 7e8cfa714f
commit d8aa843c7d
14 changed files with 307 additions and 9 deletions

5
.gitignore vendored
View File

@ -1,3 +1,8 @@
Test/build
*.pbxuser
*.mode1v3
*.ncb
*.suo
Debug
Release
*.user

View File

@ -59,7 +59,7 @@ int main (int argc, char * const argv[])
if( result == 0 )
{
std::cout << "All tests completed successfully" << std::endl;
std::cout << "All " << runner.getSuccessCount() + runner.getFailureCount() << " tests completed successfully" << std::endl;
}
return result;
}

View File

@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCatch", "TestCatch\TestCatch.vcproj", "{A2F23B19-9CF7-4246-AE58-BC65E39C6F7E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A2F23B19-9CF7-4246-AE58-BC65E39C6F7E}.Debug|Win32.ActiveCfg = Debug|Win32
{A2F23B19-9CF7-4246-AE58-BC65E39C6F7E}.Debug|Win32.Build.0 = Debug|Win32
{A2F23B19-9CF7-4246-AE58-BC65E39C6F7E}.Release|Win32.ActiveCfg = Release|Win32
{A2F23B19-9CF7-4246-AE58-BC65E39C6F7E}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,33 @@
========================================================================
CONSOLE APPLICATION : TestCatch Project Overview
========================================================================
AppWizard has created this TestCatch application for you.
This file contains a summary of what you will find in each of the files that
make up your TestCatch application.
TestCatch.vcproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
TestCatch.cpp
This is the main application source file.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named TestCatch.pch and a precompiled types file named StdAfx.obj.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////

View File

@ -0,0 +1,8 @@
// TestCatch.cpp : Defines the entry point for the console application.
//
int main(int argc, char* argv[])
{
return 0;
}

View File

@ -0,0 +1,221 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="TestCatch"
ProjectGUID="{A2F23B19-9CF7-4246-AE58-BC65E39C6F7E}"
RootNamespace="TestCatch"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="4"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\..\TestMain.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
<Filter
Name="TestCases"
>
<File
RelativePath="..\..\..\ClassTests.cpp"
>
</File>
<File
RelativePath="..\..\..\ConditionTests.cpp"
>
</File>
<File
RelativePath="..\..\..\ExceptionTests.cpp"
>
</File>
<File
RelativePath="..\..\..\MessageTests.cpp"
>
</File>
<File
RelativePath="..\..\..\TrickyTests.cpp"
>
</File>
</Filter>
<File
RelativePath=".\ReadMe.txt"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -82,7 +82,7 @@ namespace Catch
}
///////////////////////////////////////////////////////////////////////////
virtual void EndTestCase( const Catch::TestCaseInfo& testInfo )
virtual void EndTestCase( const Catch::TestCaseInfo& )
{
m_config.stream() << "\t<OverallResult success='" << (m_currentTestSuccess ? "true" : "false" ) << "/>\n";
m_config.stream() << "</TestCase>" << std::endl;

View File

@ -74,7 +74,7 @@ namespace Catch
}
}
}
return runner.getFailures();
return runner.getFailureCount();
}
} // end namespace Catch

View File

@ -61,7 +61,7 @@ public:
}
template<typename RhsT>
MutableResultInfo& operator ||( const RhsT& rhs )
MutableResultInfo& operator ||( const RhsT& )
{
m_expressionIncomplete = true;
return *this;

View File

@ -25,7 +25,7 @@ namespace Catch
// -r --report <type>
// -o --output filename to write to
// -s --success report successful cases too
class ArgParser
class ArgParser : NonCopyable
{
enum Mode
{

View File

@ -17,4 +17,15 @@
#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line )
#define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ )
namespace Catch
{
class NonCopyable
{
NonCopyable( const NonCopyable& );
void operator = ( const NonCopyable& );
protected:
NonCopyable(){}
};
}
#endif // TWOBLUECUBES_CATCH_COMMON_H_INCLUDED

View File

@ -75,7 +75,7 @@ namespace Catch
mutable std::ostream m_os;
};
struct ITestReporter
struct ITestReporter : NonCopyable
{
virtual ~ITestReporter(){}

View File

@ -95,7 +95,7 @@ namespace Catch
{
testInfo.invoke();
}
catch( TestFailureException& ex )
catch( TestFailureException& )
{
// This just means the test was aborted due to failure
}
@ -118,7 +118,7 @@ namespace Catch
{
return m_successes;
}
std:: size_t getFailures() const
std:: size_t getFailureCount() const
{
return m_failures;
}

View File

@ -22,7 +22,7 @@ namespace Catch
public:
Section( const std::string& name, const std::string& description )
{
// !TBD notify the runner
(name, description); // !TBD notify the runner
}
operator bool()