mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Added test application for Boost.Test features
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@340 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
c1cf7e30bc
commit
ee1c42843c
3 changed files with 254 additions and 0 deletions
201
build/vc80/boost_test.vcproj
Normal file
201
build/vc80/boost_test.vcproj
Normal file
|
|
@ -0,0 +1,201 @@
|
||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="8.00"
|
||||||
|
Name="boost_test"
|
||||||
|
ProjectGUID="{C4D5F5D6-87FB-4A1F-8C9E-F2871E1A8DF1}"
|
||||||
|
RootNamespace="boost_test"
|
||||||
|
>
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"
|
||||||
|
/>
|
||||||
|
</Platforms>
|
||||||
|
<ToolFiles>
|
||||||
|
</ToolFiles>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="debug|Win32"
|
||||||
|
OutputDirectory="../../out/vc80/$(ConfigurationName)/tests/$(ProjectName)"
|
||||||
|
IntermediateDirectory="../../out/vc80/$(ConfigurationName)/tests/$(ProjectName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
AdditionalOptions="/Zm172"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories="../../src/libraries, ../../include"
|
||||||
|
PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="3"
|
||||||
|
RuntimeTypeInfo="true"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
PrecompiledHeaderThrough="$(ProjectName)_pch.h"
|
||||||
|
PrecompiledHeaderFile="$(IntDir)/$(ProjectName).pch"
|
||||||
|
AssemblerListingLocation="$(IntDir)/"
|
||||||
|
ObjectFile="$(IntDir)/"
|
||||||
|
ProgramDataBaseFileName="$(IntDir)/$(ProjectName).pdb"
|
||||||
|
WarningLevel="4"
|
||||||
|
SuppressStartupBanner="true"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
AdditionalDependencies=""
|
||||||
|
OutputFile="$(OutDir)/$(ProjectName).exe"
|
||||||
|
AdditionalLibraryDirectories="../../lib/vc80"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
SubSystem="1"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManifestTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAppVerifierTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
CommandLine="cd ../../run/vc80
"$(TargetDir)$(TargetName).exe" --result_code=no --report_level=no --log_level=warning --data_directory=../../data/tests/$(ProjectName)
"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="release|Win32"
|
||||||
|
OutputDirectory="../../out/vc80/$(ConfigurationName)/tests/$(ProjectName)"
|
||||||
|
IntermediateDirectory="../../out/vc80/$(ConfigurationName)/tests/$(ProjectName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
AdditionalOptions="/Zm162"
|
||||||
|
Optimization="2"
|
||||||
|
AdditionalIncludeDirectories="../../src/libraries, ../../include"
|
||||||
|
PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE"
|
||||||
|
BasicRuntimeChecks="0"
|
||||||
|
RuntimeLibrary="2"
|
||||||
|
RuntimeTypeInfo="true"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
PrecompiledHeaderThrough="$(ProjectName)_pch.h"
|
||||||
|
PrecompiledHeaderFile="$(IntDir)/$(ProjectName).pch"
|
||||||
|
AssemblerListingLocation="$(IntDir)/"
|
||||||
|
ObjectFile="$(IntDir)/"
|
||||||
|
ProgramDataBaseFileName="$(IntDir)/$(ProjectName).pdb"
|
||||||
|
WarningLevel="4"
|
||||||
|
SuppressStartupBanner="true"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
AdditionalDependencies=""
|
||||||
|
OutputFile="$(OutDir)/$(ProjectName).exe"
|
||||||
|
AdditionalLibraryDirectories="../../lib/vc80"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
SubSystem="1"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManifestTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAppVerifierTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
CommandLine="cd ../../run/vc80
"$(TargetDir)$(TargetName).exe" --result_code=no --report_level=no --log_level=warning --data_directory=../../data/tests/$(ProjectName)
"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
</Configurations>
|
||||||
|
<References>
|
||||||
|
</References>
|
||||||
|
<Files>
|
||||||
|
<Filter
|
||||||
|
Name="Source Files"
|
||||||
|
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx;h;hpp;hxx;hm;inl;inc;xsd"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\src\tests\boost_test\static_test.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
||||||
|
|
@ -8,6 +8,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pch_test", "pch_test.vcproj
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bench_test", "bench_test.vcproj", "{2D607783-30B9-46DE-81E2-28513B31D5D2}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bench_test", "bench_test.vcproj", "{2D607783-30B9-46DE-81E2-28513B31D5D2}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boost_test", "boost_test.vcproj", "{C4D5F5D6-87FB-4A1F-8C9E-F2871E1A8DF1}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
debug|Win32 = debug|Win32
|
debug|Win32 = debug|Win32
|
||||||
|
|
@ -30,6 +32,10 @@ Global
|
||||||
{2D607783-30B9-46DE-81E2-28513B31D5D2}.debug|Win32.Build.0 = debug|Win32
|
{2D607783-30B9-46DE-81E2-28513B31D5D2}.debug|Win32.Build.0 = debug|Win32
|
||||||
{2D607783-30B9-46DE-81E2-28513B31D5D2}.release|Win32.ActiveCfg = release|Win32
|
{2D607783-30B9-46DE-81E2-28513B31D5D2}.release|Win32.ActiveCfg = release|Win32
|
||||||
{2D607783-30B9-46DE-81E2-28513B31D5D2}.release|Win32.Build.0 = release|Win32
|
{2D607783-30B9-46DE-81E2-28513B31D5D2}.release|Win32.Build.0 = release|Win32
|
||||||
|
{C4D5F5D6-87FB-4A1F-8C9E-F2871E1A8DF1}.debug|Win32.ActiveCfg = debug|Win32
|
||||||
|
{C4D5F5D6-87FB-4A1F-8C9E-F2871E1A8DF1}.debug|Win32.Build.0 = debug|Win32
|
||||||
|
{C4D5F5D6-87FB-4A1F-8C9E-F2871E1A8DF1}.release|Win32.ActiveCfg = release|Win32
|
||||||
|
{C4D5F5D6-87FB-4A1F-8C9E-F2871E1A8DF1}.release|Win32.Build.0 = release|Win32
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
|
||||||
47
src/tests/boost_test/static_test.cpp
Normal file
47
src/tests/boost_test/static_test.cpp
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
//
|
||||||
|
// Copyright Mathieu Champlon 2011
|
||||||
|
//
|
||||||
|
// Distributed under the Boost Software License, Version 1.0. (See
|
||||||
|
// accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
//
|
||||||
|
|
||||||
|
#define BOOST_AUTO_TEST_MAIN
|
||||||
|
#include <boost/test/auto_unit_test.hpp>
|
||||||
|
#define BOOST_LIB_NAME boost_unit_test_framework
|
||||||
|
#include <boost/config/auto_link.hpp>
|
||||||
|
#include <iostream>
|
||||||
|
#include <turtle/mock.hpp>
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
struct fixture
|
||||||
|
{
|
||||||
|
fixture()
|
||||||
|
{
|
||||||
|
std::cout << __FUNCTION__ << std::endl;
|
||||||
|
//BOOST_FAIL( "oups" );
|
||||||
|
}
|
||||||
|
~fixture()
|
||||||
|
{
|
||||||
|
std::cout << __FUNCTION__ << std::endl;
|
||||||
|
//BOOST_FAIL( "oups" );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
BOOST_GLOBAL_FIXTURE( fixture );
|
||||||
|
|
||||||
|
struct s
|
||||||
|
{
|
||||||
|
MOCK_METHOD_EXT( f, 0, void(), f )
|
||||||
|
};
|
||||||
|
s s1;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE( some_test )
|
||||||
|
{
|
||||||
|
MOCK_EXPECT( s1, f ).once();
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE( some_other_test )
|
||||||
|
{
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue