[Compbench-devel] CompBenchmarks++/Benchmark Benchmark-Autotools.cpp, 1.5, 1.6 Benchmark-Autotools.
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-01-18 18:44:11
|
Update of /cvsroot/compbench/CompBenchmarks++/Benchmark In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv18777 Modified Files: Benchmark-Autotools.cpp Benchmark-Autotools.h Benchmark-DLLoader.cpp Benchmark-DLLoader.h Benchmark-xZIP.cpp Benchmark-xZIP.h Benchmark.cpp Benchmark.h Package.cpp Package.h Log Message: CBM namespace. Index: Benchmark.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Benchmark.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Benchmark.h 15 Jan 2007 20:09:09 -0000 1.16 --- Benchmark.h 18 Jan 2007 18:44:01 -0000 1.17 *************** *** 15,83 **** #include <vector> ! class CBMSystem; ! /** \brief Defines an abstract benchmark. ! * ! * This class can be overloaded in order to get new external benchmarks and packages ! * supported by CompBenchmarks. Basically it sets up packages (like gzip), prepare, ! * and run associated benchmarks according to a given context. ! * ! * As most of times a distributed package have many benchmarks, it is usual that ! * a first abstraction defines all methods related to package is then overloaded to ! * get consistant informations about all related benchmarks. ! */ ! class CBMBenchmark ! { ! public: ! class CBMPackage *Package(void); ! private: ! protected: ! class CBMPackage *package; ! /** Constructor ! * Initialise the CBMBenchmark::system variable. */ ! CBMBenchmark(class CBMPackage *_package); ! /** Give object for underlaying system. ! Use package pointer. ! \sa package ! */ ! virtual CBMSystem *System(void); ! /** Pure virtual method to run benchmark ! * \return Benchmark's result (as number). ! */ ! virtual std::string bench(void) = 0; ! public: ! /** Display informations about benchmark ! */ ! void display(void); ! /** Benchmark name ! \return a std::string representing current benchmark's identification ! (e.g. gzip-1c) */ ! virtual std::string benchmarkName(void) = 0; ! /** Benchmark comments ! \return a std::string containing comments about current benchmark */ ! virtual std::string benchmarkComments(void) = 0; ! /** Run benchmark. ! * Uses bench(). Overloading is unadvised. ! * This step won't be done and'll return 1 if getStatus()>=CBMPackage::Benchmarked. ! * \return benchmark's result (performance) as a non-null positive number. May changes status. ! * \sa Make() ! * \sa status */ ! virtual std::string Bench(void); ! /** Virtual destructor */ ! virtual ~CBMBenchmark(); ! }; ! #define DLdeclare() \ ! extern "C" CBMPackage *cbmlib_getPackage(void) ! #define DLPackageWrapper_declare() \ ! virtual BenchmarkVector& Benchmarks(void); \ ! virtual CBMBenchmark *Benchmark(std::string bid); \ virtual int benchmarkNumber(void) --- 15,85 ---- #include <vector> ! namespace CBM { ! class System; ! /** \brief Defines an abstract benchmark. ! * ! * This class can be overloaded in order to get new external benchmarks and packages ! * supported by CompBenchmarks. Basically it sets up packages (like gzip), prepare, ! * and run associated benchmarks according to a given context. ! * ! * As most of times a distributed package have many benchmarks, it is usual that ! * a first abstraction defines all methods related to package is then overloaded to ! * get consistant informations about all related benchmarks. ! */ ! class Benchmark ! { ! public: ! class Package *Package(void); ! private: ! protected: ! class Package *package; ! /** Constructor ! * Initialise the Benchmark::system variable. */ ! Benchmark(class Package *_package); ! /** Give object for underlaying system. ! Use package pointer. ! \sa package ! */ ! virtual class System *System(void); ! /** Pure virtual method to run benchmark ! * \return Benchmark's result (as number). ! */ ! virtual std::string bench(void) = 0; ! public: ! /** Display informations about benchmark ! */ ! void display(void); ! /** Benchmark name ! \return a std::string representing current benchmark's identification ! (e.g. gzip-1c) */ ! virtual std::string benchmarkName(void) = 0; ! /** Benchmark comments ! \return a std::string containing comments about current benchmark */ ! virtual std::string benchmarkComments(void) = 0; ! /** Run benchmark. ! * Uses bench(). Overloading is unadvised. ! * This step won't be done and'll return 1 if getStatus()>=Package::Benchmarked. ! * \return benchmark's result (performance) as a non-null positive number. May changes status. ! * \sa Make() ! * \sa status */ ! virtual std::string Bench(void); ! /** Virtual destructor */ ! virtual ~Benchmark(); ! }; ! } ! #define DLdeclare() \ ! extern "C" CBM::Package *cbmlib_getPackage(void) ! #define DLPackageWrapper_declare() \ ! virtual CBM::BenchmarkVector& Benchmarks(void); \ ! virtual CBM::Benchmark *Benchmark(std::string bid); \ virtual int benchmarkNumber(void) Index: Benchmark-DLLoader.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Benchmark-DLLoader.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Benchmark-DLLoader.cpp 4 Jan 2007 18:56:13 -0000 1.5 --- Benchmark-DLLoader.cpp 18 Jan 2007 18:44:00 -0000 1.6 *************** *** 7,12 **** #include <config.h> std::vector<std::string> cbmlib_paths; ! std::vector<CBMPackage*> cbmlib_packages; /* cache... */ --- 7,13 ---- #include <config.h> + using namespace CBM; std::vector<std::string> cbmlib_paths; ! std::vector<Package*> cbmlib_packages; /* cache... */ *************** *** 79,86 **** int i; ! int n = cbmlib_paths.size(); for(i=0; i<n; i++) { ! tmp=cbmlib_paths[i]; tmp+="/libcompbenchmarks-bm-"; tmp+=package_id; --- 80,87 ---- int i; ! int n = CBM::cbmlib_paths.size(); for(i=0; i<n; i++) { ! tmp=CBM::cbmlib_paths[i]; tmp+="/libcompbenchmarks-bm-"; tmp+=package_id; *************** *** 100,108 **** cbmlib_internal *l; ! s = cbmlib_packages.size(); ! PACKAGE_AUTOPURGE=0; for(i=0; i<s; i++) { ! delete(cbmlib_packages[i]); } --- 101,109 ---- cbmlib_internal *l; ! s = CBM::cbmlib_packages.size(); ! CBM::PACKAGE_AUTOPURGE=0; for(i=0; i<s; i++) { ! delete(CBM::cbmlib_packages[i]); } Index: Package.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Package.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Package.h 15 Jan 2007 20:42:20 -0000 1.6 --- Package.h 18 Jan 2007 18:44:01 -0000 1.7 *************** *** 15,412 **** #include <vector> ! class CBMSystem; ! /** Defines a vector of benchmarks. ! Basically owned by CBMPackage instance. ! */ ! typedef std::vector<std::string> BenchmarkVector; ! /** \brief Defines an abstract package. ! * ! * This class can be overloaded in order to get new external packages ! * supported by CompBenchmarks. Basically it sets up packages (like gzip), ! * and prepares related benchmarks for evaluation. ! * ! * \sa CBMBenchmark ! */ ! class CBMPackage ! { ! public: ! /** Package status ! * Defines typedef used to code internal status of a given package */ ! typedef enum Status { Unknown, /*!< Unkown; benchmark/package probably ! * not yet installed */ ! Downloaded, /*!< Package has been downloaded and checksum ! * is Ok. */ ! Extracted, /*!< Package has been successfuly extracted */ ! Patched, /*!< Package has been patched (optional step) */ ! Preconfigured, /*!< Package is now preconfigured. Also ! * optionnal, but each package goes throught ! * that step */ ! Configured, /*!< Package is configured (./configure) */ ! Made, /*!< Package has been made (make) */ ! Tested, /*!< Package has been tested */ ! Benchmarked }; /*!< Benchmarked */ ! private: ! /** Package status ! * \sa CBMPackage::Status ! * \sa storeStatus() ! * \sa getStatus() ! * \sa readStatus() */ ! Status status; ! /** Expected MD5 on downloaded package ! * \return MD5 expected, as an std::string */ ! virtual std::string expectedMD5(void) = 0; ! /** Package's status ! * Initialise the status from file in the directory defined ! * by CBMSystem::Status. ! * ! * \sa CBMBenchmark::Status ! * \return 1 if ok. */ ! virtual int readStatus(void); ! protected: ! /** \sa Benchmarks() */ ! BenchmarkVector benchmarks; ! /** Stores current compiler. */ ! CBMCompiler *currentCompiler; ! /** Stores current (compiler) options. */ ! CBMCompilerOptions *currentOptions; ! /** System used */ ! class CBMSystem *system; ! /** Constructor ! * Initialise the CBMPackage::system variable. */ ! CBMPackage(class CBMSystem *_system); ! /** Pure method to extract package ! \return 1 if ok ! \sa Extract() ! \sa localPackageAbsoluteDirectory() */ ! virtual int extract(int _force = 0) = 0; ! /** Method to patch package ! * Must be overloaded to patch package. ! * \sa Patch() */ ! virtual int patch(int _force = 0); ! /** Method to test package. ! * Must be overloaded to test package using a method provided by package ! * maintainers. ! * \sa Test() */ ! virtual int test(int _force = 0); ! /** Pure virtual method to pre-configure package ! * Pre-configuration creates any needed elements (files or what ever) to benchmark ! * package. ! * \return 1 if ok. ! * \sa PreConfigure() ! */ ! virtual int preConfigure(int _force) = 0; ! /** Pure virtual method to configure package ! * Broadly speaking, this is ./configure ! * \sa Configure() ! * \return 1 if ok */ ! virtual int configure(CBMCompiler *_currentCompiler, ! CBMCompilerOptions *_currentOptions) = 0; ! /** Pure virtual method to build package ! * This could be a simple make, for instance. ! * \return 1 if ok ! * \sa Make() */ ! virtual int make(void) = 0; ! /** Pure virtual method to clean-up sources ! * Useful bettween two Make() to get all sources compiled with same environment. ! * \sa Release() ! * \sa Configure() ! * \sa Make() */ ! virtual int release(void) = 0; ! /** Uninstall benchmark ! * Removes information used by CompBenchmarks as well as any downloaded, extracted ! * or built element. Default behaviour should be ok in most case. ! * \return 1 if ok. */ ! virtual int uninstall(void); ! /** Gets a context ID ! * Give an unique ID according to compiler and options used. This can avoid useless ! * recompilations. ! * \return ID (MD5) as std::string ! * \sa Make() ! * \sa storeContext() ! * \sa ContextMatches() ! */ ! virtual std::string contextID(CBMCompiler *_currentCompiler, ! CBMCompilerOptions *_currentOptions); ! /** Stores (compilation) context ID ! * Stores the context ID for the current benchmark. ! * \sa contextID() ! * \sa ContextMatches() ! * \return 1 if ok ! */ ! virtual int storeContext(CBMCompiler *_currentCompiler, ! CBMCompilerOptions *_currentOptions); ! public: ! /** Indicates if the package needs patching ! * Must be overloaded if so. Returns 0 by default. ! * \return 0 by default, 1 if patch is needed. ! * \sa patch() ! * \sa Patch() ! */ ! virtual int hasPatch(void); ! /** Remove context. ! * \sa storeContext() ! */ ! virtual int resetContext(void); ! /** Display informations about package */ ! virtual void display(void); ! /** Display informations about all supported benchmarks */ ! virtual void displayBenchmarks(void); ! /** Get system abstraction object ! \return CBMSystem ! */ ! virtual CBMSystem *System(void); ! /** Get all supported benchmarks. ! \return Array of std::string. */ ! virtual BenchmarkVector& Benchmarks(void); ! /** Get supported benchmarks' number ! \return An integer */ ! virtual int benchmarkNumber(void); ! /** Get a benchmark according to its index ! \sa Benchmarks() ! \return A pointer to the benchmark instance */ ! virtual class CBMBenchmark *Benchmark(int i); ! /** Get a benchmark according to its identifier. ! \return References to a CBMBenchmark object */ ! virtual class CBMBenchmark *Benchmark(std::string bid); ! /** Stores benchmark status ! * Probably internal usage only. ! * \return 1 if ok ! * \sa readStatus() ! */ ! virtual int storeStatus(Status _status); ! /** Package name ! * \return a std::string like 'gzip', without quotes */ ! virtual std::string packageName(void); ! /** Package version ! * \return a std::string like '1.2.4', without quotes */ ! virtual std::string packageVersion(void) = 0; ! /** Package size, in bytes ! * \return an integer coding the size of package's archive (to download) in bytes. ! */ ! virtual int packageSize(void) = 0; ! /** Package comments ! * Gives comments about package. Short description, or what ever. ! * \return comments, as std::string ! */ ! virtual std::string packageComments(void) = 0; ! /** Package local filename ! * \return a relative filename containing the local name of the uncompressed ! * package (like 'gzip-1.2.4.tar.Z', without quotes) */ ! virtual std::string localPackageName(void) = 0; ! /** Benchmark's language ! * \return std::string (C or C++) */ ! virtual std::string language(void) = 0; ! /** Returns package or benchmark license ! \return a std::string describing license */ ! virtual std::string license(void) = 0; ! /** Returns package home page ! \return URL in std::string */ ! virtual std::string homePage(void) = 0; ! /** Author(s) of package ! \return std::string containing authors. */ ! virtual std::string author(void) = 0; ! /** Convenience method ! * \return local uncompressed absolute archive filename for benchmark. ! * \sa localPackageName() */ ! virtual std::string localPackageAbsoluteName(void); ! /** Convenience method ! * \return directory used for extracting package ! * \sa CBMSystem::Extract */ ! virtual std::string localPackageAbsoluteDirectory(void); ! /** Relative directory to extract package ! * \return relative directory to use (or used, depending) for package extraction ! * \sa CBMSystem::Extract */ ! virtual char* extractDirectory(void) = 0; ! /** Indicates if the package provides a test method. ! * Must be overloaded if so. Returns 0 by default. ! * \return 0 by default, 1 if patch is needed. ! * \sa test() ! * \sa Test() ! */ ! virtual int hasTest(void); ! /** URL used for downloading package. ! * \return std::string representing the URL of the package ! * \sa expectedMD5() */ ! virtual std::string downloadURL(void) = 0; ! /** Total size of the package ! * \return Total size, in bytes, of thepackage. This comprises data used ! * in pre-configuration step. ! * \sa preConfigure() ! * \sa packageSize() */ ! virtual int benchmarkSize(void); ! /** Compairs previous compilation context to current one ! * \return 1 if they match. ! * \sa contextID() ! * \sa storeContext() ! * \sa Make() ! */ ! virtual int ContextMatches(CBMCompiler *_currentCompiler, ! CBMCompilerOptions *_currentOptions); ! /** Download package. ! * Gets downloadURL() object from Internet and verify checksum. ! * Uses download(). Overloading is unadvised. ! * This step won't be done and'll return 1 if getStatus()>=CBMPackage::Downloaded. ! * \param _force sets to 1 to force operation. May changes status. ! * \return 1 if ok. ! * \sa status */ ! virtual int Download(int _force = 0); ! /** Extract package. ! * Extracts downloaded package. ! * Uses extract(). Overloading is unadvised. ! * This step won't be done and'll return 1 if getStatus()>=CBMPackage::Extracted. ! * \param _force sets to 1 to force operation. May changes status. ! * \return 1 if ok. ! * \sa Download() ! * \sa status */ ! virtual int Extract(int _force = 0); ! /** Patch package. ! * Patches extracted package. ! * Overloading is unadvised, 1 is returned without any action, by default. ! * If hasPatch() returns 1, uses patch(). ! * This step won't be done and'll return 1 if getStatus()>=CBMPackage::Patched. ! * \param _force sets to 1 to force operation. May changes status. ! * \return 1 if ok. ! * \sa Extract() ! * \sa status */ ! virtual int Patch(int _force = 0); ! /** Preconfigure package. ! * Preconfigure downloaded package. ! * Uses preConfigure(). Overloading is unadvised. ! * This step won't be done and'll return 1 if ! * getStatus()>=CBMPackage::PreConfigured. May changes status. ! * \param _force sets to 1 to force operation. ! * \return 1 if ok. ! * \sa Patch() ! * \sa status */ ! virtual int PreConfigure(int _force = 0); ! /** Configure package. ! * Configure downloaded package. ! * Uses configure(). Overloading is unadvised. Argument are used to keep ! * compiler and options used for current bench (context), even ! * if ./configure script is not present : they'll be used by Make(). ! * This step won't be done and'll return 1 if getStatus()>=CBMPackage::Configured. May changes status. ! * \return 1 if ok. ! * \sa Download() ! * \sa Release() ! * \sa ContextMatches() ! * \sa Make(). ! * \sa status */ ! virtual int Configure(CBMCompiler *_currentCompiler, ! CBMCompilerOptions *_currentOptions); ! /** Build package. ! * Builds package. ! * Uses make(). Overloading is unadvised. ! * This step won't be done and'll return 1 if getStatus()>=CBMPackage::Made. ! * \param _force sets to 1 to force operation. May changes status. ! * \return 1 if ok. May changes status. ! * \sa Configure() ! * \sa Release() ! * \sa status ! * \sa ContextMatches() */ ! virtual int Make(int _force = 0); ! /** Test a package. ! * Test a built package. ! * Overloading is unadvised, 1 is returned without any action, by default. ! * If hasPatch() returns 1, uses patch(). ! * This step won't be done and'll return 1 if getStatus()>=CBMPackage::Benchmarked. ! * \param _force sets to 1 to force operation. May changes status. ! * \return 1 if ok. ! * \sa Make() ! * \sa status */ ! virtual int Test(int _force = 0); ! /** Clean objects. ! * Uses release(). Overloading is unadvised. ! * This step won't be done and'll return 0 if getStatus()<CBMPackage::Made. May changes status. ! * \return 1 if ok. ! * \sa Bench() */ ! virtual int Release(void); ! /** Install package. ! * Installs package, uses, in that order Download(), Extract(), Patch() (if needed) ! * and PreConfigure(). Overloading is unadvised. ! * This step won't be done and'll return 1 if getStatus()>=CBMPackage::PreConfigured. ! * \param _force assign to 1 for forcing operation. ! * \return 1 if ok. May changes status. ! * \sa status */ ! virtual int Install(int _force = 0); ! /** Copy a local archive. ! * Copy package to directory defined by CBMSystem::Download. It'll be ready ! * to be extracted using Install(). ! * \param _source the archive file ! * \param _force assign to 1 for forcing operation. ! * \return 1 if ok. May changes status. ! * \sa status ! * \sa extract */ ! virtual int Fetch(char *_source, int _force = 0); ! /** Uninstall package. ! * Uses uninstall(). Overloading is unadvised. ! * This step won't be done and'll return 1 if getStatus()==CBMPackage::Unknown. ! * \return 1 if ok. May changes status. ! * \sa status */ ! virtual int Uninstall(void); ! /** Returns benchmark's status ! * \return status (enum). ! * \sa CBMPackage::Status */ ! virtual Status getStatus(void); ! /** Virtual destructor */ ! virtual ~CBMPackage(); ! }; #endif --- 15,414 ---- #include <vector> ! namespace CBM { ! class System; ! /** Defines a vector of benchmarks. ! Basically owned by CBM::Package instance. ! */ ! typedef std::vector<std::string> BenchmarkVector; ! /** \brief Defines an abstract package. ! * ! * This class can be overloaded in order to get new external packages ! * supported by CompBenchmarks. Basically it sets up packages (like gzip), ! * and prepares related benchmarks for evaluation. ! * ! * \sa Benchmark */ ! class Package ! { ! public: ! /** Package status ! * Defines typedef used to code internal status of a given package ! */ ! typedef enum Status { Unknown, /*!< Unkown; benchmark/package probably ! * not yet installed */ ! Downloaded, /*!< Package has been downloaded and checksum ! * is Ok. */ ! Extracted, /*!< Package has been successfuly extracted */ ! Patched, /*!< Package has been patched (optional step) */ ! Preconfigured, /*!< Package is now preconfigured. Also ! * optionnal, but each package goes throught ! * that step */ ! Configured, /*!< Package is configured (./configure) */ ! Made, /*!< Package has been made (make) */ ! Tested, /*!< Package has been tested */ ! Benchmarked }; /*!< Benchmarked */ ! private: ! /** Package status ! * \sa Package::Status ! * \sa storeStatus() ! * \sa getStatus() ! * \sa readStatus() */ ! Status status; ! /** Expected MD5 on downloaded package ! * \return MD5 expected, as an std::string */ ! virtual std::string expectedMD5(void) = 0; ! /** Package's status ! * Initialise the status from file in the directory defined ! * by CBM::System::Status. ! * ! * \sa Benchmark::Status ! * \return 1 if ok. */ ! virtual int readStatus(void); ! protected: ! /** \sa Benchmarks() */ ! BenchmarkVector benchmarks; ! /** Stores current compiler. */ ! Compiler *currentCompiler; ! /** Stores current (compiler) options. */ ! CompilerOptions *currentOptions; ! /** System used */ ! class System *system; ! /** Constructor ! * Initialise the Package::system variable. */ ! Package(class System *_system); ! /** Pure method to extract package ! \return 1 if ok ! \sa Extract() ! \sa localPackageAbsoluteDirectory() */ ! virtual int extract(int _force = 0) = 0; ! /** Method to patch package ! * Must be overloaded to patch package. ! * \sa Patch() */ ! virtual int patch(int _force = 0); ! /** Method to test package. ! * Must be overloaded to test package using a method provided by package ! * maintainers. ! * \sa Test() */ ! virtual int test(int _force = 0); ! /** Pure virtual method to pre-configure package ! * Pre-configuration creates any needed elements (files or what ever) to benchmark ! * package. ! * \return 1 if ok. ! * \sa PreConfigure() ! */ ! virtual int preConfigure(int _force) = 0; ! /** Pure virtual method to configure package ! * Broadly speaking, this is ./configure ! * \sa Configure() ! * \return 1 if ok */ ! virtual int configure(Compiler *_currentCompiler, ! CompilerOptions *_currentOptions) = 0; ! /** Pure virtual method to build package ! * This could be a simple make, for instance. ! * \return 1 if ok ! * \sa Make() */ ! virtual int make(void) = 0; ! /** Pure virtual method to clean-up sources ! * Useful bettween two Make() to get all sources compiled with same environment. ! * \sa Release() ! * \sa Configure() ! * \sa Make() */ ! virtual int release(void) = 0; ! /** Uninstall benchmark ! * Removes information used by CompBenchmarks as well as any downloaded, extracted ! * or built element. Default behaviour should be ok in most case. ! * \return 1 if ok. */ ! virtual int uninstall(void); ! /** Gets a context ID ! * Give an unique ID according to compiler and options used. This can avoid useless ! * recompilations. ! * \return ID (MD5) as std::string ! * \sa Make() ! * \sa storeContext() ! * \sa ContextMatches() ! */ ! virtual std::string contextID(Compiler *_currentCompiler, ! CompilerOptions *_currentOptions); ! /** Stores (compilation) context ID ! * Stores the context ID for the current benchmark. ! * \sa contextID() ! * \sa ContextMatches() ! * \return 1 if ok ! */ ! virtual int storeContext(Compiler *_currentCompiler, ! CompilerOptions *_currentOptions); ! public: ! /** Indicates if the package needs patching ! * Must be overloaded if so. Returns 0 by default. ! * \return 0 by default, 1 if patch is needed. ! * \sa patch() ! * \sa Patch() ! */ ! virtual int hasPatch(void); ! /** Remove context. ! * \sa storeContext() ! */ ! virtual int resetContext(void); ! /** Display informations about package */ ! virtual void display(void); ! /** Display informations about all supported benchmarks */ ! virtual void displayBenchmarks(void); ! /** Get system abstraction object ! \return CBM::System ! */ ! virtual class System *System(void); ! /** Get all supported benchmarks. ! \return Array of std::string. */ ! virtual BenchmarkVector& Benchmarks(void); ! /** Get supported benchmarks' number ! \return An integer */ ! virtual int benchmarkNumber(void); ! /** Get a benchmark according to its index ! \sa Benchmarks() ! \return A pointer to the benchmark instance */ ! virtual class Benchmark *Benchmark(int i); ! /** Get a benchmark according to its identifier. ! \return References to a Benchmark object */ ! virtual class Benchmark *Benchmark(std::string bid); ! /** Stores benchmark status ! * Probably internal usage only. ! * \return 1 if ok ! * \sa readStatus() ! */ ! virtual int storeStatus(Status _status); ! /** Package name ! * \return a std::string like 'gzip', without quotes */ ! virtual std::string packageName(void); ! /** Package version ! * \return a std::string like '1.2.4', without quotes */ ! virtual std::string packageVersion(void) = 0; ! /** Package size, in bytes ! * \return an integer coding the size of package's archive (to download) in bytes. ! */ ! virtual int packageSize(void) = 0; ! /** Package comments ! * Gives comments about package. Short description, or what ever. ! * \return comments, as std::string ! */ ! virtual std::string packageComments(void) = 0; ! /** Package local filename ! * \return a relative filename containing the local name of the uncompressed ! * package (like 'gzip-1.2.4.tar.Z', without quotes) */ ! virtual std::string localPackageName(void) = 0; ! /** Benchmark's language ! * \return std::string (C or C++) */ ! virtual std::string language(void) = 0; ! /** Returns package or benchmark license ! \return a std::string describing license */ ! virtual std::string license(void) = 0; ! /** Returns package home page ! \return URL in std::string */ ! virtual std::string homePage(void) = 0; ! /** Author(s) of package ! \return std::string containing authors. */ ! virtual std::string author(void) = 0; ! /** Convenience method ! * \return local uncompressed absolute archive filename for benchmark. ! * \sa localPackageName() */ ! virtual std::string localPackageAbsoluteName(void); ! /** Convenience method ! * \return directory used for extracting package ! * \sa CBM::System::Extract */ ! virtual std::string localPackageAbsoluteDirectory(void); ! /** Relative directory to extract package ! * \return relative directory to use (or used, depending) for package extraction ! * \sa CBM::System::Extract */ ! virtual char* extractDirectory(void) = 0; ! /** Indicates if the package provides a test method. ! * Must be overloaded if so. Returns 0 by default. ! * \return 0 by default, 1 if patch is needed. ! * \sa test() ! * \sa Test() ! */ ! virtual int hasTest(void); ! /** URL used for downloading package. ! * \return std::string representing the URL of the package ! * \sa expectedMD5() */ ! virtual std::string downloadURL(void) = 0; ! /** Total size of the package ! * \return Total size, in bytes, of thepackage. This comprises data used ! * in pre-configuration step. ! * \sa preConfigure() ! * \sa packageSize() */ ! virtual int benchmarkSize(void); ! /** Compairs previous compilation context to current one ! * \return 1 if they match. ! * \sa contextID() ! * \sa storeContext() ! * \sa Make() ! */ ! virtual int ContextMatches(Compiler *_currentCompiler, ! CompilerOptions *_currentOptions); ! /** Download package. ! * Gets downloadURL() object from Internet and verify checksum. ! * Uses download(). Overloading is unadvised. ! * This step won't be done and'll return 1 if getStatus()>=Package::Downloaded. ! * \param _force sets to 1 to force operation. May changes status. ! * \return 1 if ok. ! * \sa status */ ! virtual int Download(int _force = 0); ! /** Extract package. ! * Extracts downloaded package. ! * Uses extract(). Overloading is unadvised. ! * This step won't be done and'll return 1 if getStatus()>=Package::Extracted. ! * \param _force sets to 1 to force operation. May changes status. ! * \return 1 if ok. ! * \sa Download() ! * \sa status */ ! virtual int Extract(int _force = 0); ! /** Patch package. ! * Patches extracted package. ! * Overloading is unadvised, 1 is returned without any action, by default. ! * If hasPatch() returns 1, uses patch(). ! * This step won't be done and'll return 1 if getStatus()>=Package::Patched. ! * \param _force sets to 1 to force operation. May changes status. ! * \return 1 if ok. ! * \sa Extract() ! * \sa status */ ! virtual int Patch(int _force = 0); ! /** Preconfigure package. ! * Preconfigure downloaded package. ! * Uses preConfigure(). Overloading is unadvised. ! * This step won't be done and'll return 1 if ! * getStatus()>=Package::PreConfigured. May changes status. ! * \param _force sets to 1 to force operation. ! * \return 1 if ok. ! * \sa Patch() ! * \sa status */ ! virtual int PreConfigure(int _force = 0); ! /** Configure package. ! * Configure downloaded package. ! * Uses configure(). Overloading is unadvised. Argument are used to keep ! * compiler and options used for current bench (context), even ! * if ./configure script is not present : they'll be used by Make(). ! * This step won't be done and'll return 1 if getStatus()>=Package::Configured. May changes status. ! * \return 1 if ok. ! * \sa Download() ! * \sa Release() ! * \sa ContextMatches() ! * \sa Make(). ! * \sa status */ ! virtual int Configure(Compiler *_currentCompiler, ! CompilerOptions *_currentOptions); ! /** Build package. ! * Builds package. ! * Uses make(). Overloading is unadvised. ! * This step won't be done and'll return 1 if getStatus()>=Package::Made. ! * \param _force sets to 1 to force operation. May changes status. ! * \return 1 if ok. May changes status. ! * \sa Configure() ! * \sa Release() ! * \sa status ! * \sa ContextMatches() */ ! virtual int Make(int _force = 0); ! /** Test a package. ! * Test a built package. ! * Overloading is unadvised, 1 is returned without any action, by default. ! * If hasPatch() returns 1, uses patch(). ! * This step won't be done and'll return 1 if getStatus()>=Package::Benchmarked. ! * \param _force sets to 1 to force operation. May changes status. ! * \return 1 if ok. ! * \sa Make() ! * \sa status */ ! virtual int Test(int _force = 0); ! /** Clean objects. ! * Uses release(). Overloading is unadvised. ! * This step won't be done and'll return 0 if getStatus()<Package::Made. May changes status. ! * \return 1 if ok. ! * \sa Bench() */ ! virtual int Release(void); ! /** Install package. ! * Installs package, uses, in that order Download(), Extract(), Patch() (if needed) ! * and PreConfigure(). Overloading is unadvised. ! * This step won't be done and'll return 1 if getStatus()>=Package::PreConfigured. ! * \param _force assign to 1 for forcing operation. ! * \return 1 if ok. May changes status. ! * \sa status */ ! virtual int Install(int _force = 0); ! /** Copy a local archive. ! * Copy package to directory defined by CBM::System::Download. It'll be ready ! * to be extracted using Install(). ! * \param _source the archive file ! * \param _force assign to 1 for forcing operation. ! * \return 1 if ok. May changes status. ! * \sa status ! * \sa extract */ ! virtual int Fetch(char *_source, int _force = 0); ! /** Uninstall package. ! * Uses uninstall(). Overloading is unadvised. ! * This step won't be done and'll return 1 if getStatus()==Package::Unknown. ! * \return 1 if ok. May changes status. ! * \sa status */ ! virtual int Uninstall(void); ! /** Returns benchmark's status ! * \return status (enum). ! * \sa Package::Status */ ! virtual Status getStatus(void); ! /** Virtual destructor */ ! virtual ~Package(); ! }; ! } #endif Index: Benchmark-xZIP.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Benchmark-xZIP.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Benchmark-xZIP.cpp 3 Jan 2007 22:02:11 -0000 1.3 --- Benchmark-xZIP.cpp 18 Jan 2007 18:44:00 -0000 1.4 *************** *** 4,13 **** #include <fstream> ! CBMPackagexZIP::CBMPackagexZIP(CBMSystem *_system) ! : CBMPackageAutotools(_system) { } ! int CBMPackagexZIP::preConfigure(int _force) { std::string fileName; --- 4,15 ---- #include <fstream> ! using namespace CBM; ! ! PackagexZIP::PackagexZIP(CBM::System *_system) ! : PackageAutotools(_system) { } ! int PackagexZIP::preConfigure(int _force) { std::string fileName; *************** *** 28,41 **** } ! CBMPackagexZIP::~CBMPackagexZIP() { } ! CBMBenchmarkxZIP::CBMBenchmarkxZIP(CBMPackage *_package) ! : CBMBenchmark(_package) { } ! std::string CBMBenchmarkxZIP::bench(void) { time_t start = System()->Time(); --- 30,43 ---- } ! PackagexZIP::~PackagexZIP() { } ! BenchmarkxZIP::BenchmarkxZIP(CBM::Package *_package) ! : Benchmark(_package) { } ! std::string BenchmarkxZIP::bench(void) { time_t start = System()->Time(); *************** *** 64,68 **** } ! CBMBenchmarkxZIP::~CBMBenchmarkxZIP() { } --- 66,70 ---- } ! BenchmarkxZIP::~BenchmarkxZIP() { } Index: Benchmark.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Benchmark.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Benchmark.cpp 4 Jan 2007 18:56:13 -0000 1.19 --- Benchmark.cpp 18 Jan 2007 18:44:01 -0000 1.20 *************** *** 6,15 **** #include <UI/UI.h> ! CBMBenchmark::CBMBenchmark(CBMPackage *_package) { package=_package; } ! void CBMBenchmark::display(void) { std::cout << "benchmark::Name=" << benchmarkName() << std::endl --- 6,17 ---- #include <UI/UI.h> ! using namespace CBM; ! ! Benchmark::Benchmark(CBM::Package *_package) { package=_package; } ! void Benchmark::display(void) { std::cout << "benchmark::Name=" << benchmarkName() << std::endl *************** *** 22,31 **** } ! CBMPackage *CBMBenchmark::Package(void) { return(package); } ! CBMSystem *CBMBenchmark::System(void) { if (package) --- 24,33 ---- } ! Package *Benchmark::Package(void) { return(package); } ! System *Benchmark::System(void) { if (package) *************** *** 35,39 **** } ! std::string CBMBenchmark::Bench(void) { std::string r; --- 37,41 ---- } ! std::string Benchmark::Bench(void) { std::string r; *************** *** 41,55 **** ! if (((Package()->getStatus()<CBMPackage::Tested) && (Package()->hasTest())) && (UO_enableTestSuite)) { info=benchmarkName(); info+=" not tested !"; ! UI->Information(CBMUI::BenchTest, ! info); return("0"); } ! UI->Information(CBMUI::BenchBench, benchmarkName()); --- 43,57 ---- ! if (((Package()->getStatus()<Package::Tested) && (Package()->hasTest())) && (UO_enableTestSuite)) { info=benchmarkName(); info+=" not tested !"; ! cbmUI->Information(CBM::UI::BenchTest, ! info); return("0"); } ! cbmUI->Information(CBM::UI::BenchBench, benchmarkName()); *************** *** 58,68 **** if (r!="0") { ! Package()->storeStatus(CBMPackage::Benchmarked); ! UI->Information(CBMUI::BenchResult, r); } else { info="Benchmarking failed for "; info+=Package()->packageName(); ! UI->Fatal(info); } --- 60,70 ---- if (r!="0") { ! Package()->storeStatus(Package::Benchmarked); ! cbmUI->Information(CBM::UI::BenchResult, r); } else { info="Benchmarking failed for "; info+=Package()->packageName(); ! cbmUI->Fatal(info); } *************** *** 70,74 **** } ! CBMBenchmark::~CBMBenchmark() { } --- 72,76 ---- } ! Benchmark::~Benchmark() { } Index: Benchmark-xZIP.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Benchmark-xZIP.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Benchmark-xZIP.h 3 Jan 2007 22:02:11 -0000 1.3 --- Benchmark-xZIP.h 18 Jan 2007 18:44:01 -0000 1.4 *************** *** 12,74 **** #include <Benchmark/Benchmark-Autotools.h> ! /** \brief Defines an abstract package based on ZIP utilities. ! * ! * This class can be overloaded in order to get new external packages ! * supported by CompBenchmarks. It provides a 70M (through preConfigure()) ! * file that can be compressed. ! * \sa CBMBenchmarkxZIP ! */ ! class CBMPackagexZIP : public CBMPackageAutotools ! { ! private: ! ! protected: ! /** Pre-configure package ! * Creates a ~70M files used for compression benchmarks. ! * \param _force must be set to 1 to force operation. ! * \sa CBMBenchmark::preConfigure() */ ! virtual int preConfigure(int _force = 0); ! public: ! /** Constructor */ ! CBMPackagexZIP(class CBMSystem *_system); ! /** Virtual destructor */ ! virtual ~CBMPackagexZIP(); ! }; ! /** \brief Defines an abstract benchmark based on ZIP utilities. ! * ! * This class can be overloaded in order to get new external packages ! * supported by CompBenchmarks. It provides a 70M (through preConfigure()) ! * file that can be compressed. ! * \sa CBMPackagexZIP ! */ ! class CBMBenchmarkxZIP : public CBMBenchmark ! { ! protected: ! CBMBenchmarkxZIP(CBMPackage *_package); ! /** Compression level ! \return compression level ("0" .. "9") used. ! */ ! virtual char* compressionLevel(void) = 0; ! /** Program name ! \return std::string like gzip or bzip2. ! */ ! virtual std::string benchmarkProgram(void) = 0; ! /** Runs the benchmark ! * Gives the amount of compressed bytes per seconds (as CompBenchmarks always apply ! * "bigger is better" policy to benchmarks' results, we can just rely on time). */ ! virtual std::string bench(void); ! virtual ~CBMBenchmarkxZIP(); ! }; #endif --- 12,75 ---- #include <Benchmark/Benchmark-Autotools.h> + namespace CBM { + /** \brief Defines an abstract package based on ZIP utilities. + * + * This class can be overloaded in order to get new external packages + * supported by CompBenchmarks. It provides a 70M (through preConfigure()) + * file that can be compressed. + * \sa CBM::BenchmarkxZIP + */ + class PackagexZIP : public PackageAutotools + { + private: ! protected: ! /** Pre-configure package ! * Creates a ~70M files used for compression benchmarks. ! * \param _force must be set to 1 to force operation. ! * \sa CBM::Benchmark::preConfigure() */ ! virtual int preConfigure(int _force = 0); ! public: ! /** Constructor */ ! PackagexZIP(class System *_system); ! /** Virtual destructor */ ! virtual ~PackagexZIP(); ! }; ! /** \brief Defines an abstract benchmark based on ZIP utilities. ! * ! * This class can be overloaded in order to get new external packages ! * supported by CompBenchmarks. It provides a 70M (through preConfigure()) ! * file that can be compressed. ! * \sa PackagexZIP ! */ ! class BenchmarkxZIP : public Benchmark ! { ! protected: ! BenchmarkxZIP(CBM::Package *_package); ! /** Compression level ! \return compression level ("0" .. "9") used. ! */ ! virtual char* compressionLevel(void) = 0; ! /** Program name ! \return std::string like gzip or bzip2. ! */ ! virtual std::string benchmarkProgram(void) = 0; ! /** Runs the benchmark ! * Gives the amount of compressed bytes per seconds (as CompBenchmarks always apply ! * "bigger is better" policy to benchmarks' results, we can just rely on time). */ ! virtual std::string bench(void); ! virtual ~BenchmarkxZIP(); ! }; ! } #endif Index: Benchmark-DLLoader.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Benchmark-DLLoader.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Benchmark-DLLoader.h 3 Jan 2007 22:02:28 -0000 1.4 --- Benchmark-DLLoader.h 18 Jan 2007 18:44:00 -0000 1.5 *************** *** 17,51 **** #include <vector> ! /** Paths to libraries */ ! extern std::vector<std::string> cbmlib_paths; ! ! extern std::vector<CBMPackage*> cbmlib_packages; ! ! extern int PACKAGE_AUTOPURGE; ! /** Function prototype for accessing a CBMPackage object */ ! typedef CBMPackage* (*cbmlib_internal_getPackage_t)(void); ! /** Low-level internal benchmark's shared library object */ ! typedef struct cbmlib_internal { ! void *library; ! cbmlib_internal_getPackage_t PackageGet; ! }; ! /** \brief Low-level library loading according to the benchmark/package's ! internal name. ! \param package_id something like gzip, bzip2, nbench and so on. ! */ ! cbmlib_internal *cbmlib_load(char *package_id); ! /** \brief Low-level function to Get a CBMBenchmark instance from a ! * shared library. ! * \param bench_id gzip-1c, benchpp-whetstone and so on. ! * \param _system A system instance. ! */ ! CBMBenchmark *cbmlib_bench_load(char *bench_id, CBMSystem *_system); ! /** \brief Low-level function for removing any internal existing reference to shared libraries. */ ! void cbmlib_done(void); #endif --- 17,53 ---- #include <vector> ! namespace CBM { ! /** Paths to libraries */ ! extern std::vector<std::string> cbmlib_paths; ! extern std::vector<Package*> cbmlib_packages; ! extern int PACKAGE_AUTOPURGE; ! /** Function prototype for accessing a Package object */ ! typedef Package* (*cbmlib_internal_getPackage_t)(void); ! /** Low-level internal benchmark's shared library object */ ! typedef struct cbmlib_internal { ! void *library; ! cbmlib_internal_getPackage_t PackageGet; ! }; ! /** \brief Low-level library loading according to the benchmark/package's ! internal name. ! \param package_id something like gzip, bzip2, nbench and so on. ! */ ! cbmlib_internal *cbmlib_load(char *package_id); ! ! /** \brief Low-level function to Get a CBMBenchmark instance from a ! * shared library. ! * \param bench_id gzip-1c, benchpp-whetstone and so on. ! * \param _system A system instance. ! */ ! Benchmark *cbmlib_bench_load(char *bench_id, System *_system); ! ! /** \brief Low-level function for removing any internal existing reference to shared libraries. */ ! void cbmlib_done(void); ! } #endif Index: Package.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Package.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Package.cpp 15 Jan 2007 20:08:37 -0000 1.6 --- Package.cpp 18 Jan 2007 18:44:01 -0000 1.7 *************** *** 15,19 **** #include <string> ! CBMPackage::CBMPackage(CBMSystem *_system) { system=_system; --- 15,21 ---- #include <string> ! using namespace CBM; ! ! Package::Package(CBM::System *_system) { system=_system; *************** *** 23,32 **** } ! BenchmarkVector& CBMPackage::Benchmarks(void) { return(benchmarks); } ! int CBMPackage::benchmarkNumber(void) { Benchmarks(); --- 25,34 ---- } ! BenchmarkVector& Package::Benchmarks(void) { return(benchmarks); } ! int Package::benchmarkNumber(void) { Benchmarks(); *************** *** 34,38 **** } ! CBMBenchmark *CBMPackage::Benchmark(int i) { Benchmarks(); --- 36,40 ---- } ! Benchmark *Package::Benchmark(int i) { Benchmarks(); *************** *** 40,50 **** } ! CBMBenchmark *CBMPackage::Benchmark(std::string bid) { ! std::cerr << "virtual CBMPackage::Benchmark() called" << std::endl; return(0); } ! void CBMPackage::display(void) { std::cout << "package::Name=" << packageName() << std::endl --- 42,52 ---- } ! Benchmark *Package::Benchmark(std::string bid) { ! std::cerr << "virtual Package::Benchmark() called" << std::endl; return(0); } ! void Package::display(void) { std::cout << "package::Name=" << packageName() << std::endl *************** *** 58,66 **** } ! void CBMPackage::displayBenchmarks(void) { ! int i; ! int n; ! CBMBenchmark *B; n=benchmarkNumber(); --- 60,68 ---- } ! void Package::displayBenchmarks(void) { ! int i; ! int n; ! CBM::Benchmark *B; n=benchmarkNumber(); *************** *** 71,85 **** } ! CBMSystem *CBMPackage::System(void) { return(system); } ! std::string CBMPackage::packageName(void) { return(""); } ! int CBMPackage::readStatus(void) { char s; --- 73,87 ---- } ! System *Package::System(void) { return(system); } ! std::string Package::packageName(void) { return(""); } ! int Package::readStatus(void) { char s; *************** *** 103,111 **** } ! int CBMPackage::resetContext(void) { std::string contextFile; ! contextFile=system->temporaryDirectory(CBMSystem::Status); contextFile+="/"; --- 105,113 ---- } ! int Package::resetContext(void) { std::string contextFile; ! contextFile=system->temporaryDirectory(System::Status); contextFile+="/"; *************** *** 116,122 **** } ! std::string CBMPackage::localPackageAbsoluteName(void) { ! std::string localFile = system->temporaryDirectory(CBMSystem::Download); localFile+="/"; --- 118,124 ---- } ! std::string Package::localPackageAbsoluteName(void) { ! std::string localFile = system->temporaryDirectory(System::Download); localFile+="/"; *************** *** 126,134 **** } ! std::string CBMPackage::localPackageAbsoluteDirectory(void) { std::string cmd; ! cmd+=system->temporaryDirectory(CBMSystem::Extract); cmd+="/"; cmd+=extractDirectory(); --- 128,136 ---- } ! std::string Package::localPackageAbsoluteDirectory(void) { std::string cmd; ! cmd+=system->temporaryDirectory(System::Extract); cmd+="/"; cmd+=extractDirectory(); *************** *** 137,161 **** } ! int CBMPackage::hasPatch(void) { return(0); } ! int CBMPackage::patch(int _force) { return(1); } ! int CBMPackage::benchmarkSize(void) { return(0); } ! int CBMPackage::hasTest(void) { return(0); } ! int CBMPackage::test(int _force) { return(1); --- 139,163 ---- } ! int Package::hasPatch(void) { return(0); } ! int Package::patch(int _force) { return(1); } ! int Package::benchmarkSize(void) { return(0); } ! int Package::hasTest(void) { return(0); } ! int Package::test(int _force) { return(1); *************** *** 163,167 **** ! int CBMPackage::uninstall(void) { std::string where = localPackageAbsoluteDirectory(); --- 165,169 ---- ! int Package::uninstall(void) { std::string where = localPackageAbsoluteDirectory(); *************** *** 177,181 **** } ! int CBMPackage::storeStatus(Status _status) { int r; --- 179,183 ---- } ! int Package::storeStatus(Status _status) { int r; *************** *** 196,201 **** } ! std::string CBMPackage::contextID(CBMCompiler *_currentCompiler, ! CBMCompilerOptions *_currentOptions) { std::string what = _currentCompiler->Binary(); --- 198,203 ---- } ! std::string Package::contextID(CBM::Compiler *_currentCompiler, ! CBM::CompilerOptions *_currentOptions) { std::string what = _currentCompiler->Binary(); *************** *** 205,210 **** } ! int CBMPackage::storeContext(CBMCompiler *_currentCompiler, ! CBMCompilerOptions *_currentOptions) { std::string context = contextID(_currentCompiler, --- 207,212 ---- } ! int Package::storeContext(CBM::Compiler *_currentCompiler, ! CBM::CompilerOptions *_currentOptions) { std::string context = contextID(_currentCompiler, *************** *** 222,227 **** } ! int CBMPackage::ContextMatches(CBMCompiler *_currentCompiler, ! CBMCompilerOptions *_currentOptions) { std::string previousContext; --- 224,229 ---- } ! int Package::ContextMatches(CBM::Compiler *_currentCompiler, ! CBM::CompilerOptions *_currentOptions) { std::string previousContext; *************** *** 245,249 **** } ! int CBMPackage::Download(int _force) { std::string localFile = localPackageAbsoluteName(); --- 247,251 ---- } ! int Package::Download(int _force) { std::string localFile = localPackageAbsoluteName(); *************** *** 261,266 **** info+=packageVersion(); ! UI->Information(CBMUI::BenchDownload, ! info); try { --- 263,268 ---- info+=packageVersion(); ! cbmUI->Information(CBM::UI::BenchDownload, ! info); try { *************** *** 277,281 **** if (expected_md5==md5) { ! UI->Information(CBMUI::ChecksumOK, localFile); --- 279,283 ---- if (expected_md5==md5) { ! cbmUI->Information(CBM::UI::ChecksumOK, localFile); *************** *** 283,287 **** return(1); } else { ! UI->Information(CBMUI::ChecksumFailed, localFile); --- 285,289 ---- return(1); } else { ! cbmUI->Information(CBM::UI::ChecksumFailed, localFile); *************** *** 291,295 **** info+=" to "; info+=localFile; ! UI->Fatal(info); return(0); } --- 293,297 ---- info+=" to "; info+=localFile; ! cbmUI->Fatal(info); return(0); } *************** *** 299,303 **** info+=" to "; info+=localFile; ! UI->Fatal(info); system->unlink((char*) localFile.c_str()); --- 301,305 ---- info+=" to "; info+=localFile; ! cbmUI->Fatal(info); system->unlink((char*) localFile.c_str()); *************** *** 306,310 **** } ! int CBMPackage::Extract(int _force) { int r; --- 308,312 ---- } ! int Package::Extract(int _force) { int r; *************** *** 315,319 **** } ! UI->Information(CBMUI::BenchExtract, packageName()); --- 317,321 ---- } ! cbmUI->Information(CBM::UI::BenchExtract, packageName()); *************** *** 327,332 **** info+=localPackageAbsoluteName(); info+=" into "; ! info+=system->temporaryDirectory(CBMSystem::Extract); ! UI->Fatal(info); } --- 329,334 ---- info+=localPackageAbsoluteName(); info+=" into "; ! info+=system->temporaryDirectory(System::Extract); ! cbmUI->Fatal(info); } *************** *** 334,338 **** } ! int CBMPackage::Patch(int _force) { int r; --- 336,340 ---- } ! int Package::Patch(int _force) { int r; *************** *** 346,350 **** } ! UI->Information(CBMUI::BenchPatch, packageName()); --- 348,352 ---- } ! cbmUI->Information(CBM::UI::BenchPatch, packageName()); *************** *** 357,361 **** info="Error patching "; info+=localPackageAbsoluteName(); ! UI->Fatal(info); } --- 359,363 ---- info="Error patching "; info+=localPackageAbsoluteName(); ! cbmUI->Fatal(info); } *************** *** 363,367 **** } ! int CBMPackage::PreConfigure(int _force) { int r; --- 365,369 ---- } ! int Package::PreConfigure(int _force) { int r; *************** *** 376,380 **** ! UI->Information(CBMUI::BenchPreconfigure, packageName()); --- 378,382 ---- ! cbmUI->Information(CBM::UI::BenchPreconfigure, packageName()); *************** *** 389,399 **** info+=packageName(); info+="'s pre-configuration"; ! UI->Fatal(info); } return(r); } ! int CBMPackage::Configure(CBMCompiler *_currentCompiler, ! CBMCompilerOptions *_currentOptions) { int r; --- 391,401 ---- info+=packageName(); info+="'s pre-configuration"; ! cbmUI->Fatal(info); } return(r); } ! int Package::Configure(CBM::Compiler *_currentCompiler, ! CBM::CompilerOptions *_currentOptions) { int r; *************** *** 426,433 **** info+=language(); info+="."; ! UI->Fatal(info); } ! UI->Information(CBMUI::BenchConfigure, info); --- 428,435 ---- info+=language(); info+="."; ! cbmUI->Fatal(info); } ! cbmUI->Information(CBM::UI::BenchConfigure, info); *************** *** 442,446 **** info="Configure failed for "; info+=packageName(); ! UI->Fatal(info); } --- 444,448 ---- info="Configure failed for "; info+=packageName(); ! cbmUI->Fatal(info); } *************** *** 448,452 **** } ! int CBMPackage::Make(int _force) { int r; --- 450,454 ---- } ! int Package::Make(int _force) { int r; *************** *** 459,463 **** } ! UI->Information(CBMUI::BenchMake, packageName()); --- 461,465 ---- } ! cbmUI->Information(CBM::UI::BenchMake, packageName()); *************** *** 473,477 **** info="Make failed for "; info+=packageName(); ! UI->Fatal(info); } --- 475,479 ---- info="Make failed for "; info+=packageName(); ! cbmUI->Fatal(info); } *************** *** 480,484 **** } ! int CBMPackage::Test(int _force) { int r; --- 482,486 ---- } ! int Package::Test(int _force) { int r; *************** *** 489,493 **** if (getStatus()<Configured) { ! UI->Fatal("Package is not configured"); } --- 491,495 ---- if (getStatus()<Configured) { ! cbmUI->Fatal("Package is not configured"); } *************** *** 502,506 **** if (UO_enableTestSuite) { ! UI->Information(CBMUI::BenchTest, packageName()); --- 504,508 ---- if (UO_enableTestSuite) { ! cbmUI->Information(CBM::UI::BenchTest, packageName()); *************** *** 509,513 **** dum=packageName(); dum+=" : passed (disabled by user option)."; ! UI->Information(CBMUI::BenchTest, dum); r=1; --- 511,515 ---- dum=packageName(); dum+=" : passed (disabled by user option)."; ! cbmUI->Information(CBM::UI::BenchTest, dum); r=1; *************** *** 520,524 **** info="Error testing "; info+=localPackageAbsoluteName(); ! UI->Fatal(info); } --- 522,526 ---- info="Error testing "; info+=localPackageAbsoluteName(); ! cbmUI->Fatal(info); } *************** *** 526,530 **** } ! int CBMPackage::Release(void) { int r; --- 528,532 ---- } ! int Package::Release(void) { int r; *************** *** 535,539 **** } ! UI->Information(CBMUI::BenchClean, packageName()); --- 537,541 ---- } ! cbmUI->Information(CBM::UI::BenchClean, packageName()); *************** *** 546,550 **** info="Clean failed for "; info+=packageName(); ! /* UI->Fatal(info); */ } --- 548,552 ---- info="Clean failed for "; info+=packageName(); ! /* cbmUI->Fatal(info); */ } *************** *** 552,561 **** } ! int CBMPackage::Install(int _force) { int r; if (downloadURL()=="") { ! UI->Fatal("Package is not known to be hosted anymore on the Internet. Use --fetch option."); } --- 554,563 ---- } ! int Package::Install(int _force) { int r; if (downloadURL()=="") { ! cbmUI->Fatal("Package is not known to be hosted anymore on the Internet. Use --fetch option."); } *************** *** 580,584 **** } ! int CBMPackage::Fetch(char *_source, int _force) { std::string dest = localPackageAbsoluteName(); --- 582,586 ---- } ! int Package::Fetch(char *_source, int _force) { std::string dest = localPackageAbsoluteName(); *************** *** 600,604 **** if (expected_md5==md5) { ! UI->Information(CBMUI::ChecksumOK, dest); --- 602,606 ---- if (expected_md5==md5) { ! cbmUI->Information(CBM::UI::ChecksumOK, dest); *************** *** 606,610 **** return(1); } else { ! UI->Information(CBMUI::ChecksumFailed, dest); } --- 608,612 ---- return(1); } else { ! cbmUI->Information(CBM::UI::ChecksumFailed, dest); } *************** *** 614,626 **** } ! int CBMPackage::Uninstall(void) { std::string statusFile; int r; ! UI->Information(CBMUI::BenchUninstall, ! packageName()); ! statusFile=system->temporaryDirectory(CBMSystem::Status); statusFile+="/"; statusFile+... [truncated message content] |