Update of /cvsroot/compbench/CompBenchmarks++/Benchmark
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv4297
Modified Files:
Benchmark.cpp
Log Message:
resetContext() added;
Make() and Fetch() can be forced.
UO_* variables used.
Index: Benchmark.cpp
===================================================================
RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Benchmark.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Benchmark.cpp 3 Oct 2006 15:47:54 -0000 1.11
--- Benchmark.cpp 10 Oct 2006 16:49:41 -0000 1.12
***************
*** 4,7 ****
--- 4,9 ----
#include <UI/UI.h>
+ #include <cloptions.h>
+
#include <config.h>
***************
*** 39,42 ****
--- 41,57 ----
}
+ int CBMBenchmark::resetContext(void)
+ {
+ std::string contextFile;
+
+ contextFile=system->temporaryDirectory(CBMSystem::Status);
+ contextFile+="/";
+
+ contextFile+="bm-context-";
+ contextFile+=packageName();
+
+ return(system->unlink(contextFile));
+ }
+
std::string CBMBenchmark::localPackageAbsoluteName(void)
{
***************
*** 118,124 ****
{
std::string what = _currentCompiler->Binary();
! what+="-";
what+=_currentOptions->Options();
! return(system->md5(what));
}
--- 133,139 ----
{
std::string what = _currentCompiler->Binary();
! what+="\n";
what+=_currentOptions->Options();
! return(what);
}
***************
*** 385,394 ****
}
! int CBMBenchmark::Make(void)
{
int r;
std::string info;
! if (getStatus()>=Made) {
return(1);
}
--- 400,409 ----
}
! int CBMBenchmark::Make(int _force)
{
int r;
std::string info;
! if ((getStatus()>=Made) && (!_force)) {
return(1);
}
***************
*** 415,423 ****
int CBMBenchmark::Test(int _force)
{
! int r;
if (!hasTest())
return(1);
if ((!_force) &&
(getStatus()>=Benchmarked)) {
--- 430,443 ----
int CBMBenchmark::Test(int _force)
{
! int r;
! std::string dum;
if (!hasTest())
return(1);
+ if (getStatus()<Configured) {
+ UI->Fatal("Package is not configured");
+ }
+
if ((!_force) &&
(getStatus()>=Benchmarked)) {
***************
*** 429,436 ****
}
! UI->Information(CBMUI::BenchTest,
! packageName());
!
! r=test(_force);
if (r)
--- 449,464 ----
}
! if (UO_enableTestSuite) {
! UI->Information(CBMUI::BenchTest,
! packageName());
!
! r=test(_force);
! } else {
! dum=packageName();
! dum+=" : passed (disabled by user option).";
! UI->Information(CBMUI::BenchTest,
! dum);
! r=1;
! }
if (r)
***************
*** 452,456 ****
! if ((getStatus()!=Tested) && (hasTest())) {
info=benchmarkName();
info+=" not tested !";
--- 480,485 ----
! if (((getStatus()!=Tested) && (hasTest())) &&
! (UO_enableTestSuite)) {
info=benchmarkName();
info+=" not tested !";
***************
*** 493,499 ****
r=release();
! if (r)
storeStatus(Preconfigured);
! else {
info="Clean failed for ";
info+=packageName();
--- 522,529 ----
r=release();
! if (r) {
! resetContext();
storeStatus(Preconfigured);
! } else {
info="Clean failed for ";
info+=packageName();
***************
*** 508,516 ****
int r;
! r=Download();
if (!r)
return(0);
! r=Extract();
if (!r)
return(0);
--- 538,548 ----
int r;
! resetContext();
!
! r=Download(_force);
if (!r)
return(0);
! r=Extract(_force);
if (!r)
return(0);
***************
*** 522,530 ****
}
! r=PreConfigure();
return(r);
}
! int CBMBenchmark::Fetch(char *_source)
{
std::string dest = localPackageAbsoluteName();
--- 554,562 ----
}
! r=PreConfigure(_force);
return(r);
}
! int CBMBenchmark::Fetch(char *_source, int _force)
{
std::string dest = localPackageAbsoluteName();
***************
*** 533,537 ****
std::string md5;
! if (getStatus()>=Downloaded) {
return(1);
}
--- 565,569 ----
std::string md5;
! if ((getStatus()>=Downloaded) && (!_force)) {
return(1);
}
***************
*** 563,567 ****
{
std::string statusFile;
- std::string contextFile;
int r;
--- 595,598 ----
***************
*** 571,578 ****
statusFile=system->temporaryDirectory(CBMSystem::Status);
statusFile+="/";
-
- contextFile=statusFile;
- contextFile+="bm-context-";
- contextFile+=packageName();
statusFile+="bm-status-";
statusFile+=packageName();
--- 602,605 ----
***************
*** 582,586 ****
system->unlink(localPackageAbsoluteName().c_str());
system->unlink(statusFile.c_str());
! system->unlink(contextFile.c_str());
r=uninstall();
storeStatus(Unknown);
--- 609,613 ----
system->unlink(localPackageAbsoluteName().c_str());
system->unlink(statusFile.c_str());
! resetContext();
r=uninstall();
storeStatus(Unknown);
|