mirror of
https://github.com/boostorg/regex.git
synced 2025-07-17 06:12:10 +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)
|
||||
#include <CRTDBG.H>
|
||||
#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_CHECK_CRT_DF;
|
||||
_CrtSetDbgFlag( tmpFlag );
|
||||
#endif
|
||||
#ifdef TIME_TEST
|
||||
boost::timer tim;
|
||||
#endif
|
||||
if(argc < 2)
|
||||
usage();
|
||||
@ -113,6 +119,10 @@ int cpp_main(int argc, char * argv[])
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user