mirror of
https://github.com/boostorg/regex.git
synced 2025-07-17 22:32:09 +02:00
Added optional code to time how long the test takes.
[SVN r11828]
This commit is contained in:
@ -46,6 +46,9 @@ using std::endl;
|
|||||||
#if defined(BOOST_MSVC) && defined(_DEBUG)
|
#if defined(BOOST_MSVC) && defined(_DEBUG)
|
||||||
#include <CRTDBG.H>
|
#include <CRTDBG.H>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef TIME_TEST
|
||||||
|
#include <boost/timer.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -82,6 +85,9 @@ int cpp_main(int argc, char * argv[])
|
|||||||
tmpFlag |= _CRTDBG_LEAK_CHECK_DF;
|
tmpFlag |= _CRTDBG_LEAK_CHECK_DF;
|
||||||
tmpFlag &= ~_CRTDBG_CHECK_CRT_DF;
|
tmpFlag &= ~_CRTDBG_CHECK_CRT_DF;
|
||||||
_CrtSetDbgFlag( tmpFlag );
|
_CrtSetDbgFlag( tmpFlag );
|
||||||
|
#endif
|
||||||
|
#ifdef TIME_TEST
|
||||||
|
boost::timer tim;
|
||||||
#endif
|
#endif
|
||||||
if(argc < 2)
|
if(argc < 2)
|
||||||
usage();
|
usage();
|
||||||
@ -113,6 +119,10 @@ int cpp_main(int argc, char * argv[])
|
|||||||
}
|
}
|
||||||
cout << line << " lines, " << tests << " tests completed in file " << argv[i] << endl;
|
cout << line << " lines, " << tests << " tests completed in file " << argv[i] << endl;
|
||||||
}
|
}
|
||||||
|
#ifdef TIME_TEST
|
||||||
|
double elapsed_time = tim.elapsed();
|
||||||
|
cout << "Elapsed time = " << elapsed_time << "s" << endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
return error_count;
|
return error_count;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user