本文整理汇总了C++中CheckStatsNode函数的典型用法代码示例。如果您正苦于以下问题:C++ CheckStatsNode函数的具体用法?C++ CheckStatsNode怎么用?C++ CheckStatsNode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CheckStatsNode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fBuild
// TestTwoDLLs
//------------------------------------------------------------------------------
void TestDLL::TestTwoDLLs() const
{
FBuildOptions options;
options.m_ConfigFile = "Data/TestDLL/fbuild.bff";
options.m_ShowSummary = true; // required to generate stats for node count checks
FBuild fBuild( options );
TEST_ASSERT( fBuild.Initialize() );
const AStackString<> dllA( "../../../../tmp/Test/DLL/dllA.dll" );
const AStackString<> dllB( "../../../../tmp/Test/DLL/dllB.dll" );
// clean up anything left over from previous runs
EnsureFileDoesNotExist( dllA );
EnsureFileDoesNotExist( dllB );
// build dllB which depends on dllA
TEST_ASSERT( fBuild.Build( dllB ) );
TEST_ASSERT( fBuild.SaveDependencyGraph( GetTwoDLLsDBFileName() ) );
// make sure all output files are as expecter
EnsureFileExists( dllA );
EnsureFileExists( dllB );
// Check stats
// Seen, Built, Type
CheckStatsNode ( 5, 2, Node::FILE_NODE ); // 2 cpp files
CheckStatsNode ( 1, 1, Node::COMPILER_NODE );
CheckStatsNode ( 2, 2, Node::OBJECT_NODE );
CheckStatsNode ( 2, 2, Node::OBJECT_LIST_NODE );
CheckStatsNode ( 2, 2, Node::DLL_NODE );
CheckStatsTotal( 12, 9 );
}
示例2: fBuild
// TestLibMerge
//------------------------------------------------------------------------------
void TestBuildAndLinkLibrary::TestLibMerge() const
{
FBuildOptions options;
options.m_ForceCleanBuild = true;
options.m_ShowSummary = true; // required to generate stats for node count checks
options.m_ConfigFile = "Data/TestBuildAndLinkLibrary/fbuild.bff";
FBuild fBuild( options );
TEST_ASSERT( fBuild.Initialize() );
const AStackString<> lib( "../../../../tmp/Test/BuildAndLinkLibrary/merged.lib" );
// clean up anything left over from previous runs
EnsureFileDoesNotExist( lib );
// Build
TEST_ASSERT( fBuild.Build( lib ) );
TEST_ASSERT( fBuild.SaveDependencyGraph( GetMergeLibDBFileName() ) );
// make sure all output files are as expected
EnsureFileExists( lib );
// Check stats
// Seen, Built, Type
CheckStatsNode ( 7, 4, Node::FILE_NODE ); // 3x .cpp + 3x .h + librarian
CheckStatsNode ( 1, 1, Node::COMPILER_NODE );
CheckStatsNode ( 1, 1, Node::OBJECT_LIST_NODE );
CheckStatsNode ( 3, 3, Node::OBJECT_NODE );
CheckStatsNode ( 3, 3, Node::LIBRARY_NODE ); // 2 libs + merge lib
CheckStatsTotal( 15, 12 );
}
示例3: fBuild
// Build_CacheHit
//------------------------------------------------------------------------------
void TestCUDA::Build_CacheHit() const
{
FBuildOptions options;
options.m_ConfigFile = "Data/TestCUDA/cuda.bff";
options.m_UseCacheRead = true;
options.m_ShowSummary = true; // required to generate stats for node count checks
FBuild fBuild( options );
TEST_ASSERT( fBuild.Initialize( "../../../../tmp/Test/CUDA/cuda.fdb" ) );
const AStackString<> obj( "../../../../tmp/Test/CUDA/test.obj" );
// clean up anything left over from previous runs
EnsureFileDoesNotExist( obj );
// build (via alias)
TEST_ASSERT( fBuild.Build( AStackString<>( "CUDA-Obj" ) ) );
// make sure all output is where it is expected
EnsureFileExists( obj );
// Check stats
// Seen, Built, Type
CheckStatsNode ( 65, 65, Node::FILE_NODE ); // many included files
CheckStatsNode ( 1, 0, Node::COMPILER_NODE );
CheckStatsNode ( 1, 0, Node::OBJECT_NODE );
CheckStatsNode ( 1, 1, Node::OBJECT_LIST_NODE );
CheckStatsTotal( 68, 66 );
// Test we got a cache hit
const FBuildStats::Stats & objStats = fBuild.GetStats().GetStatsFor( Node::OBJECT_NODE );
TEST_ASSERT( objStats.m_NumCacheHits == 1 );
}
示例4: unity1
// TestGenerate_NoRebuild
//------------------------------------------------------------------------------
void TestUnity::TestGenerate_NoRebuild() const
{
AStackString<> unity1( "../../../../tmp/Test/Unity/Unity1.cpp" );
AStackString<> unity2( "../../../../tmp/Test/Unity/Unity2.cpp" );
EnsureFileExists( unity1 );
EnsureFileExists( unity2 );
// Unity must be "built" every time, but it only writes files when they change
// so record the time before and after
uint64_t dateTime1 = FileIO::GetFileLastWriteTime( unity1 );
uint64_t dateTime2 = FileIO::GetFileLastWriteTime( unity2 );
// NTFS file resolution is 100ns, so sleep long enough to ensure
// an invalid write would modify the time
Thread::Sleep( 1 ); // 1ms
FBuildStats stats = BuildGenerate();
// Make sure files have not been changed
TEST_ASSERT( dateTime1 == FileIO::GetFileLastWriteTime( unity1 ) );
TEST_ASSERT( dateTime2 == FileIO::GetFileLastWriteTime( unity2 ) );
// Check stats
// Seen, Built, Type
CheckStatsNode ( stats, 1, 1, Node::DIRECTORY_LIST_NODE );
CheckStatsNode ( stats, 1, 1, Node::UNITY_NODE );
CheckStatsTotal( stats, 2, 2 );
}
示例5: fBuild
// TestCopyFunction_SourceBasePath
//------------------------------------------------------------------------------
void TestCopy::TestCopyFunction_SourceBasePath() const
{
FBuildOptions options;
options.m_ConfigFile = "Data/TestCopy/copy.bff";
options.m_ShowSummary = true; // required to generate stats for node count checks
FBuild fBuild( options );
TEST_ASSERT( fBuild.Initialize() );
const AStackString<> dst1( "../../../../tmp/Test/Copy/SourceBasePath/TestCopy/a.txt" );
const AStackString<> dst2( "../../../../tmp/Test/Copy/SourceBasePath/TestCopy/b.txt" );
// clean up anything left over from previous runs
EnsureFileDoesNotExist( dst1 );
EnsureFileDoesNotExist( dst2 );
// build (via alias)
TEST_ASSERT( fBuild.Build( AStackString<>( "TestSourceBasePath" ) ) );
TEST_ASSERT( fBuild.SaveDependencyGraph( "../../../../tmp/Test/Copy/SourceBasePath/sourcebasepath.fdb" ) );
EnsureFileExists( dst1 );
EnsureFileExists( dst2 );
// Check stats
// Seen, Built, Type
CheckStatsNode ( 2, 2, Node::FILE_NODE );
CheckStatsNode ( 2, 2, Node::COPY_NODE );
CheckStatsNode ( 1, 1, Node::ALIAS_NODE );
CheckStatsTotal( 5, 5 );
}
示例6: obj
// TestPCHClang_NoRebuild
//------------------------------------------------------------------------------
void TestPrecompiledHeaders::TestPCHClang_NoRebuild() const
{
FBuildOptions options;
options.m_ConfigFile = "Data/TestPrecompiledHeaders/fbuild.bff";
options.m_ShowSummary = true; // required to generate stats for node count checks
AStackString<> obj( "../../../../ftmp/Test/PrecompiledHeaders/Clang/PCHUser.obj" );
AStackString<> pch( "../../../../ftmp/Test/PrecompiledHeaders/Clang/PrecompiledHeader.pch" );
FBuild fBuild( options );
TEST_ASSERT( fBuild.Initialize( GetPCHDBClangFileName() ) );
AStackString<> target( "PCHTestClang" );
TEST_ASSERT( fBuild.Build( target ) );
TEST_ASSERT( fBuild.SaveDependencyGraph( GetPCHDBClangFileName() ) );
// Check stats
// Seen, Built, Type
CheckStatsNode ( 2, 2, Node::FILE_NODE ); // cpp + pch
CheckStatsNode ( 1, 0, Node::COMPILER_NODE );
CheckStatsNode ( 2, 0, Node::OBJECT_NODE );// obj + pch obj
CheckStatsNode ( 1, 0, Node::OBJECT_LIST_NODE );
CheckStatsTotal( 6, 2 );
}
示例7: fBuild
// REGISTER_TEST( TestMixedAssemblyWithCPP ) // TODO:A Enable
REGISTER_TESTS_END
// TestSingleFile
//------------------------------------------------------------------------------
void TestCSharp::TestSingleFile() const
{
FBuildTestOptions options;
options.m_ConfigFile = "Tools/FBuild/FBuildTest/Data/TestCSharp/csharp.bff";
options.m_ForceCleanBuild = true;
FBuild fBuild( options );
TEST_ASSERT( fBuild.Initialize() );
// delete files from previous runs
EnsureFileDoesNotExist( "../tmp/Test/CSharp/csharpsingle.dll" );
// Build it
TEST_ASSERT( fBuild.Build( AStackString<>( "CSharp-Single-Target" ) ) );
TEST_ASSERT( fBuild.SaveDependencyGraph( "../tmp/Test/CSharp/csharpsingle.fdb" ) );
// Test output file
EnsureFileExists( "../tmp/Test/CSharp/csharpsingle.dll" );
// Check stats
// Seen, Built, Type
CheckStatsNode ( 1, 1, Node::COMPILER_NODE );
CheckStatsNode ( 1, 1, Node::FILE_NODE ); // 1 cs file
CheckStatsNode ( 1, 1, Node::CS_NODE );
CheckStatsNode ( 1, 1, Node::ALIAS_NODE );
CheckStatsTotal( 4, 4 );
}
示例8: fBuild
// TestMSVC_P
//------------------------------------------------------------------------------
void TestIncludeParser::TestMSVC_P() const
{
FBuildOptions options;
options.m_ShowSummary = true; // required to generate stats for node count checks
options.m_ConfigFile = "Data/TestIncludeParser/MSVC-P/fbuild.bff";
FBuild fBuild( options );
fBuild.Initialize();
const AStackString<> file( "../../../../tmp/Test/IncludeParser/MSVC-P/test.i" );
// clean up anything left over from previous runs
EnsureFileDoesNotExist( file );
// Build
TEST_ASSERT( fBuild.Build( AStackString<>( "MSVC-P" ) ) );
// make sure all output files are as expected
EnsureFileExists( file );
// Check stats
// Seen, Built, Type
CheckStatsNode ( 1, 1, Node::OBJECT_LIST_NODE );
CheckStatsNode ( 1, 1, Node::FILE_NODE );
CheckStatsNode ( 1, 1, Node::COMPILER_NODE );
CheckStatsNode ( 1, 1, Node::OBJECT_NODE );
CheckStatsTotal( 4, 4 );
}
示例9: fBuild
// TestMultipleFiles
//------------------------------------------------------------------------------
void TestCSharp::TestMultipleFiles() const
{
FBuildOptions options;
options.m_ConfigFile = "Data/TestCSharp/csharp.bff";
options.m_ForceCleanBuild = true;
options.m_ShowSummary = true; // required to generate stats for node count checks
FBuild fBuild( options );
TEST_ASSERT( fBuild.Initialize() );
// delete files from previous runs
EnsureFileDoesNotExist( "../../../../tmp/Test/CSharp/csharpmulti.dll" );
// Build it
TEST_ASSERT( fBuild.Build( AStackString<>( "CSharp-Multi-Target" ) ) );
TEST_ASSERT( fBuild.SaveDependencyGraph( "../../../../tmp/Test/CSharp/csharpmulti.fdb" ) );
// Test output files
EnsureFileExists( "../../../../tmp/Test/CSharp/csharpmulti.dll" );
// Check stats
// Seen, Built, Type
CheckStatsNode ( 3, 3, Node::FILE_NODE ); // 3x cs
CheckStatsNode ( 1, 1, Node::CS_NODE );
CheckStatsNode ( 1, 1, Node::ALIAS_NODE );
CheckStatsNode ( 1, 1, Node::DIRECTORY_LIST_NODE );
CheckStatsTotal( 6, 6 );
}
示例10: project
// TestFunction
//------------------------------------------------------------------------------
void TestProjectGeneration::TestFunction() const
{
AStackString<> project( "../../../../ftmp/Test/ProjectGeneration/testproj.vcxproj" );
AStackString<> solution( "../../../../ftmp/Test/ProjectGeneration/testsln.sln" );
AStackString<> filters( "../../../../ftmp/Test/ProjectGeneration/testproj.vcxproj.filters" );
EnsureFileDoesNotExist( project );
EnsureFileDoesNotExist( solution );
EnsureFileDoesNotExist( filters );
FBuildOptions options;
options.m_ConfigFile = "Data/TestProjectGeneration/fbuild.bff";
options.m_ForceCleanBuild = true;
options.m_ShowSummary = true; // required to generate stats for node count checks
FBuild fBuild( options );
TEST_ASSERT( fBuild.Initialize() );
TEST_ASSERT( fBuild.Build( AStackString<>( "TestSln" ) ) );
TEST_ASSERT( fBuild.SaveDependencyGraph( "../../../../ftmp/Test/ProjectGeneration/fbuild.fdb" ) );
EnsureFileExists( project );
EnsureFileExists( solution );
EnsureFileExists( filters );
// Check stats
// Seen, Built, Type
CheckStatsNode ( 1, 1, Node::DIRECTORY_LIST_NODE );
CheckStatsNode ( 1, 1, Node::VCXPROJECT_NODE );
CheckStatsNode ( 1, 1, Node::SLN_NODE );
CheckStatsNode ( 1, 1, Node::ALIAS_NODE );
CheckStatsTotal( 4, 4 );
}
示例11: srcFile
// MultipleCopyNodes
//------------------------------------------------------------------------------
void TestCopy::MultipleCopyNodes() const
{
const AStackString<> srcFile( "Data/TestGraph/library.cpp" );
const AStackString<> dstFileA( "../../../../tmp/Test/Graph/library.multiplecopynodes1.cpp" );
const AStackString<> dstFileB( "../../../../tmp/Test/Graph/library.multiplecopynodes2.cpp" );
const AStackString<> dstFileC( "../../../../tmp/Test/Graph/library.multiplecopynodes3.cpp" );
// check files are as expected before starting test
EnsureFileDoesNotExist( dstFileA );
EnsureFileDoesNotExist( dstFileB );
EnsureFileDoesNotExist( dstFileC );
EnsureFileExists( srcFile );
FBuildOptions options;
options.m_ShowSummary = true; // required to generate stats for node count checks
// build
{
FBuild fb( options );
NodeGraph & ng = fb.GetDependencyGraph();
// make a fileNode for the source
FileNode * srcNode = ng.CreateFileNode( srcFile );
Dependencies empty;
Node * copyA = ng.CreateCopyNode( dstFileA, srcNode, empty );
Node * copyB = ng.CreateCopyNode( dstFileB, (FileNode *)copyA, empty );
Node * copyC = ng.CreateCopyNode( dstFileC, (FileNode *)copyB, empty );
TEST_ASSERT( fb.Build( copyC ) );
TEST_ASSERT( fb.SaveDependencyGraph( "../../../../tmp/Test/Graph/multiplecopynode.fdb" ) );
EnsureFileExists( dstFileA );
EnsureFileExists( dstFileB );
EnsureFileExists( dstFileC );
// Check stats
// Seen, Built, Type
CheckStatsNode ( 1, 1, Node::FILE_NODE );
CheckStatsNode ( 3, 3, Node::COPY_NODE );
CheckStatsTotal( 4, 4 );
}
// check no rebuild
{
FBuild fb( options );
fb.Initialize( "../../../../tmp/Test/Graph/multiplecopynode.fdb" );
TEST_ASSERT( fb.Build( dstFileC ) );
// Check stats
// Seen, Built, Type
CheckStatsNode ( 1, 1, Node::FILE_NODE );
CheckStatsNode ( 3, 0, Node::COPY_NODE );
CheckStatsTotal( 4, 1 );
}
}
示例12: testFileName
REGISTER_TESTS_END
// SingleCopyNode
//------------------------------------------------------------------------------
void TestCopy::SingleCopyNode() const
{
const AStackString<> testFileName( "Data/TestGraph/library.cpp" );
const AStackString<> testFileNameCopy( "../../../../tmp/Test/Graph/library.copynode.cpp" );
// check files are in expected states
EnsureFileExists( testFileName );
EnsureFileDoesNotExist( testFileNameCopy );
FBuildOptions options;
options.m_ShowSummary = true; // required to generate stats for node count checks
// Build
{
FBuild fb( options );
NodeGraph & ng = fb.GetDependencyGraph();
// make a fileNode for the source
FileNode * srcNode = ng.CreateFileNode( testFileName );
// and an ObjectNode for the output
Dependencies empty;
Node * dstNode = ng.CreateCopyNode( testFileNameCopy, srcNode, empty );
TEST_ASSERT( fb.Build( dstNode ) );
TEST_ASSERT( fb.SaveDependencyGraph( "../../../../tmp/Test/Graph/singlecopynode.fdb" ) );
EnsureFileExists( testFileNameCopy );
// Check stats
// Seen, Built, Type
CheckStatsNode ( 1, 1, Node::FILE_NODE );
CheckStatsNode ( 1, 1, Node::COPY_NODE );
CheckStatsTotal( 2, 2 );
}
// check no rebuild
{
FBuild fb( options );
fb.Initialize( "../../../../tmp/Test/Graph/singlecopynode.fdb" );
TEST_ASSERT( fb.Build( testFileNameCopy ) );
// Check stats
// Seen, Built, Type
CheckStatsNode ( 1, 1, Node::FILE_NODE );
CheckStatsNode ( 1, 0, Node::COPY_NODE );
CheckStatsTotal( 2, 1 );
}
}
示例13: Build
// Test_NoBuild
//------------------------------------------------------------------------------
void TestCLR::Test_NoBuild() const
{
FBuildOptions options;
options.m_ShowSummary = true; // required to generate stats for node count checks
FBuildStats stats = Build( options, true, "CLR-Target" );
// Check stats
// Seen, Built, Type
CheckStatsNode ( stats, 3, 3, Node::FILE_NODE ); // cpp + h + mscorlib
CheckStatsNode ( stats, 1, 0, Node::COMPILER_NODE );
CheckStatsNode ( stats, 1, 0, Node::OBJECT_NODE );
CheckStatsNode ( stats, 1, 0, Node::LIBRARY_NODE );
CheckStatsNode ( stats, 1, 1, Node::ALIAS_NODE );
CheckStatsTotal( stats, 7, 4 );
}
示例14: EnsureFileDoesNotExist
// TestCompile
//------------------------------------------------------------------------------
void TestUnity::TestCompile() const
{
FBuildOptions options;
options.m_ForceCleanBuild = true;
options.m_ShowSummary = true; // required to generate stats for node count checks
EnsureFileDoesNotExist( "../../../../tmp/Test/Unity/Unity.lib" );
FBuildStats stats = BuildCompile( options, false ); // don't use DB
EnsureFileExists( "../../../../tmp/Test/Unity/Unity.lib" );
// Check stats
// Seen, Built, Type
uint32_t numF = 9; // pch + 2x generated unity files + 6 source cpp files
#if defined( __WINDOWS__ )
numF++; // pch.cpp
#endif
CheckStatsNode ( stats, 1, 1, Node::DIRECTORY_LIST_NODE );
CheckStatsNode ( stats, 1, 1, Node::UNITY_NODE );
CheckStatsNode ( stats, numF, 3, Node::FILE_NODE ); // pch + 2x generated unity files built
CheckStatsNode ( stats, 1, 1, Node::COMPILER_NODE );
CheckStatsNode ( stats, 3, 3, Node::OBJECT_NODE );
CheckStatsNode ( stats, 1, 1, Node::LIBRARY_NODE );
CheckStatsNode ( stats, 1, 1, Node::ALIAS_NODE );
CheckStatsTotal( stats, 8+numF, 11 );
}
示例15: fBuild
// BuildResource_NoRebuild
//------------------------------------------------------------------------------
void TestResources::BuildResource_NoRebuild() const
{
FBuildOptions options;
options.m_ConfigFile = "Data/TestResources/fbuild.bff";
options.m_ShowSummary = true; // required to generate stats for node count checks
FBuild fBuild( options );
fBuild.Initialize( "..\\..\\..\\..\\ftmp\\Test\\Resources\\resource.fdb" );
TEST_ASSERT( fBuild.Build( AStackString<>( "exe" ) ) );
// Check stats
// Seen, Built, Type
// NOTE: Don't test file nodes since test used windows.h
CheckStatsNode ( 2, 0, Node::OBJECT_NODE );
CheckStatsNode ( 1, 0, Node::OBJECT_LIST_NODE );
CheckStatsNode ( 1, 0, Node::LIBRARY_NODE );
CheckStatsNode ( 1, 1, Node::ALIAS_NODE );
CheckStatsNode ( 1, 0, Node::EXE_NODE );
}