[Compbench-devel] CompBenchmarks++/libcompbenchmarks/Benchmark Benchmark.cpp, 1.12, 1.13
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-08-02 17:06:54
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21841 Modified Files: Benchmark.cpp Log Message: Bench() returns a CBM::Result instance. Few changes in UI::Msgs used. Index: Benchmark.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark/Benchmark.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Benchmark.cpp 6 Jun 2007 21:36:28 -0000 1.12 --- Benchmark.cpp 2 Aug 2007 17:06:51 -0000 1.13 *************** *** 52,62 **** } ! std::string Benchmark::Bench(Compiler *C, ! CompilerOptions *O) { ! std::string r; std::string info; double end; char tmp[128]; int p_cm; --- 52,67 ---- } ! CBM::Result *Benchmark::Bench(Compiler *C, ! CompilerOptions *O) { ! std::string r = "0"; ! std::string r_hasTest = "0"; ! std::string r_test = "1"; ! std::string r_buildTime = "-1"; ! std::string r_execTime = "-1"; std::string info; double end; char tmp[128]; + CBM::Result *R = 0; int p_cm; *************** *** 64,69 **** cbmUI->msgGroup("Benchmark"); - p_cm=Package()->ContextMatches(C, O); p_status=Package()->getStatus(); --- 69,74 ---- cbmUI->msgGroup("Benchmark"); p_cm=Package()->ContextMatches(C, O); + r_hasTest=Package()->hasTest() ? "1" : "0"; p_status=Package()->getStatus(); *************** *** 71,79 **** Package()->Release(); } ! if (!p_cm) { Package()->Configure(C, O); Package()->Make(UO_force); ! Package()->Test(UO_force); } --- 76,85 ---- Package()->Release(); } ! if (!p_cm) { Package()->Configure(C, O); Package()->Make(UO_force); ! r_buildTime=Package()->buildTime(); ! r_test=Package()->Test(UO_force) ? "1" : "0"; } *************** *** 85,118 **** cbmUI->outputKO(info); cbmUI->outputKO(info); ! return("0"); } ! System()->startTimer(); ! r=bench(); ! Package()->System()->Chomp(r); ! if (r!="0") { ! end=System()->endTimer(); ! sprintf(tmp, "%f", end); ! lastExecutionTime=tmp; ! Package()->storeStatus(Package::Benchmarked); ! std::string i_tme = "Execution time : "; ! i_tme+=tmp; ! std::string i_r = "Result : "; ! i_r+=r; ! cbmUI->outputInfo(i_tme); ! cbmUI->outputInfo(i_r); ! cbmUI->outputOK(); ! cbmUI->outputOK(); ! } else { ! cbmUI->outputKO(); ! info="Benchmarking failed for "; ! info+=Package()->Name(); ! cbmUI->msgFatal(info); ! cbmUI->outputKO(); } ! return(r); } --- 91,124 ---- cbmUI->outputKO(info); cbmUI->outputKO(info); ! R=new CBM::Result(r, r_buildTime, r_execTime, ! r_hasTest, r_test); } ! if (!R) { ! System()->startTimer(); ! r=bench(); ! Package()->System()->Chomp(r); ! if (r!="0") { ! end=System()->endTimer(); ! sprintf(tmp, "%f", end); ! r_execTime=lastExecutionTime=tmp; ! Package()->storeStatus(Package::Benchmarked); ! } else { ! cbmUI->outputKO(); ! info="Benchmarking failed for "; ! info+=Package()->Name(); ! cbmUI->msgFatal(info); ! cbmUI->outputKO(); ! } ! R=new CBM::Result(r, r_buildTime, r_execTime, ! r_hasTest, r_test); } + cbmUI->outputInfo(R); + cbmUI->outputOK(); + cbmUI->outputOK(); ! return(R); } |