compbench-devel Mailing List for CompBenchmarks (Page 32)
Brought to you by:
xfred
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(48) |
Oct
(51) |
Nov
(66) |
Dec
(83) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(242) |
Feb
(56) |
Mar
(95) |
Apr
(120) |
May
(127) |
Jun
(32) |
Jul
(10) |
Aug
(55) |
Sep
(114) |
Oct
(3) |
Nov
|
Dec
|
From: Frederic T. <xf...@us...> - 2007-01-18 18:43:45
|
Update of /cvsroot/compbench/CompBenchmarks++/Compiler In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv18689 Modified Files: Compiler-Options.cpp Compiler-Options.h Compiler.cpp Compiler.h Log Message: CBM namespace. Index: Compiler-Options.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Compiler/Compiler-Options.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Compiler-Options.h 1 Nov 2006 11:31:39 -0000 1.1 --- Compiler-Options.h 18 Jan 2007 18:43:40 -0000 1.2 *************** *** 12,57 **** #include <string> ! class CBMCompiler; ! /** \brief Abstraction layer for handling compilers' options. ! * ! * This class defines the base object for all options to supported compilers. ! * It only stores options (std::string, or char*) into an object and allows ! * querying them. ! */ ! class CBMCompilerOptions ! { ! private: ! /** Stores options. Initialised by constructor. ! * \sa Options() */ ! std::string options; ! /** Stores compiler using options. Initialised by constructor. ! * \sa Compiler() ! */ ! class CBMCompiler *compiler; ! protected: ! public: ! /** Constructor ! \param _compiler Compiler object related to given options ! \param _options Options to manage in current object. ! */ ! CBMCompilerOptions(class CBMCompiler *_compiler, ! char *_options); ! /** Retrives compiler ! \return Compiler instance declared in constructor */ ! virtual class CBMCompiler *Compiler(void); ! /** Retrives options ! \return Options (to compiler instance) declared in constructor */ ! virtual std::string Options(void); ! virtual ~CBMCompilerOptions(); ! }; #endif --- 12,59 ---- #include <string> ! namespace CBM { ! class CBMCompiler; ! /** \brief Abstraction layer for handling compilers' options. ! * ! * This class defines the base object for all options to supported compilers. ! * It only stores options (std::string, or char*) into an object and allows ! * querying them. */ + class CompilerOptions + { + private: + /** Stores options. Initialised by constructor. + * \sa Options() + */ ! std::string options; ! /** Stores compiler using options. Initialised by constructor. ! * \sa Compiler() ! */ ! class Compiler *compiler; ! protected: ! public: ! /** Constructor ! \param _compiler Compiler object related to given options ! \param _options Options to manage in current object. ! */ ! CompilerOptions(class Compiler *_compiler, ! char *_options); ! /** Retrives compiler ! \return Compiler instance declared in constructor */ ! virtual class Compiler *Compiler(void); ! /** Retrives options ! \return Options (to compiler instance) declared in constructor */ ! virtual std::string Options(void); ! virtual ~CompilerOptions(); ! }; ! } #endif Index: Compiler.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Compiler/Compiler.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Compiler.h 1 Nov 2006 11:31:39 -0000 1.1 --- Compiler.h 18 Jan 2007 18:43:40 -0000 1.2 *************** *** 12,113 **** #include <string> ! class CBMSystem; ! /** \brief Abstraction layer for handling compilers. ! * ! * This class defines the base abstract (pure) object for all supported compilers. ! */ ! class CBMCompiler ! { ! private: ! /** Internal usage ! * Speeds up compilerName(). */ ! std::string cacheCompilerName; ! /** Internal usage ! * Speeds up compilerVersion(). ! */ ! std::string cacheCompilerVersion; ! protected: ! /** Used internally to get information on compiler's binary */ ! class CBMSystem *system; ! /** Initialised by constructor. ! \sa CBMCompiler() ! */ ! char *compilerBinary; ! /** Constructor ! \param _system the CBMSystem to use internaly. ! \param _compilerBinary absolute or relative path to the compiler program */ ! CBMCompiler(class CBMSystem *_system, ! char *_compilerBinary); ! /** Gets compiler's name ! * \return std::string containing the name of the compiler ! * \sa getCompilerName() */ ! virtual std::string getCompilerName(void) = 0; ! /** Gets compiler's version ! * \return std::string containing the version of the compiler ! * \sa getCompilerVersion() */ ! virtual std::string getCompilerVersion(void) = 0; ! public: ! /** Display compiler's information. ! * Format is strict. This output is used by compbenchmark-config. ! */ ! virtual void display(void); ! /** Internal compiler id. ! \return std::string like 'gcc' or 'g++'. ! */ ! virtual std::string compiler(void) = 0; ! /** Gets compiler's name. Do not overload. ! \sa getCompilerName() ! \return The compiler name. */ ! virtual std::string compilerName(void); ! /** Gets compiler's version. Do not overload. ! \sa getCompilerVersion() ! \return The compiler version. */ ! virtual std::string compilerVersion(void); ! /** Gets compiler's program (as specified in constructor). ! \return The compiler program (absolute or relative, depending on method used in instanciation). */ ! virtual std::string Binary(void); ! /** Gets compiler's language. ! \return C or C++. */ ! virtual char *language(void) = 0; ! /** Virtual destructor */ ! virtual ~CBMCompiler(); ! }; ! /** \brief Gives a compiler object according to a binary (or executable) program. ! * ! * This class creates CBMCompiler objects. It is only instancied once, and I currently see no need to derivate it. ! */ ! class CBMCompilerSelector ! { ! private: ! protected: ! class CBMSystem *system; ! public: ! /** Constructor */ ! CBMCompilerSelector(class CBMSystem *_system); ! ! /** Main method. ! * Returns a CBMCompiler object. ! * \param compilerBinary Absolute or relative name of the compiler program */ ! CBMCompiler *select(char *compilerBinary); ! /** Virtual destructor */ ! ~CBMCompilerSelector(); ! }; #endif --- 12,116 ---- #include <string> ! namespace CBM { ! // class CBM::System; ! /** \brief Abstraction layer for handling compilers. ! * ! * This class defines the base abstract (pure) object for all supported compilers. */ ! class Compiler ! { ! private: ! /** Internal usage ! * Speeds up compilerName(). ! */ ! std::string cacheCompilerName; ! /** Internal usage ! * Speeds up compilerVersion(). ! */ ! std::string cacheCompilerVersion; ! protected: ! /** Used internally to get information on compiler's binary */ ! class System *system; ! /** Initialised by constructor. ! \sa Compiler() ! */ ! char *compilerBinary; ! /** Constructor ! \param _system the System to use internaly. ! \param _compilerBinary absolute or relative path to the compiler program */ ! Compiler(class System *_system, ! char *_compilerBinary); ! /** Gets compiler's name ! * \return std::string containing the name of the compiler ! * \sa getCompilerName() */ ! virtual std::string getCompilerName(void) = 0; ! /** Gets compiler's version ! * \return std::string containing the version of the compiler ! * \sa getCompilerVersion() */ ! virtual std::string getCompilerVersion(void) = 0; ! public: ! /** Display compiler's information. ! * Format is strict. This output is used by compbenchmark-config. ! */ ! virtual void display(void); ! /** Internal compiler id. ! \return std::string like 'gcc' or 'g++'. ! */ ! virtual std::string compiler(void) = 0; ! /** Gets compiler's name. Do not overload. ! \sa getCompilerName() ! \return The compiler name. */ ! virtual std::string compilerName(void); ! /** Gets compiler's version. Do not overload. ! \sa getCompilerVersion() ! \return The compiler version. */ ! virtual std::string compilerVersion(void); ! /** Gets compiler's program (as specified in constructor). ! \return The compiler program (absolute or relative, depending on method used in instanciation). */ ! virtual std::string Binary(void); ! /** Gets compiler's language. ! \return C or C++. */ ! virtual char *language(void) = 0; ! /** Virtual destructor */ ! virtual ~Compiler(); ! }; ! /** \brief Gives a compiler object according to a binary (or executable) program. ! * ! * This class creates Compiler objects. It is only instancied once, and I currently see no need to derivate it. */ ! class CompilerSelector ! { ! private: ! protected: ! class System *system; ! public: ! /** Constructor */ ! CompilerSelector(class System *_system); ! ! /** Main method. ! * Returns a Compiler object. ! * \param compilerBinary Absolute or relative name of the compiler program ! */ ! Compiler *select(char *compilerBinary); ! /** Virtual destructor */ ! ~CompilerSelector(); ! ! }; ! } #endif Index: Compiler.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Compiler/Compiler.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Compiler.cpp 1 Nov 2006 11:31:39 -0000 1.1 --- Compiler.cpp 18 Jan 2007 18:43:40 -0000 1.2 *************** *** 14,19 **** #include <iostream> ! CBMCompiler::CBMCompiler(CBMSystem *_system, ! char *_compilerBinary) { system=_system; --- 14,21 ---- #include <iostream> ! using namespace CBM; ! ! Compiler::Compiler(System *_system, ! char *_compilerBinary) { system=_system; *************** *** 21,25 **** } ! std::string CBMCompiler::compilerName(void) { if (cacheCompilerName!="") --- 23,27 ---- } ! std::string Compiler::compilerName(void) { if (cacheCompilerName!="") *************** *** 31,35 **** } ! std::string CBMCompiler::compilerVersion(void) { if (cacheCompilerVersion!="") --- 33,37 ---- } ! std::string Compiler::compilerVersion(void) { if (cacheCompilerVersion!="") *************** *** 41,50 **** } ! std::string CBMCompiler::Binary(void) { return(compilerBinary); } ! void CBMCompiler::display(void) { std::cout << "compiler::id=" << compiler() << std::endl --- 43,52 ---- } ! std::string Compiler::Binary(void) { return(compilerBinary); } ! void Compiler::display(void) { std::cout << "compiler::id=" << compiler() << std::endl *************** *** 55,68 **** } ! CBMCompiler::~CBMCompiler() { } ! CBMCompilerSelector::CBMCompilerSelector(CBMSystem *_system) { system=_system; } ! CBMCompiler *CBMCompilerSelector::select(char *compilerBinary) { std::string cmd; --- 57,70 ---- } ! Compiler::~Compiler() { } ! CompilerSelector::CompilerSelector(CBM::System *_system) { system=_system; } ! Compiler *CompilerSelector::select(char *compilerBinary) { std::string cmd; *************** *** 78,94 **** ((int) raw.find("Free Software Foundation")>0)) { if ((int) raw.find("g++")>=0) { ! return(new CBMCompilerGCC_cpp(system, compilerBinary)); } else ! return(new CBMCompilerGCC(system, compilerBinary)); } raw=compilerBinary; if (((int) raw.find("g++")>0) || (raw=="g++")) { ! return(new CBMCompilerGCC_cpp(system, compilerBinary)); } if (((int) raw.find("gcc")>0) || (raw=="gcc")) { ! return(new CBMCompilerGCC(system, compilerBinary)); } --- 80,96 ---- ((int) raw.find("Free Software Foundation")>0)) { if ((int) raw.find("g++")>=0) { ! return(new CompilerGCC_cpp(system, compilerBinary)); } else ! return(new CompilerGCC(system, compilerBinary)); } raw=compilerBinary; if (((int) raw.find("g++")>0) || (raw=="g++")) { ! return(new CompilerGCC_cpp(system, compilerBinary)); } if (((int) raw.find("gcc")>0) || (raw=="gcc")) { ! return(new CompilerGCC(system, compilerBinary)); } *************** *** 99,106 **** cmd+=" -h) 2> /dev/null"; ! system->exec(cmd, raw); /* !!! */ if (raw!="") { if ((int) raw.find("Tiny C Compiler">0)) { ! return(new CBMCompilerTCC(system, compilerBinary)); } --- 101,108 ---- cmd+=" -h) 2> /dev/null"; ! system->exec(cmd, raw); /* !!! */ if (raw!="") { if ((int) raw.find("Tiny C Compiler">0)) { ! return(new CompilerTCC(system, compilerBinary)); } *************** *** 110,114 **** } ! CBMCompilerSelector::~CBMCompilerSelector() { } --- 112,117 ---- } ! ! CompilerSelector::~CompilerSelector() { } Index: Compiler-Options.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Compiler/Compiler-Options.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Compiler-Options.cpp 1 Nov 2006 11:31:39 -0000 1.1 --- Compiler-Options.cpp 18 Jan 2007 18:43:40 -0000 1.2 *************** *** 10,16 **** #include <Compiler/Compiler.h> ! CBMCompilerOptions::CBMCompilerOptions(CBMCompiler *_compiler, ! char *_options) { compiler=_compiler; --- 10,17 ---- #include <Compiler/Compiler.h> + using namespace CBM; ! CompilerOptions::CompilerOptions(CBM::Compiler *_compiler, ! char *_options) { compiler=_compiler; *************** *** 18,32 **** } ! CBMCompiler *CBMCompilerOptions::Compiler(void) { return(compiler); } ! std::string CBMCompilerOptions::Options(void) { return(options); } ! CBMCompilerOptions::~CBMCompilerOptions() { } --- 19,33 ---- } ! Compiler *CompilerOptions::Compiler(void) { return(compiler); } ! std::string CompilerOptions::Options(void) { return(options); } ! CompilerOptions::~CompilerOptions() { } |
From: Frederic T. <xf...@us...> - 2007-01-18 18:43:45
|
Update of /cvsroot/compbench/CompBenchmarks++/Compiler/Compiler-TCC In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv18689/Compiler-TCC Modified Files: Compiler-TCC.cpp Compiler-TCC.h Log Message: CBM namespace. Index: Compiler-TCC.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Compiler/Compiler-TCC/Compiler-TCC.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Compiler-TCC.h 1 Nov 2006 11:31:23 -0000 1.2 --- Compiler-TCC.h 18 Jan 2007 18:43:41 -0000 1.3 *************** *** 12,33 **** #include <Compiler/Compiler.h> ! /** \brief Defines the tcc compiler ! */ ! class CBMCompilerTCC : public CBMCompiler ! { ! private: ! protected: ! ! virtual std::string getCompilerName(void); ! virtual std::string getCompilerVersion(void); ! virtual char *language(void); ! ! public: ! CBMCompilerTCC (class CBMSystem *_system, ! char *_compilerBinary); ! ! virtual std::string compiler(void); ! virtual ~CBMCompilerTCC(); ! }; #endif --- 12,35 ---- #include <Compiler/Compiler.h> ! namespace CBM { ! /** \brief Defines the tcc compiler ! */ ! class CompilerTCC : public Compiler ! { ! private: ! protected: ! ! virtual std::string getCompilerName(void); ! virtual std::string getCompilerVersion(void); ! virtual char *language(void); ! ! public: ! CompilerTCC (class System *_system, ! char *_compilerBinary); ! ! virtual std::string compiler(void); ! virtual ~CompilerTCC(); ! }; ! } #endif Index: Compiler-TCC.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Compiler/Compiler-TCC/Compiler-TCC.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Compiler-TCC.cpp 1 Nov 2006 11:31:23 -0000 1.2 --- Compiler-TCC.cpp 18 Jan 2007 18:43:41 -0000 1.3 *************** *** 10,20 **** #include <System/System.h> ! CBMCompilerTCC::CBMCompilerTCC(CBMSystem *_system, ! char *_compilerBinary) ! : CBMCompiler(_system, _compilerBinary) { } ! std::string CBMCompilerTCC::compiler(void) { std::string str = "tcc"; --- 10,22 ---- #include <System/System.h> ! using namespace CBM; ! ! CompilerTCC::CompilerTCC(System *_system, ! char *_compilerBinary) ! : Compiler(_system, _compilerBinary) { } ! std::string CompilerTCC::compiler(void) { std::string str = "tcc"; *************** *** 23,27 **** } ! std::string CBMCompilerTCC::getCompilerName(void) { std::string result = "Tiny C Compiler "; --- 25,29 ---- } ! std::string CompilerTCC::getCompilerName(void) { std::string result = "Tiny C Compiler "; *************** *** 30,34 **** } ! std::string CBMCompilerTCC::getCompilerVersion(void) { std::string cmd; --- 32,36 ---- } ! std::string CompilerTCC::getCompilerVersion(void) { std::string cmd; *************** *** 42,51 **** } ! char *CBMCompilerTCC::language(void) { return("C"); } ! CBMCompilerTCC::~CBMCompilerTCC() { } --- 44,53 ---- } ! char *CompilerTCC::language(void) { return("C"); } ! CompilerTCC::~CompilerTCC() { } |
From: Frederic T. <xf...@us...> - 2007-01-18 18:43:44
|
Update of /cvsroot/compbench/CompBenchmarks++/Compiler/Compiler-GCC In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv18689/Compiler-GCC Modified Files: Compiler-GCC.cpp Compiler-GCC.h Log Message: CBM namespace. Index: Compiler-GCC.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Compiler/Compiler-GCC/Compiler-GCC.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Compiler-GCC.h 1 Nov 2006 11:31:05 -0000 1.2 --- Compiler-GCC.h 18 Jan 2007 18:43:41 -0000 1.3 *************** *** 11,51 **** #include <Compiler/Compiler.h> - /** \brief Defines the gcc compiler - */ - class CBMCompilerGCC : public CBMCompiler - { - private: - protected: ! virtual std::string getCompilerName(void); ! virtual std::string getCompilerVersion(void); ! virtual char *language(void); ! public: ! CBMCompilerGCC (class CBMSystem *_system, ! char *_compilerBinary); ! virtual std::string compiler(void); ! virtual ~CBMCompilerGCC(); ! }; - /** \brief Defines the g++ compiler - */ - class CBMCompilerGCC_cpp : public CBMCompiler - { - private: - protected: ! virtual std::string getCompilerName(void); ! virtual std::string getCompilerVersion(void); ! virtual char *language(void); ! public: ! CBMCompilerGCC_cpp (class CBMSystem *_system, ! char *_compilerBinary); - virtual std::string compiler(void); - virtual ~CBMCompilerGCC_cpp(); - }; #endif --- 11,55 ---- #include <Compiler/Compiler.h> ! namespace CBM { ! /** \brief Defines the gcc compiler ! */ ! class CompilerGCC : public Compiler ! { ! private: ! protected: ! virtual std::string getCompilerName(void); ! virtual std::string getCompilerVersion(void); ! virtual char *language(void); ! public: ! CompilerGCC(class System *_system, ! char *_compilerBinary); + virtual std::string compiler(void); + virtual ~CompilerGCC(); + }; ! /** \brief Defines the g++ compiler ! */ ! class CompilerGCC_cpp : public Compiler ! { ! private: ! protected: ! virtual std::string getCompilerName(void); ! virtual std::string getCompilerVersion(void); ! virtual char *language(void); ! ! public: ! CompilerGCC_cpp (class System *_system, ! char *_compilerBinary); ! ! virtual std::string compiler(void); ! virtual ~CompilerGCC_cpp(); ! }; ! } #endif Index: Compiler-GCC.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Compiler/Compiler-GCC/Compiler-GCC.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Compiler-GCC.cpp 1 Nov 2006 11:31:05 -0000 1.2 --- Compiler-GCC.cpp 18 Jan 2007 18:43:41 -0000 1.3 *************** *** 12,22 **** #include <config.h> ! CBMCompilerGCC::CBMCompilerGCC(CBMSystem *_system, ! char *_compilerBinary) ! : CBMCompiler(_system, _compilerBinary) { } ! std::string CBMCompilerGCC::compiler(void) { std::string str = "gcc"; --- 12,24 ---- #include <config.h> ! using namespace CBM; ! ! CompilerGCC::CompilerGCC(CBM::System *_system, ! char *_compilerBinary) ! : Compiler(_system, _compilerBinary) { } ! std::string CompilerGCC::compiler(void) { std::string str = "gcc"; *************** *** 25,29 **** } ! std::string CBMCompilerGCC::getCompilerName(void) { std::string cmd = compilerBinary; --- 27,31 ---- } ! std::string CompilerGCC::getCompilerName(void) { std::string cmd = compilerBinary; *************** *** 44,48 **** } ! std::string CBMCompilerGCC::getCompilerVersion(void) { std::string cmd = "I=`"; --- 46,50 ---- } ! std::string CompilerGCC::getCompilerVersion(void) { std::string cmd = "I=`"; *************** *** 65,84 **** } ! char *CBMCompilerGCC::language(void) { return("C"); } ! CBMCompilerGCC::~CBMCompilerGCC() { } ! CBMCompilerGCC_cpp::CBMCompilerGCC_cpp(CBMSystem *_system, ! char *_compilerBinary) ! : CBMCompiler(_system, _compilerBinary) { } ! std::string CBMCompilerGCC_cpp::compiler(void) { std::string str = "g++"; --- 67,86 ---- } ! char *CompilerGCC::language(void) { return("C"); } ! CompilerGCC::~CompilerGCC() { } ! CompilerGCC_cpp::CompilerGCC_cpp(CBM::System *_system, ! char *_compilerBinary) ! : Compiler(_system, _compilerBinary) { } ! std::string CompilerGCC_cpp::compiler(void) { std::string str = "g++"; *************** *** 87,91 **** } ! std::string CBMCompilerGCC_cpp::getCompilerName(void) { std::string cmd = compilerBinary; --- 89,93 ---- } ! std::string CompilerGCC_cpp::getCompilerName(void) { std::string cmd = compilerBinary; *************** *** 106,110 **** } ! std::string CBMCompilerGCC_cpp::getCompilerVersion(void) { std::string cmd = "I=`"; --- 108,112 ---- } ! std::string CompilerGCC_cpp::getCompilerVersion(void) { std::string cmd = "I=`"; *************** *** 127,136 **** } ! char *CBMCompilerGCC_cpp::language(void) { return("C++"); } ! CBMCompilerGCC_cpp::~CBMCompilerGCC_cpp() { } --- 129,138 ---- } ! char *CompilerGCC_cpp::language(void) { return("C++"); } ! CompilerGCC_cpp::~CompilerGCC_cpp() { } |
From: Frederic T. <xf...@us...> - 2007-01-18 18:43:29
|
Update of /cvsroot/compbench/CompBenchmarks++/UI In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv18642 Modified Files: UI.cpp UI.h Log Message: CBM namespace. Index: UI.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/UI/UI.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** UI.h 2 Oct 2006 19:08:26 -0000 1.4 --- UI.h 18 Jan 2007 18:43:25 -0000 1.5 *************** *** 12,85 **** #include <string> ! /** \brief Basic API for user interface. ! * ! * This class defines few methods to interact with compbenchmarks-config, or ! * with the console. ! */ ! class CBMUI ! { ! private: ! protected: ! /** Unused for now. */ ! std::string progressMsg; ! /** Unused for now. */ ! int progressMax; ! /** Unused for now. */ ! int progressCur; ! public: ! CBMUI(); ! /** Typedef for message sent to UI object. */ ! typedef enum Info { FileCreate, /*!< File creation */ ! FileRead, /*!< File is being read */ ! FileWrite, /*!< File has been written */ ! FileRemove, /*!< File has been removed */ ! ChecksumOK, /*!< Correct checksum message */ ! ChecksumFailed, /*!< Bad checksum */ ! DirectoryCheck, /*!< Directory has been checked */ ! DirectoryCreate, /*!< Directory has been created */ ! BenchDownload, /*!< Benchmark downloaded */ ! BenchExtract, /*!< Benchmark extracted */ ! BenchPatch, /*!< Benchmark patched */ ! BenchPreconfigure, /*!< Benchmark pre-configured */ ! BenchConfigure, /*!< Benchmark configured */ ! BenchMake, /*!< Benchmark (package) build */ ! BenchTest, /*!< Benchmark is tested */ ! BenchBench, /*!< Benchmark ran */ ! BenchResult, /*!< Benchmark result is being ! * displayed */ ! BenchClean, /*!< Package has been cleaned */ ! BenchUninstall /*!< Package uninstalled */ ! }; ! /** Throws a fatal error. ! Display a message and exits properly. ! \sa CBMSystem::done() ! \return 1 if ok. ! */ ! virtual int Fatal(std::string msg); ! /** Display information. ! Prints an header corresponding to the type, then shows msg. ! \param type Type of information ! \param msg Message (clear text) to display ! */ ! virtual int Information(Info type, ! std::string msg); ! /* ! virtual int ProgressInit(std::string& msg, ! int max) = 0; ! virtual int Progress(int step) = 0; ! virtual int ProgressDone(void) = 0; ! */ ! /** Virtual destructor */ ! virtual ~CBMUI(); ! }; ! extern CBMUI *UI; #endif --- 12,87 ---- #include <string> ! namespace CBM { ! /** \brief Basic API for user interface. ! * ! * This class defines few methods to interact with compbenchmarks-config, or ! * with the console. ! */ ! class UI ! { ! private: ! protected: ! /** Unused for now. */ ! std::string progressMsg; ! /** Unused for now. */ ! int progressMax; ! /** Unused for now. */ ! int progressCur; ! public: ! UI(); ! /** Typedef for message sent to UI object. */ ! typedef enum Info { FileCreate, /*!< File creation */ ! FileRead, /*!< File is being read */ ! FileWrite, /*!< File has been written */ ! FileRemove, /*!< File has been removed */ ! ChecksumOK, /*!< Correct checksum message */ ! ChecksumFailed, /*!< Bad checksum */ ! DirectoryCheck, /*!< Directory has been checked */ ! DirectoryCreate, /*!< Directory has been created */ ! BenchDownload, /*!< Benchmark downloaded */ ! BenchExtract, /*!< Benchmark extracted */ ! BenchPatch, /*!< Benchmark patched */ ! BenchPreconfigure, /*!< Benchmark pre-configured */ ! BenchConfigure, /*!< Benchmark configured */ ! BenchMake, /*!< Benchmark (package) build */ ! BenchTest, /*!< Benchmark is tested */ ! BenchBench, /*!< Benchmark ran */ ! BenchResult, /*!< Benchmark result is being ! * displayed */ ! BenchClean, /*!< Package has been cleaned */ ! BenchUninstall /*!< Package uninstalled */ ! }; ! /** Throws a fatal error. ! Display a message and exits properly. ! \sa CBMSystem::done() ! \return 1 if ok. ! */ ! virtual int Fatal(std::string msg); ! /** Display information. ! Prints an header corresponding to the type, then shows msg. ! \param type Type of information ! \param msg Message (clear text) to display ! */ ! virtual int Information(Info type, ! std::string msg); ! /* ! virtual int ProgressInit(std::string& msg, ! int max) = 0; ! virtual int Progress(int step) = 0; ! virtual int ProgressDone(void) = 0; ! */ ! /** Virtual destructor */ ! virtual ~UI(); ! }; ! extern UI *cbmUI; ! } #endif Index: UI.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/UI/UI.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** UI.cpp 10 Jan 2007 20:28:48 -0000 1.6 --- UI.cpp 18 Jan 2007 18:43:25 -0000 1.7 *************** *** 5,11 **** #include <iostream> ! CBMUI *UI = 0; ! CBMUI::CBMUI() { progressMsg=""; --- 5,13 ---- #include <iostream> ! using namespace CBM; ! CBM::UI *cbmUI = 0; ! ! UI::UI() { progressMsg=""; *************** *** 14,22 **** } ! int CBMUI::Fatal(std::string msg) { std::cerr << "FATAL ERROR: " << msg << std::endl; if (UO_fatal) { ! cbmSystem->done(); exit(1); } --- 16,24 ---- } ! int UI::Fatal(std::string msg) { std::cerr << "FATAL ERROR: " << msg << std::endl; if (UO_fatal) { ! CBM::cbmSystem->done(); exit(1); } *************** *** 24,29 **** } ! int CBMUI::Information(Info type, ! std::string msg) { std::string what; --- 26,31 ---- } ! int UI::Information(CBM::UI::Info type, ! std::string msg) { std::string what; *************** *** 97,101 **** } ! CBMUI::~CBMUI() { } --- 99,103 ---- } ! UI::~UI() { } |
From: Frederic T. <xf...@us...> - 2007-01-18 18:43:09
|
Update of /cvsroot/compbench/CompBenchmarks++/System In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv18241 Modified Files: System.cpp System-Cygwin.cpp System-Cygwin.h System-FreeBSD.cpp System-FreeBSD.h System.h System-Linux.cpp System-Linux.h System-Unix.cpp System-Unix.h XML.cpp XML.h Log Message: CBM namespace. Index: XML.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/System/XML.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** XML.cpp 17 Jan 2007 19:08:35 -0000 1.1 --- XML.cpp 18 Jan 2007 18:43:02 -0000 1.2 *************** *** 8,13 **** #include <System/XML.h> ! CBMXMLAttribute::CBMXMLAttribute(std::string _name, std::string _value) { --- 8,14 ---- #include <System/XML.h> + using namespace CBM::XML; ! Attribute::Attribute(std::string _name, std::string _value) { *************** *** 16,40 **** } ! std::string CBMXMLAttribute::Name(void) { return(name); } ! std::string CBMXMLAttribute::Value(void) { return(value); } ! void CBMXMLAttribute::setValue(std::string _value) { value=_value; } ! CBMXMLAttribute::~CBMXMLAttribute() { } ! CBMXMLNode::CBMXMLNode(std::string _name, ! std::string _value) { name=_name; --- 17,41 ---- } ! std::string Attribute::Name(void) { return(name); } ! std::string Attribute::Value(void) { return(value); } ! void Attribute::setValue(std::string _value) { value=_value; } ! Attribute::~Attribute() { } ! Node::Node(std::string _name, ! std::string _value) { name=_name; *************** *** 42,46 **** } ! void CBMXMLNode::indent(std::string& str, int _indent) { --- 43,47 ---- } ! void Node::indent(std::string& str, int _indent) { *************** *** 49,83 **** } ! std::string CBMXMLNode::Name(void) { return(name); } ! std::string CBMXMLNode::Value(void) { return(value); } ! void CBMXMLNode::setValue(std::string _value) { value=_value; } ! int CBMXMLNode::childNumber(void) { return(childs.size()); } ! CBMXMLNode *CBMXMLNode::getChild(int _index) { return(childs[_index]); } ! int CBMXMLNode::attributeNumber(void) { return(attributes.size()); } ! CBMXMLAttribute *CBMXMLNode::getAttribute(int _index) { return(attributes[_index]); --- 50,84 ---- } ! std::string Node::Name(void) { return(name); } ! std::string Node::Value(void) { return(value); } ! void Node::setValue(std::string _value) { value=_value; } ! int Node::childNumber(void) { return(childs.size()); } ! Node *Node::getChild(int _index) { return(childs[_index]); } ! int Node::attributeNumber(void) { return(attributes.size()); } ! Attribute *Node::getAttribute(int _index) { return(attributes[_index]); *************** *** 85,89 **** ! CBMXMLNode *CBMXMLNode::add(CBMXMLNode *_child) { childs.push_back(_child); --- 86,90 ---- ! Node *Node::add(Node *_child) { childs.push_back(_child); *************** *** 91,103 **** } ! CBMXMLNode *CBMXMLNode::addNode(std::string _name, std::string _value) { ! CBMXMLNode *result = new CBMXMLNode(_name, _value); return(add(result)); } ! CBMXMLAttribute *CBMXMLNode::add(CBMXMLAttribute *_attribute) { attributes.push_back(_attribute); --- 92,104 ---- } ! Node *Node::addNode(std::string _name, std::string _value) { ! Node *result = new Node(_name, _value); return(add(result)); } ! Attribute *Node::add(Attribute *_attribute) { attributes.push_back(_attribute); *************** *** 105,120 **** } ! CBMXMLAttribute *CBMXMLNode::addAttribute(std::string _name, std::string _value) { ! CBMXMLAttribute *result = new CBMXMLAttribute(_name, _value); return(add(result)); } ! std::string CBMXMLNode::str(int _indent) { std::string result; ! CBMXMLAttribute *att; int i; int n_child; --- 106,121 ---- } ! Attribute *Node::addAttribute(std::string _name, std::string _value) { ! Attribute *result = new Attribute(_name, _value); return(add(result)); } ! std::string Node::str(int _indent) { std::string result; ! Attribute *att; int i; int n_child; *************** *** 172,176 **** } ! CBMXMLNode::~CBMXMLNode() { } --- 173,177 ---- } ! Node::~Node() { } Index: System-Cygwin.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/System/System-Cygwin.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** System-Cygwin.cpp 1 Nov 2006 10:31:17 -0000 1.3 --- System-Cygwin.cpp 18 Jan 2007 18:43:02 -0000 1.4 *************** *** 12,17 **** #include <config.h> /* !!! */ ! CBMSystemCygwin::CBMSystemCygwin() ! : CBMSystemUnix() { std::string cmd = "cscript.exe /nologo systemInfo.wmi"; --- 12,17 ---- #include <config.h> /* !!! */ ! SystemCygwin::SystemCygwin() ! : SystemUnix() { std::string cmd = "cscript.exe /nologo systemInfo.wmi"; *************** *** 19,23 **** } ! std::string CBMSystemCygwin::processor_name(void) { std::string r = Split(cache, "\n", 2); --- 19,23 ---- } ! std::string SystemCygwin::processor_name(void) { std::string r = Split(cache, "\n", 2); *************** *** 27,31 **** } ! std::string CBMSystemCygwin::processor_mhz(void) { std::string r = Split(cache, "\n", 0); --- 27,31 ---- } ! std::string SystemCygwin::processor_mhz(void) { std::string r = Split(cache, "\n", 0); *************** *** 35,39 **** } ! std::string CBMSystemCygwin::processor_cache(void) { std::string r = Split(cache, "\n", 1); --- 35,39 ---- } ! std::string SystemCygwin::processor_cache(void) { std::string r = Split(cache, "\n", 1); *************** *** 43,47 **** } ! std::string CBMSystemCygwin::processor_number(void) { std::string r = Split(cache, "\n", 3); --- 43,47 ---- } ! std::string SystemCygwin::processor_number(void) { std::string r = Split(cache, "\n", 3); *************** *** 51,55 **** } ! CBMSystemCygwin::~CBMSystemCygwin() { } --- 51,55 ---- } ! SystemCygwin::~SystemCygwin() { } Index: System-Cygwin.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/System/System-Cygwin.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** System-Cygwin.h 1 Nov 2006 10:30:53 -0000 1.2 --- System-Cygwin.h 18 Jan 2007 18:43:02 -0000 1.3 *************** *** 12,54 **** #include <System/System-Unix.h> ! /** \brief Cygwin operating system support class. ! * ! * Implements a few methods not defined by CBMSystemUnix to handle properly ! * Cygwin systems in CompBenchmarks. ! */ ! class CBMSystemCygwin : public CBMSystemUnix ! { ! private: ! std::string cache; ! protected: ! public: ! /** Constructor */ ! CBMSystemCygwin(); ! /** Returns processor name ! * Uses WMI to get the name of the first installed processor. ! * \return Processor name, as clear text ! * \sa processor_number() */ ! virtual std::string processor_name(void); ! /** Returns processor speed ! * Uses WMI to get the speed, in MHz, of the first installed processor. ! * \return Processor speed in MHz, as clear text (integer returned) ! * \sa processor_number() */ ! virtual std::string processor_mhz(void); ! /** Returns processor cache ! * Uses WMI to get processor second level cache in Kb. Integer expected. ! * \return std::string coding (first) processor second level cache in Kb. */ ! virtual std::string processor_cache(void); ! /** Returns processors' number ! * Uses WMI to get information. ! * \return std::string coding the number of processors (physical and logical) on host */ ! virtual std::string processor_number(void); ! /** Virtual destructor */ ! virtual ~CBMSystemCygwin(); ! }; #endif --- 12,56 ---- #include <System/System-Unix.h> ! namespace CBM { ! /** \brief Cygwin operating system support class. ! * ! * Implements a few methods not defined by SystemUnix to handle properly ! * Cygwin systems in CompBenchmarks. ! */ ! class SystemCygwin : public SystemUnix ! { ! private: ! std::string cache; ! protected: ! public: ! /** Constructor */ ! SystemCygwin(); ! /** Returns processor name ! * Uses WMI to get the name of the first installed processor. ! * \return Processor name, as clear text ! * \sa processor_number() */ ! virtual std::string processor_name(void); ! /** Returns processor speed ! * Uses WMI to get the speed, in MHz, of the first installed processor. ! * \return Processor speed in MHz, as clear text (integer returned) ! * \sa processor_number() */ ! virtual std::string processor_mhz(void); ! /** Returns processor cache ! * Uses WMI to get processor second level cache in Kb. Integer expected. ! * \return std::string coding (first) processor second level cache in Kb. */ ! virtual std::string processor_cache(void); ! /** Returns processors' number ! * Uses WMI to get information. ! * \return std::string coding the number of processors (physical and logical) on host */ ! virtual std::string processor_number(void); ! /** Virtual destructor */ ! virtual ~SystemCygwin(); ! }; ! } #endif Index: System-Linux.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/System/System-Linux.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** System-Linux.cpp 1 Nov 2006 10:32:17 -0000 1.5 --- System-Linux.cpp 18 Jan 2007 18:43:02 -0000 1.6 *************** *** 12,21 **** #include <config.h> /* !!! */ ! CBMSystemLinux::CBMSystemLinux() ! : CBMSystemUnix() { } ! std::string CBMSystemLinux::processor_name(void) { std::string r; --- 12,23 ---- #include <config.h> /* !!! */ ! using namespace CBM; ! ! SystemLinux::SystemLinux() ! : SystemUnix() { } ! std::string SystemLinux::processor_name(void) { std::string r; *************** *** 27,31 **** } ! std::string CBMSystemLinux::processor_mhz(void) { std::string r = exec0("(cat /proc/cpuinfo | grep 'cpu MHz' | head -1 | cut -f2 -d':' | sed 's/^ //' | cut -f1 -d'.') 2> /dev/null"); --- 29,33 ---- } ! std::string SystemLinux::processor_mhz(void) { std::string r = exec0("(cat /proc/cpuinfo | grep 'cpu MHz' | head -1 | cut -f2 -d':' | sed 's/^ //' | cut -f1 -d'.') 2> /dev/null"); *************** *** 36,40 **** } ! std::string CBMSystemLinux::processor_cache(void) { std::string r = exec0("(cat /proc/cpuinfo | grep 'cache size' | head -1 | cut -f2 -d':' | sed 's/^ //' | sed 's/KB//') 2> /dev/null"); --- 38,42 ---- } ! std::string SystemLinux::processor_cache(void) { std::string r = exec0("(cat /proc/cpuinfo | grep 'cache size' | head -1 | cut -f2 -d':' | sed 's/^ //' | sed 's/KB//') 2> /dev/null"); *************** *** 44,48 **** } ! std::string CBMSystemLinux::processor_number(void) { std::string r = exec0("(cat /proc/cpuinfo | grep 'model name' | wc -l) 2> /dev/null"); --- 46,50 ---- } ! std::string SystemLinux::processor_number(void) { std::string r = exec0("(cat /proc/cpuinfo | grep 'model name' | wc -l) 2> /dev/null"); *************** *** 51,55 **** } ! CBMSystemLinux::~CBMSystemLinux() { } --- 53,57 ---- } ! SystemLinux::~SystemLinux() { } Index: System.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/System/System.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** System.h 15 Jan 2007 17:59:14 -0000 1.20 --- System.h 18 Jan 2007 18:43:02 -0000 1.21 *************** *** 15,301 **** #include <time.h> ! ! /** Defines a vector of packages. ! */ ! typedef std::vector<std::string> PackageVector; ! ! /** \brief Operating system (and optionnaly hardware) abstraction layer. ! * ! * This class defines the base abstract (pure) object for all supported operating ! * systems. It may also introduces hardware-related dependencies. ! */ ! class CBMSystem ! { ! public: ! /** Temporary directory. ! * Defines typedef used to query temporary directories used by CompBenchmarks. */ ! typedef enum Temp { Root, /*!< Root directory */ ! HostDep, /*!< Prefix for host-dependend directory */ ! Extract, /*!< Archive extraction temporary directory */ ! Patches, /*!< Directory holding patches */ ! System, /*!< System specific material */ ! Download, /*!< Downloads temporary directory */ ! Status, /*!< Directory holding status of packages and ! * benchmarks */ ! Configuration /*!< Directory for configuration related ! * informations */ ! }; ! private: ! /** Check if the given directory holds patches. ! * Check if given arguments holds patches needed by libcompbenchmarks. ! * \param dir directory to check ! * \return non-null if ok. */ ! virtual int verifyPatchDirectory(std::string dir); ! protected: ! /** \sa Packages() */ ! PackageVector packages; ! /** Stores the last (shell) command executed by compbenchmarks library. */ ! std::string lastCommand; ! /** Stores the output of the last (shell) command executed by ! * compbenchmarks library. */ ! std::string lastCommandOutput; ! /** Constructor. */ ! CBMSystem(); ! /** Virtual destructor */ ! virtual ~CBMSystem(); ! /** External command execution. ! * Uses shell to execute command. ! * \param command shell command to execute ! * \return stdout dump ! * \sa exec() ! */ ! virtual std::string exec0(std::string& command); ! virtual std::string exec0(char *command); ! /** Returns host's architecture. ! * As uname -m on UNIX. ! * \return Host's architecture ! */ ! virtual std::string arch(void) = 0; ! /** Get host ID ! * As hostid command does on UNIX. ! * \return Host ID as string.*/ ! virtual std::string hostid(void) = 0; ! /** Returns hostname ! * Returns the shortname. ! * \return hostname */ ! virtual std::string hostname(void) = 0; ! /** Returns operating system name ! * \return Operating system name (as uname command on UNIX) */ ! virtual std::string os(void) = 0; ! /** Returns operating system version ! * \return Operating system version (as uname -r command on most UNIXes) */ ! virtual std::string os_version(void) = 0; ! /** Returns processor name ! * Here we infer that each processor on the node are identical, which is the case ! * on x86 and compatible hardware. ! * \return Processor name, as clear text ! * \sa processor_number() */ ! virtual std::string processor_name(void) = 0; ! /** Returns processor speed ! * Processor speed in MHz. Integer expected. ! * \return std::string coding an integer matching the (first) processor speed, in MHz. */ ! virtual std::string processor_mhz(void) = 0; ! /** Returns processor cache ! * Processor second level cache in Kb. Integer expected. ! * \return std::string coding the (first) processor second level cache in Kb. */ ! virtual std::string processor_cache(void) = 0; ! /** Returns processors' number ! * \return std::string coding the number of processors (physical and logical) on host */ ! virtual std::string processor_number(void) = 0; ! /** Checks a given directory. ! Directory is given according to its purpose in CompBenchmarks. ! \sa Temp ! \sa checkDirectory() ! \return 1 if ok. ! */ ! virtual int CheckDirectory(Temp where); ! public: ! /** Initialize for CompBenchmarks usage. ! * Checks for temporary directories. ! * \return 1 if ok. ! * \sa CheckDirectory() ! */ ! virtual int init(void); ! /** Give a list containing the compatible benchmarks ! * in declared directories. ! * \return a std::string list of benchmarks (id) ! * \sa Package() */ ! virtual PackageVector& packageList(int _force = 0); ! /** Get supported packages' number ! * \return integer ! * \sa Package() */ ! virtual int packageNumber(void); ! /** Get a package according to its index ! * \return CBMPackage instance ! * \sa packageNumber() ! */ ! virtual class CBMPackage *Package(int index); ! /** Get a package acoording to its internal identifier ! * \param pid std::string containing the package's identifier ! * \return CBMPackage instance ! * \sa packageList() ! */ ! virtual class CBMPackage *Package(std::string pid); ! /** Get a benchmark according to its internal identifier ! * \param bid std:string containing the benchmark's identifier ! * \return CBMBenchmark instance */ ! virtual class CBMBenchmark *Benchmark(std::string bid); ! /** Display informations about all packages ! * Used by compbenchmarks-core */ ! virtual void displayAllPackages(void); ! /** Display informations about all benchmarks ! * Used by compbenchmarks-core */ ! virtual void displayAllBenchmarks(void); ! /** Split a std::string. ! * Split given string as sub-strings, according to an arbitrary delimiter. ! * \param str string to split ! * \param delim delimiter ! * \param wantedIndex sub-string index */ ! virtual std::string Split(const std::string& str, ! const std::string& delim, ! unsigned int wantedIndex); ! /** Remove trailing line-feed (and carriage return) from specified string. ! * \param str the string */ ! virtual void Chomp(std::string& str); ! /** Describe host. ! * Displays informations about processors, OS, and so on. ! */ ! virtual void display(void); ! /** Describe external programs. ! * Displays informations about external programs used in CompBenchmarks or in ! * compbenchmark-config program. */ ! virtual void displayPrograms(void); ! /** External command execution. ! * Uses shell to execute command. ! * \param command shell command to execute ! * \param result stdout dump ! * \return return code of the shell command ! */ ! virtual int exec(std::string& command, std::string& result) = 0; ! /** Computes MD5 from a string ! * \param data Data to checksum ! * \return std::string coding data's checksum */ ! virtual std::string md5(std::string& data); ! /** Computes MD5 from a file ! * \param filename absolute filename ! * \return MD5 of the file passed. May be NULL (""). ! */ ! virtual std::string md5File(std::string& filename); ! /** Download a file or a page to a physical file. ! * Uses wget for now. ! * \param url URL containing data to download ! * \param localfile local filename used to store data ! * \return 1 if ok. ! */ \ ! virtual int download(std::string url, ! std::string localfile); ! /** Copy a local file. ! * Will uses cp on UNIX. ! * \param from source file to be copied ! * \param to destination of the file ! * \return 1 if ok. ! */ ! virtual int copy(std::string from, std::string to) = 0; ! /** Creates a directory ! * \param dir directory name ! * \return 1 if ok. ! */ ! virtual int mkdir(std::string dir) = 0; ! /** Checks if a directory is presents and has correct rights ! * \param dir directory to check ! * \return 1 if ok. ! */ ! virtual int checkDirectory(std::string dir) = 0; ! /** Gives an absolute directory ! * According to the where parameter, returns the temporary directory to use for ! * patches, download, or whatever. Note that CBMSystem::Extract, ! * CBMSystem::Status and CBMSystem::Configuration are host specific in ! * CBMSystem::Root. ! * \param where directory type ! * \return an absolute directory name ! */ ! virtual std::string temporaryDirectory(Temp where); ! /** Removes (unlink) a file ! * \param localfile file to remove ! * \return 1 if Ok. ! */ ! virtual int unlink(std::string localfile) = 0; ! /** Stores an couple key/value ! Each key must be unique. Value can be text, or number. ! \param key Key name ! \param value Value for the key. ! \return 1 if ok. ! */ ! virtual int store(char *key, ! std::string value); ! /** Retrieves the value of a key ! * \param key key name ! * \return key's value ! */ ! virtual std::string read(char *key); ! /** Tests if a file exists ! * \param fn (absolute) filename to test for ! * \return 1 if the file exists ! */ ! virtual int fileExists(std::string fn); ! /** Returns current time in seconds, since EPOC. ! * \return Current time. ! */ ! virtual time_t Time(void); ! /** Release the object. Frees internal pointers, and removes lockfiles. ! \sa init() ! \return 1 if ok. ! */ ! virtual int done(void); ! /** Returns the last command executed by compbenchmarks library. ! \sa lastCommand ! \sa getLastCommandOutput() ! \result a std::string containing the command */ ! virtual std::string& getLastCommand(void); ! /** Returns the last command's output executed by compbenchmarks library. ! \sa lastCommandOutput ! \sa getLastCommand() ! \result a std::string containing the command's output */ ! virtual std::string& getLastCommandOutput(void); ! }; ! extern CBMSystem *cbmSystem; #endif --- 15,302 ---- #include <time.h> ! namespace CBM { ! /** Defines a vector of packages. */ ! typedef std::vector<std::string> PackageVector; ! /** \brief Operating system (and optionnaly hardware) abstraction layer. ! * ! * This class defines the base abstract (pure) object for all supported operating ! * systems. It may also introduces hardware-related dependencies. */ ! class System ! { ! public: ! /** Temporary directory. ! * Defines typedef used to query temporary directories used by CompBenchmarks. ! */ ! typedef enum Temp { Root, /*!< Root directory */ ! HostDep, /*!< Prefix for host-dependend directory */ ! Extract, /*!< Archive extraction temporary directory */ ! Patches, /*!< Directory holding patches */ ! OS, /*!< System specific material */ ! Download, /*!< Downloads temporary directory */ ! Status, /*!< Directory holding status of packages and ! * benchmarks */ ! Configuration /*!< Directory for configuration related ! * informations */ ! }; ! private: ! /** Check if the given directory holds patches. ! * Check if given arguments holds patches needed by libcompbenchmarks. ! * \param dir directory to check ! * \return non-null if ok. ! */ ! virtual int verifyPatchDirectory(std::string dir); ! protected: ! /** \sa Packages() */ ! PackageVector packages; ! /** Stores the last (shell) command executed by compbenchmarks library. */ ! std::string lastCommand; ! /** Stores the output of the last (shell) command executed by ! * compbenchmarks library. */ ! std::string lastCommandOutput; ! /** Constructor. */ ! System(); ! /** Virtual destructor */ ! virtual ~System(); ! /** External command execution. ! * Uses shell to execute command. ! * \param command shell command to execute ! * \return stdout dump ! * \sa exec() ! */ ! virtual std::string exec0(std::string& command); ! virtual std::string exec0(char *command); ! ! /** Returns host's architecture. ! * As uname -m on UNIX. ! * \return Host's architecture ! */ ! virtual std::string arch(void) = 0; ! /** Get host ID ! * As hostid command does on UNIX. ! * \return Host ID as string.*/ ! virtual std::string hostid(void) = 0; ! /** Returns hostname ! * Returns the shortname. ! * \return hostname */ ! virtual std::string hostname(void) = 0; ! /** Returns operating system name ! * \return Operating system name (as uname command on UNIX) */ ! virtual std::string os(void) = 0; ! /** Returns operating system version ! * \return Operating system version (as uname -r command on most UNIXes) */ ! virtual std::string os_version(void) = 0; ! /** Returns processor name ! * Here we infer that each processor on the node are identical, which is the case ! * on x86 and compatible hardware. ! * \return Processor name, as clear text ! * \sa processor_number() */ ! virtual std::string processor_name(void) = 0; ! /** Returns processor speed ! * Processor speed in MHz. Integer expected. ! * \return std::string coding an integer matching the (first) processor speed, in MHz. */ ! virtual std::string processor_mhz(void) = 0; ! /** Returns processor cache ! * Processor second level cache in Kb. Integer expected. ! * \return std::string coding the (first) processor second level cache in Kb. */ ! virtual std::string processor_cache(void) = 0; ! /** Returns processors' number ! * \return std::string coding the number of processors (physical and logical) on host */ ! virtual std::string processor_number(void) = 0; ! /** Checks a given directory. ! Directory is given according to its purpose in CompBenchmarks. ! \sa Temp ! \sa checkDirectory() ! \return 1 if ok. ! */ ! virtual int CheckDirectory(Temp where); ! public: ! /** Initialize for CompBenchmarks usage. ! * Checks for temporary directories. ! * \return 1 if ok. ! * \sa CheckDirectory() ! */ ! virtual int init(void); ! /** Give a list containing the compatible benchmarks ! * in declared directories. ! * \return a std::string list of benchmarks (id) ! * \sa Package() */ ! virtual PackageVector& packageList(int _force = 0); ! /** Get supported packages' number ! * \return integer ! * \sa Package() */ ! virtual int packageNumber(void); ! /** Get a package according to its index ! * \return Package instance ! * \sa packageNumber() ! */ ! virtual class Package *Package(int index); ! /** Get a package acoording to its internal identifier ! * \param pid std::string containing the package's identifier ! * \return CBMPackage instance ! * \sa packageList() ! */ ! virtual class Package *Package(std::string pid); ! /** Get a benchmark according to its internal identifier ! * \param bid std:string containing the benchmark's identifier ! * \return Benchmark instance */ ! virtual class Benchmark *Benchmark(std::string bid); ! /** Display informations about all packages ! * Used by compbenchmarks-core */ ! virtual void displayAllPackages(void); ! /** Display informations about all benchmarks ! * Used by compbenchmarks-core */ ! virtual void displayAllBenchmarks(void); ! /** Split a std::string. ! * Split given string as sub-strings, according to an arbitrary delimiter. ! * \param str string to split ! * \param delim delimiter ! * \param wantedIndex sub-string index */ ! virtual std::string Split(const std::string& str, ! const std::string& delim, ! unsigned int wantedIndex); ! /** Remove trailing line-feed (and carriage return) from specified string. ! * \param str the string */ ! virtual void Chomp(std::string& str); ! /** Describe host. ! * Displays informations about processors, OS, and so on. ! */ ! virtual void display(void); ! /** Describe external programs. ! * Displays informations about external programs used in CompBenchmarks or in ! * compbenchmark-config program. */ ! virtual void displayPrograms(void); ! /** External command execution. ! * Uses shell to execute command. ! * \param command shell command to execute ! * \param result stdout dump ! * \return return code of the shell command ! */ ! virtual int exec(std::string& command, std::string& result) = 0; ! /** Computes MD5 from a string ! * \param data Data to checksum ! * \return std::string coding data's checksum */ ! virtual std::string md5(std::string& data); ! /** Computes MD5 from a file ! * \param filename absolute filename ! * \return MD5 of the file passed. May be NULL (""). ! */ ! virtual std::string md5File(std::string& filename); ! /** Download a file or a page to a physical file. ! * Uses wget for now. ! * \param url URL containing data to download ! * \param localfile local filename used to store data ! * \return 1 if ok. ! */ \ ! virtual int download(std::string url, ! std::string localfile); ! /** Copy a local file. ! * Will uses cp on UNIX. ! * \param from source file to be copied ! * \param to destination of the file ! * \return 1 if ok. ! */ ! virtual int copy(std::string from, std::string to) = 0; ! /** Creates a directory ! * \param dir directory name ! * \return 1 if ok. ! */ ! virtual int mkdir(std::string dir) = 0; ! /** Checks if a directory is presents and has correct rights ! * \param dir directory to check ! * \return 1 if ok. ! */ ! virtual int checkDirectory(std::string dir) = 0; ! /** Gives an absolute directory ! * According to the where parameter, returns the temporary directory to use for ! * patches, download, or whatever. Note that System::Extract, ! * System::Status and System::Configuration are host specific in ! * System::Root. ! * \param where directory type ! * \return an absolute directory name ! */ ! virtual std::string temporaryDirectory(Temp where); ! /** Removes (unlink) a file ! * \param localfile file to remove ! * \return 1 if Ok. ! */ ! virtual int unlink(std::string localfile) = 0; ! /** Stores an couple key/value ! Each key must be unique. Value can be text, or number. ! \param key Key name ! \param value Value for the key. ! \return 1 if ok. ! */ ! virtual int store(char *key, ! std::string value); ! /** Retrieves the value of a key ! * \param key key name ! * \return key's value ! */ ! virtual std::string read(char *key); ! /** Tests if a file exists ! * \param fn (absolute) filename to test for ! * \return 1 if the file exists ! */ ! virtual int fileExists(std::string fn); ! /** Returns current time in seconds, since EPOC. ! * \return Current time. ! */ ! virtual time_t Time(void); ! /** Release the object. Frees internal pointers, and removes lockfiles. ! \sa init() ! \return 1 if ok. ! */ ! virtual int done(void); ! /** Returns the last command executed by compbenchmarks library. ! \sa lastCommand ! \sa getLastCommandOutput() ! \result a std::string containing the command */ ! virtual std::string& getLastCommand(void); ! /** Returns the last command's output executed by compbenchmarks library. ! \sa lastCommandOutput ! \sa getLastCommand() ! \result a std::string containing the command's output */ ! virtual std::string& getLastCommandOutput(void); ! }; ! extern System *cbmSystem; ! } #endif Index: System-FreeBSD.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/System/System-FreeBSD.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** System-FreeBSD.cpp 1 Nov 2006 10:32:17 -0000 1.6 --- System-FreeBSD.cpp 18 Jan 2007 18:43:02 -0000 1.7 *************** *** 12,21 **** #include <config.h> /* !!! */ ! CBMSystemFreeBSD::CBMSystemFreeBSD() ! : CBMSystemUnix() { } ! std::string CBMSystemFreeBSD::processor_name(void) { std::string r = exec0("echo $(/sbin/sysctl hw.model | head -1 | cut -f2 -d'=')"); --- 12,23 ---- #include <config.h> /* !!! */ ! using namespace CBM; ! ! SystemFreeBSD::SystemFreeBSD() ! : SystemUnix() { } ! std::string SystemFreeBSD::processor_name(void) { std::string r = exec0("echo $(/sbin/sysctl hw.model | head -1 | cut -f2 -d'=')"); *************** *** 26,30 **** } ! std::string CBMSystemFreeBSD::processor_mhz(void) { std::string r = exec0("echo $(/sbin/sysctl hw.cpuspeed | head -1 | cut -f2 -d'=')"); --- 28,32 ---- } ! std::string SystemFreeBSD::processor_mhz(void) { std::string r = exec0("echo $(/sbin/sysctl hw.cpuspeed | head -1 | cut -f2 -d'=')"); *************** *** 34,38 **** } ! std::string CBMSystemFreeBSD::processor_cache(void) { std::string r = exec0("echo $(/sbin/sysctl hw.l2cachesize 2> /dev/null | head -1 | cut -f2 -d'=')"); --- 36,40 ---- } ! std::string SystemFreeBSD::processor_cache(void) { std::string r = exec0("echo $(/sbin/sysctl hw.l2cachesize 2> /dev/null | head -1 | cut -f2 -d'=')"); *************** *** 42,46 **** } ! std::string CBMSystemFreeBSD::processor_number(void) { std::string r = exec0("echo $(/sbin/sysctl hw.ncpu | head -1 | cut -f2 -d'=')"); --- 44,48 ---- } ! std::string SystemFreeBSD::processor_number(void) { std::string r = exec0("echo $(/sbin/sysctl hw.ncpu | head -1 | cut -f2 -d'=')"); *************** *** 50,54 **** } ! CBMSystemFreeBSD::~CBMSystemFreeBSD() { } --- 52,56 ---- } ! SystemFreeBSD::~SystemFreeBSD() { } Index: System.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/System/System.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** System.cpp 15 Jan 2007 17:51:28 -0000 1.20 --- System.cpp 18 Jan 2007 18:43:02 -0000 1.21 *************** *** 19,25 **** #define BUF 65535 ! CBMSystem *cbmSystem =0; ! CBMSystem::CBMSystem() { std::string tmp; --- 19,27 ---- #define BUF 65535 ! using namespace CBM; ! System *CBM::cbmSystem =0; ! ! System::System() { std::string tmp; *************** *** 27,42 **** cbmSystem=this; ! if (!UI) ! UI=new CBMUI; tmp=PREFIX; tmp+="/lib"; ! cbmlib_paths.push_back(tmp); ! cbmlib_paths.push_back("./SupportedBenchmarks/.libs"); ! cbmlib_paths.push_back("../../SupportedBenchmarks/.libs"); } ! int CBMSystem::verifyPatchDirectory(std::string dir) { std::string fn; --- 29,44 ---- cbmSystem=this; ! if (!cbmUI) ! cbmUI=new CBM::UI; tmp=PREFIX; tmp+="/lib"; ! CBM::cbmlib_paths.push_back(tmp); ! CBM::cbmlib_paths.push_back("./SupportedBenchmarks/.libs"); ! CBM::cbmlib_paths.push_back("../../SupportedBenchmarks/.libs"); } ! int System::verifyPatchDirectory(std::string dir) { std::string fn; *************** *** 50,60 **** } ! int CBMSystem::CheckDirectory(Temp where) { std::string dir = temporaryDirectory(where); int r; ! UI->Information(CBMUI::DirectoryCheck, ! dir); if (!checkDirectory(dir)) { --- 52,62 ---- } ! int System::CheckDirectory(Temp where) { std::string dir = temporaryDirectory(where); int r; ! cbmUI->Information(CBM::UI::DirectoryCheck, ! dir); if (!checkDirectory(dir)) { *************** *** 64,68 **** std::string msg = "Can't create "; msg+=dir; ! UI->Fatal(msg); } } --- 66,70 ---- std::string msg = "Can't create "; msg+=dir; ! cbmUI->Fatal(msg); } } *************** *** 71,75 **** } ! int CBMSystem::download(std::string url, std::string localfile) { --- 73,77 ---- } ! int System::download(std::string url, std::string localfile) { *************** *** 98,102 **** } ! int CBMSystem::init(void) { std::string pid; --- 100,104 ---- } ! int System::init(void) { std::string pid; *************** *** 104,109 **** pid=read("lockfile.pid"); if (pid!="") { ! UI->Fatal("According to lockfile.pid, process " \ ! " already uses Compbenchmarks' administrative files."); } else { --- 106,111 ---- pid=read("lockfile.pid"); if (pid!="") { ! cbmUI->Fatal("According to lockfile.pid, process " \ ! " already uses Compbenchmarks' administrative files."); } else { *************** *** 129,133 **** ! PackageVector &CBMSystem::packageList(int _force) { DIR *fd; --- 131,135 ---- ! PackageVector &System::packageList(int _force) { DIR *fd; *************** *** 136,140 **** unsigned int e; int p_i; ! int p_n = cbmlib_paths.size(); std::string dir; --- 138,142 ---- unsigned int e; int p_i; ! int p_n = CBM::cbmlib_paths.size(); std::string dir; *************** *** 147,151 **** for(p_i=0;p_i<p_n;p_i++) { ! dir=cbmlib_paths[p_i]; fd=opendir(dir.c_str()); --- 149,153 ---- for(p_i=0;p_i<p_n;p_i++) { ! dir= CBM::cbmlib_paths[p_i]; fd=opendir(dir.c_str()); *************** *** 185,201 **** } ! int CBMSystem::packageNumber(void) { return(packages.size()); } ! CBMPackage *CBMSystem::Package(int index) { return(Package(packages[index])); } ! CBMPackage *CBMSystem::Package(std::string pid) { ! cbmlib_internal *p = cbmlib_load((char*) pid.c_str()); if (p) --- 187,203 ---- } ! int System::packageNumber(void) { return(packages.size()); } ! Package *System::Package(int index) { return(Package(packages[index])); } ! Package *System::Package(std::string pid) { ! CBM::cbmlib_internal *p = CBM::cbmlib_load((char*) pid.c_str()); if (p) *************** *** 205,212 **** } ! CBMBenchmark *CBMSystem::Benchmark(std::string bid) { ! std::string pid; ! CBMPackage *P = 0; pid=Split(bid, "-", 0); --- 207,214 ---- } ! Benchmark *System::Benchmark(std::string bid) { ! std::string pid; ! CBM::Package *P = 0; pid=Split(bid, "-", 0); *************** *** 220,228 **** } ! void CBMSystem::displayAllPackages(void) { ! int i; ! int n = packageNumber(); ! CBMPackage *P; for(i=0; i<n; i++) { --- 222,230 ---- } ! void System::displayAllPackages(void) { ! int i; ! int n = packageNumber(); ! CBM::Package *P; for(i=0; i<n; i++) { *************** *** 232,240 **** } ! void CBMSystem::displayAllBenchmarks(void) { int i; int n = packageNumber(); ! CBMPackage *P; for(i=0; i<n; i++) { --- 234,242 ---- } ! void System::displayAllBenchmarks(void) { int i; int n = packageNumber(); ! CBM::Package *P; for(i=0; i<n; i++) { *************** *** 245,249 **** } ! std::string CBMSystem::Split(const std::string& str, const std::string& delim, unsigned int wantedIndex) { unsigned int offset = 0; --- 247,251 ---- } ! std::string System::Split(const std::string& str, const std::string& delim, unsigned int wantedIndex) { unsigned int offset = 0; *************** *** 267,271 **** } ! void CBMSystem::Chomp(std::string& str) { int l = str.length(); --- 269,273 ---- } ! void System::Chomp(std::string& str) { int l = str.length(); *************** *** 296,300 **** } ! void CBMSystem::display(void) { std::cout << "host::arch=" << arch() << std::endl --- 298,302 ---- } ! void System::display(void) { std::cout << "host::arch=" << arch() << std::endl *************** *** 309,313 **** } ! void CBMSystem::displayPrograms(void) { std::cout << "BZIP2:" << CBM_PROG_BZIP2 << std::endl --- 311,315 ---- } ! void System::displayPrograms(void) { std::cout << "BZIP2:" << CBM_PROG_BZIP2 << std::endl *************** *** 332,336 **** } ! std::string CBMSystem::exec0(std::string& command) { std::string result; --- 334,338 ---- } ! std::string System::exec0(std::string& command) { std::string result; *************** *** 343,347 **** } ! std::string CBMSystem::exec0(char *command) { std::string tmp = command; --- 345,349 ---- } ! std::string System::exec0(char *command) { std::string tmp = command; *************** *** 350,354 **** } ! std::string CBMSystem::md5(std::string& data) { md5_state_t state; --- 352,356 ---- } ! std::string System::md5(std::string& data) { md5_state_t state; *************** *** 371,375 **** } ! std::string CBMSystem::md5File(std::string& filename) { std::ifstream IN(filename.c_str(), --- 373,377 ---- } ! std::string System::md5File(std::string& filename) { std::ifstream IN(filename.c_str(), *************** *** 399,403 **** str="Invalid MD5 for "; str+=filename; ! UI->Fatal(str); result=""; } --- 401,405 ---- str="Invalid MD5 for "; str+=filename; ! cbmUI->Fatal(str); result=""; } *************** *** 406,410 **** } ! std::string CBMSystem::temporaryDirectory(Temp where) { std::string result; --- 408,412 ---- } ! std::string System::temporaryDirectory(Temp where) { std::string result; *************** *** 458,462 **** } break; ! case System: result=DATAROOTDIR; result+="/"; --- 460,464 ---- } break; ! case OS: result=DATAROOTDIR; result+="/"; *************** *** 477,481 **** break; default: ! UI->Fatal("Internal : Bad 'where' parameters in CBMSystem::temporaryDirectory();"); return(""); } --- 479,483 ---- break; default: ! cbmUI->Fatal("Internal : Bad 'where' parameters in System::temporaryDirectory();"); return(""); } *************** *** 484,488 **** } ! int CBMSystem::store(char *key, std::string value) { --- 486,490 ---- } ! int System::store(char *key, std::string value) { *************** *** 490,494 **** std::ofstream OUT; ! fn=temporaryDirectory(CBMSystem::Status); fn+="/"; fn+=key; --- 492,496 ---- std::ofstream OUT; ! fn=temporaryDirectory(System::Status); fn+="/"; fn+=key; *************** *** 501,505 **** } ! std::string CBMSystem::read(char *key) { std::string fn; --- 503,507 ---- } ! std::string System::read(char *key) { std::string fn; *************** *** 509,513 **** std::string result; ! fn=temporaryDirectory(CBMSystem::Status); fn+="/"; fn+=key; --- 511,515 ---- std::string result; ! fn=temporaryDirectory(System::Status); fn+="/"; fn+=key; *************** *** 535,539 **** } ! int CBMSystem::fileExists(std::string fn) { std::ifstream IN; --- 537,541 ---- } ! int System::fileExists(std::string fn) { std::ifstream IN; *************** *** 550,565 **** } ! time_t CBMSystem::Time(void) { return(time(NULL)); } ! int CBMSystem::done(void) { std::string fn; ! cbmlib_done(); ! ! fn=temporaryDirectory(CBMSystem::Status); fn+="/"; fn+="lockfile.pid"; --- 552,566 ---- } ! time_t System::Time(void) { return(time(NULL)); } ! int System::done(void) { std::string fn; + CBM::cbmlib_done(); ! fn=temporaryDirectory(System::Status); fn+="/"; fn+="lockfile.pid"; *************** *** 567,581 **** } ! std::string& CBMSystem::getLastCommand(void) { return(lastCommand); } ! std::string& CBMSystem::getLastCommandOutput(void) { return(lastCommandOutput); } ! CBMSystem::~CBMSystem() { } --- 568,582 ---- } ! std::string& System::getLastCommand(void) { return(lastCommand); } ! std::string& System::getLastCommandOutput(void) { return(lastCommandOutput); } ! System::~System() { } Index: XML.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/System/XML.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** XML.h 17 Jan 2007 20:12:30 -0000 1.2 --- XML.h 18 Jan 2007 18:43:02 -0000 1.3 *************** *** 13,143 **** #include <vector> ! /** \brief XML Attribute ! * Internal representation for an XML attribute. ! */ ! class CBMXMLAttribute ! { ! protected: ! std::string name; /*!< Attribute name */ ! std::string value; /*!< Attribute value */ ! public: ! /** Constructor ! * Initialise a new attribute. ! * \param _name Attribute's name ! * \param _value Attribute's value (optional) */ ! CBMXMLAttribute(std::string _name, ! std::string _value = ""); ! /** Get attribute's name ! \return a std::string */ ! virtual std::string Name(void); ! /** Get attribute's value ! \return a std::string */ ! virtual std::string Value(void); ! /** Set attribute's value ! \param _value new value (std::string) ! */ ! virtual void setValue(std::string _value); ! /** Destructor */ ! virtual ~CBMXMLAttribute(); ! }; ! /** \brief XML Node ! * Internal representation of an XML node. ! */ ! class CBMXMLNode ! { ! protected: ! std::vector<CBMXMLNode*> childs; /*!< Child nodes */ ! std::vector<CBMXMLAttribute*> attributes; /*!< Node's attributes */ ! std::string name; /*!< Node's name */ ! std::string value; /*!< Node value */ ! virtual void indent(std::string& str, ! int _indent); ! public: ! /** Constructor ! * Initialise a new node. ! * \param _name Node's name ! * \param _value Node's value (optional) */ ! CBMXMLNode(std::string _name, ! std::string _value = ""); ! /** Get node's name ! \return a std::string */ ! virtual std::string Name(void); ! /** Get node's value ! \return a std::string */ ! virtual std::string Value(void); ! /** Set node's value ! \param _value new value (std::string) ! */ ! virtual void setValue(std::string _value); ! /** Get childs' number ! * \return number of nodes held by current node ! * \sa getChild() */ ! virtual int childNumber(void); ! /** Get a child node according to its index ! * \return A node ! * \sa childNumber() */ ! virtual CBMXMLNode *getChild(int _index); ! /** Get attributes' number ! * \return number of attributes on current node ! * \sa getAttribute() */ ! virtual int attributeNumber(void); - /** Get an attribute according to its index - * \return An attribute - * \sa attributeNumber() */ - virtual CBMXMLAttribute *getAttribute(int _index); ! /** Add a node into current node ! * \param _child node to add ! * \return node added (_child) ! * \sa addNode() */ ! virtual CBMXMLNode *add(CBMXMLNode *_child); ! /** Add a node into current node ! * \param _name name of the node ! * \param _value value of the node (optional) ! * \return node added (_child) ! * \sa add() */ ! virtual CBMXMLNode *addNode(std::string _name, ! std::string _value = ""); ! /** Add an attribute on current node ! * \param _attribute to add ! * \return attribute added (_attribute) ! * \sa addAttribute() */ ! virtual CBMXMLAttribute *add(CBMXMLAttribute *_attribute); ! /** Add an attribute on current node ! * \param _name name of the attribute ! * \param _value value of the attribute (optional) ! * \return attribute added (_attribute) ! * \sa add() */ ! virtual CBMXMLAttribute *addAttribute(std::string _name, ! std::string _value = ""); - /** Get textual (XML) representation of the node - * Build a string corresponding to the XML elements of current node and - * childs (includes attributes and value). - * \param _indent Optional indentation level; internal use only. - * \return string (XML formatted) */ - virtual std::string str(int _indent = 0); ! virtual ~CBMXMLNode(); ! }; #endif --- 13,149 ---- #include <vector> ! namespace CBM { ! namespace XML { ! /** \brief XML Attribute ! * Internal representation for an XML attribute. ! */ ! class Attribute ! { ! protected: ! std::string name; /*!< Attribute name */ ! std::string value; /*!< Attribute value */ ! public: ! /** Constructor ! * Initialise a new attribute. ! * \param _name Attribute's name ! * \param _value Attribute's value (optional) */ ! Attribute(std::string _name, ! std::string _value = ""); ! /** Get attribute's name ! \return a std::string */ ! virtual std::string Name(void); ! /** Get attribute's value ! \return a std::string */ ! virtual std::string Value(void); ! /** Set attribute's value ! \param _value new value (std::string) ! */ ! virtual void setValue(std::string _value); ! /** Destructor */ ! virtual ~Attribute(); ! }; ! /** \brief XML Node ! * Internal representation of an XML node. ! */ ! class Node ! { ! protected: ! std::vector<Node*> childs; /*!< Child nodes */ ! std::vector<Attribute*> attributes; /*!< Node's attributes */ ! std::string name; /*!< Node's name */ ! std::string value; /*!< Node value */ ! virtual void indent(std::string& str, ! int _indent); ! public: ! /** Constructor ! * Initialise a new node. ! * \param _name Node's name ! * \param _value Node's value (optional) */ ! Node(std::string _name, ! std::string _value = ""); ! /** Get node's name ! \return a std::string */ ! virtual std::string Name(void); ! /** Get node's value ! \return a std::string */ ! virtual std::string Value(void); ! /** Set node's value ! \param _value new value (std::string) ! */ ! virtual void setValue(std::string _value); + /** Get childs' number + * \return number of nodes held by current node + * \sa getChild() */ + virtual int childNumber(void); ! /** Get a child node according to its index ! * \return A node ! * \sa childNumber() */ ! virtual Node *getChild(int _index); ! /** Get attributes' number ! * \return number of attributes on current node ! * \sa getAttribute() */ ! virtual int attributeNumber(void); ! /** Get an attribute according to its index ! * \return An attribute ! * \sa attributeNumber() */ ! virtual Attribute *getAttribute(int _index); ! /** Add a node into current node ! * \param _child node to add ! * \return node added (_child) ! * \sa addNode() */ ! virtual Node *add(Node *_child); + /** Add a node into current node + * \param _name name of the node + * \param _value value of the node (optional) + * \return node added (_child) + * \sa add() */ + virtual Node *addNode(std::string _name, + std::string _value = ""); ! /** Add an attribute on current node ! * \param _attribute to add ! * \return attribute added (_attribute) ! * \sa addAttribute() */ ! virtual Attribute *add(Attribute *_attribute); ! /** Add an attribute on current node ! * \param _name name of the attribute ! * \param _value value of the attribute (optional) ! * \return attribute added (_attribute) ! * \sa add() */ ! virtual Attribute *addAttribute(std::string _name, ! std::string _value = ""); ! ! /** Get textual (XML) representation of the node ! * Build a string corresponding to the XML elements of current node and ! * childs (includes attributes and value). ! * \param _indent Optional indentation level; internal use only. ! * \return string (XML formatted) */ ! virtual std::string str(int _indent = 0); ! ! virtual ~Node(); ! }; ! } ! } #endif Index: System-Linux.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/System/System-Linux.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** System-Linux.h 19 Sep 2006 17:08:24 -0000 1.3 --- System-Linux.h 18 Jan 2007 18:43:02 -0000 1.4 *************** *** 12,52 **** #include <System/System-Unix.h> ! /** \brief Linux operating system support class. ! * ! * Implements a few methods not defined by CBMSystemUnix to handle properly ! * Linux systems in CompBenchmarks. ! */ ! class CBMSystemLinux : public CBMSystemUnix ! { ! protected: ! public: ! /** Constructor */ ! CBMSystemLinux(); ! /** Returns processor name ! * Uses /proc to get the name of the first installed processor. ! * \return Processor name, as clear text ! * \sa processor_number() */ ! virtual std::string processor_name(void); ! /** Returns processor speed ! * Uses /proc to get the speed, in MHz, of the first installed processor. ! * \return Processor speed in MHz, as clear text (integer returned) ! * \sa processor_number() */ ! virtual std::string processor_mhz(void); ! /** Returns processor cache ! * Uses /proc to get processor second level cache in Kb. Integer expected. ! * \return std::string coding (first) processor second level cache in Kb. */ ! virtual std::string processor_cache(void); ! /** Returns processors' number ! * Uses /proc to get information. ! * \return std::string coding the number of processors (physical and logical) on host */ ! virtual std::string processor_number(void); ! /** Virtual destructor */ ! virtual ~CBMSystemLinux(); ! }; #endif --- 12,54 ---- #include <System/System-Unix.h> ! namespace CBM { ! /** \brief Linux operating system support class. ! * ! * Implements a few methods not defined by SystemUnix to handle properly ! * Linux systems in CompBenchmarks. ! */ ! class SystemLinux : public SystemUnix ! { ! protected: ! public: ! /** Constructor */ ! SystemLinux(); ! /** Returns processor name ! * Uses /proc to get the name of the first installed processor. ! * \return Processor name, as clear text ! * \sa processor_number() */ ! virtual std::string processor_name(void); ! /** Returns processor speed ! * Uses /proc to get the speed, in MHz, of the first installed processor. ! * \return Processor speed in MHz, as clear text (integer returned) ! * \sa processor_number() */ ! virtual std::string processor_mhz(void); ! /** Returns processor cache ! * Uses /proc to get processor second level cache in Kb. Integer expected. ! * \return std::string coding (first) processor second level cache in Kb. */ ! virtual std::string processor_cache(void); ! /** Returns processors' number ! * Uses /proc to get information. ! * \return std::string coding the number of processors (physical and logical) on host */ ! virtual std::string processor_number(void); ! /** Virtual destructor */ ! virtual ~SystemLinux(); ! }; ! } #endif Index: System-FreeBSD.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/System/System-FreeBSD.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** System-FreeBSD.h 25 Sep 2006 17:42:35 -0000 1.2 --- System-FreeBSD.h 18 Jan 2007 18:43:02 -0000 1.3 *************** *** 12,52 **** #include <System/System-Unix.h> ! /** \brief FreeBSD operating system support class. ! * ! * Implements a few methods not defined by CBMSystemUnix to handle properly ! * FreeBSD systems in CompBenchmarks. ! */ ! class CBMSystemFreeBSD : public CBMSystemUnix ! { ! protected: ! public: ! /** Constructor */ ! CBMSystemFreeBSD(); ! /** Returns processor name ! * Uses /sbin/sysctl to get the name of the first installed processor. ! * \return Processor name, as clear text ! * \sa processor_number() */ ! virtual std::string processor_name(void); ! /** Returns processor speed ! * Uses /sbin/sysctl to get the speed, in MHz, of the first installed processor. ! * \return Processor speed in MHz, as clear text (integer returned) ! * \sa processor_number() */ ! virtual std::string processor_mhz(void); ! /** Returns processor cache ! * Uses /sbin/sysctl to get processor second level cache in Kb. Integer expected. ! * \return std::string coding (first) processor second level cache in Kb. */ ! virtual std::string processor_cache(void); ! /** Returns processors' number ! * Uses /sbin/sysctl to get information. ! * \return std::string coding the number of processors (physical and logical) on host */ ! virtual std::string processor_number(void); ! /** Virtual destructor */ ! virtual ~CBMSystemFreeBSD(); ! }; #endif --- 12,54 ---- #include <System/System-Unix.h> ! namespace CBM { ! /** \brief FreeBSD operating system support class. ! * ! * Implements a few methods not defined by SystemUnix to handle properly ! * FreeBSD systems in CompBenchmarks. ! */ ! class SystemFreeBSD : public SystemUnix ! { ! protected: ! public: ! /** Constructor */ ! SystemFreeBSD(); ! /** Returns processor name ! * Uses /sbin/sysctl to get the name of the first installed processor. ! * \return Processor name, as clear text ! * \sa processor_number() */ ! virtual std::string processor_name(void); ! /** Returns processor speed ! * Uses /sbin/sysctl to get the speed, in MHz, of the first installed processor. ! * \return Processor speed in MHz, as clear text (integer returned) ! * \sa processor_number() */ ! virtual std::string processor_mhz(void); ! /** Returns processor cache ! * Uses /sbin/sysctl to get processor second level cache in Kb. Integer expected. ! * \return std::string coding (first) processor second level cache in Kb. */ ! virtual std::string processor_cache(void); ! /** Returns processors' number ! * Uses /sbin/sysctl to get information. ! * \return std::string coding the number of processors (physical and logical) on host */ ! virtual std::string processor_number(void); ! /** Virtual destructor */ ! virtual ~SystemFreeBSD(); ! }; ! } #endif Index: System-Unix.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/System/System-Unix.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** System-Unix.cpp 28 Dec 2006 13:15:07 -0000 1.7 --- System-Unix.cpp 18 Jan 2007 18:43:02 -0000 1.8 *************** *** 12,15 **** --- 12,17 ---- #include <stdio.h> + using namespace CBM; + void sysunix_sighandler(int signal) { *************** *** 20,30 **** } ! CBMSystemUnix::CBMSystemUnix() ! : CBMSystem() { signal(SIGINT, sysunix_sighandler); } ! int CBMSystemUnix::copy(std::string from, std::string to) { std::string cmd; --- 22,32 ---- } ! SystemUnix::SystemUnix() ! : System() { signal(SIGINT, sysunix_sighandler); } ! int SystemUnix::copy(std::string from, std::string to) { std::string cm... [truncated message content] |
From: Frederic T. <xf...@us...> - 2007-01-17 20:12:35
|
Update of /cvsroot/compbench/CompBenchmarks++/System In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv7425 Modified Files: XML.h Log Message: Updated doxygen documentation. Index: XML.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/System/XML.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** XML.h 17 Jan 2007 19:08:35 -0000 1.1 --- XML.h 17 Jan 2007 20:12:30 -0000 1.2 *************** *** 22,33 **** --- 22,46 ---- std::string value; /*!< Attribute value */ public: + /** Constructor + * Initialise a new attribute. + * \param _name Attribute's name + * \param _value Attribute's value (optional) */ CBMXMLAttribute(std::string _name, std::string _value = ""); + /** Get attribute's name + \return a std::string */ virtual std::string Name(void); + + /** Get attribute's value + \return a std::string */ virtual std::string Value(void); + /** Set attribute's value + \param _value new value (std::string) + */ virtual void setValue(std::string _value); + /** Destructor */ virtual ~CBMXMLAttribute(); }; *************** *** 48,74 **** --- 61,139 ---- public: + /** Constructor + * Initialise a new node. + * \param _name Node's name + * \param _value Node's value (optional) */ CBMXMLNode(std::string _name, std::string _value = ""); + /** Get node's name + \return a std::string */ virtual std::string Name(void); + + /** Get node's value + \return a std::string */ virtual std::string Value(void); + + /** Set node's value + \param _value new value (std::string) + */ virtual void setValue(std::string _value); + /** Get childs' number + * \return number of nodes held by current node + * \sa getChild() */ virtual int childNumber(void); + + /** Get a child node according to its index + * \return A node + * \sa childNumber() */ virtual CBMXMLNode *getChild(int _index); + /** Get attributes' number + * \return number of attributes on current node + * \sa getAttribute() */ virtual int attributeNumber(void); + + /** Get an attribute according to its index + * \return An attribute + * \sa attributeNumber() */ virtual CBMXMLAttribute *getAttribute(int _index); + /** Add a node into current node + * \param _child node to add + * \return node added (_child) + * \sa addNode() */ virtual CBMXMLNode *add(CBMXMLNode *_child); + /** Add a node into current node + * \param _name name of the node + * \param _value value of the node (optional) + * \return node added (_child) + * \sa add() */ virtual CBMXMLNode *addNode(std::string _name, std::string _value = ""); + /** Add an attribute on current node + * \param _attribute to add + * \return attribute added (_attribute) + * \sa addAttribute() */ virtual CBMXMLAttribute *add(CBMXMLAttribute *_attribute); + + + /** Add an attribute on current node + * \param _name name of the attribute + * \param _value value of the attribute (optional) + * \return attribute added (_attribute) + * \sa add() */ virtual CBMXMLAttribute *addAttribute(std::string _name, std::string _value = ""); + /** Get textual (XML) representation of the node + * Build a string corresponding to the XML elements of current node and + * childs (includes attributes and value). + * \param _indent Optional indentation level; internal use only. + * \return string (XML formatted) */ virtual std::string str(int _indent = 0); |
From: Frederic T. <xf...@us...> - 2007-01-17 19:21:25
|
Update of /cvsroot/compbench/CompBenchmarks++/CBM-PI In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv20575 Modified Files: CBM.i CBM.pm CBM_wrap.cxx Log Message: XML handling wrappers added. Index: CBM.pm =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/CBM-PI/CBM.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CBM.pm 15 Jan 2007 20:44:06 -0000 1.6 --- CBM.pm 17 Jan 2007 19:21:17 -0000 1.7 *************** *** 106,109 **** --- 106,197 ---- + ############# Class : CBM::CBMXMLAttribute ############## + + package CBM::CBMXMLAttribute; + use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); + @ISA = qw( CBM ); + %OWNER = (); + %ITERATORS = (); + sub new { + my $pkg = shift; + my $self = CBMc::new_CBMXMLAttribute(@_); + bless $self, $pkg if defined($self); + } + + *Name = *CBMc::CBMXMLAttribute_Name; + *Value = *CBMc::CBMXMLAttribute_Value; + *setValue = *CBMc::CBMXMLAttribute_setValue; + sub DESTROY { + return unless $_[0]->isa('HASH'); + my $self = tied(%{$_[0]}); + return unless defined $self; + delete $ITERATORS{$self}; + if (exists $OWNER{$self}) { + CBMc::delete_CBMXMLAttribute($self); + delete $OWNER{$self}; + } + } + + sub DISOWN { + my $self = shift; + my $ptr = tied(%$self); + delete $OWNER{$ptr}; + } + + sub ACQUIRE { + my $self = shift; + my $ptr = tied(%$self); + $OWNER{$ptr} = 1; + } + + + ############# Class : CBM::CBMXMLNode ############## + + package CBM::CBMXMLNode; + use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); + @ISA = qw( CBM ); + %OWNER = (); + %ITERATORS = (); + sub new { + my $pkg = shift; + my $self = CBMc::new_CBMXMLNode(@_); + bless $self, $pkg if defined($self); + } + + *Name = *CBMc::CBMXMLNode_Name; + *Value = *CBMc::CBMXMLNode_Value; + *setValue = *CBMc::CBMXMLNode_setValue; + *childNumber = *CBMc::CBMXMLNode_childNumber; + *getChild = *CBMc::CBMXMLNode_getChild; + *attributeNumber = *CBMc::CBMXMLNode_attributeNumber; + *getAttribute = *CBMc::CBMXMLNode_getAttribute; + *addNode = *CBMc::CBMXMLNode_addNode; + *add = *CBMc::CBMXMLNode_add; + *addAttribute = *CBMc::CBMXMLNode_addAttribute; + *str = *CBMc::CBMXMLNode_str; + sub DESTROY { + return unless $_[0]->isa('HASH'); + my $self = tied(%{$_[0]}); + return unless defined $self; + delete $ITERATORS{$self}; + if (exists $OWNER{$self}) { + CBMc::delete_CBMXMLNode($self); + delete $OWNER{$self}; + } + } + + sub DISOWN { + my $self = shift; + my $ptr = tied(%$self); + delete $OWNER{$ptr}; + } + + sub ACQUIRE { + my $self = shift; + my $ptr = tied(%$self); + $OWNER{$ptr} = 1; + } + + ############# Class : CBM::CBMSystemUnix ############## Index: CBM_wrap.cxx =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/CBM-PI/CBM_wrap.cxx,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CBM_wrap.cxx 15 Jan 2007 20:44:06 -0000 1.6 --- CBM_wrap.cxx 17 Jan 2007 19:21:17 -0000 1.7 *************** *** 1388,1397 **** #define SWIGTYPE_p_CBMSystemLinux swig_types[6] #define SWIGTYPE_p_CBMSystemUnix swig_types[7] ! #define SWIGTYPE_p_char swig_types[8] ! #define SWIGTYPE_p_std__string swig_types[9] ! #define SWIGTYPE_p_std__vectorTstd__string_t swig_types[10] ! #define SWIGTYPE_p_time_t swig_types[11] ! static swig_type_info *swig_types[13]; ! static swig_module_info swig_module = {swig_types, 12, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) [...1410 lines suppressed...] + {"CBMc::CBMXMLNode_childNumber", _wrap_CBMXMLNode_childNumber}, + {"CBMc::CBMXMLNode_getChild", _wrap_CBMXMLNode_getChild}, + {"CBMc::CBMXMLNode_attributeNumber", _wrap_CBMXMLNode_attributeNumber}, + {"CBMc::CBMXMLNode_getAttribute", _wrap_CBMXMLNode_getAttribute}, + {"CBMc::CBMXMLNode_addNode", _wrap_CBMXMLNode_addNode}, + {"CBMc::CBMXMLNode_add", _wrap_CBMXMLNode_add}, + {"CBMc::CBMXMLNode_addAttribute", _wrap_CBMXMLNode_addAttribute}, + {"CBMc::CBMXMLNode_str", _wrap_CBMXMLNode_str}, + {"CBMc::delete_CBMXMLNode", _wrap_delete_CBMXMLNode}, {"CBMc::CBMSystemUnix_copy", _wrap_CBMSystemUnix_copy}, {"CBMc::CBMSystemUnix_mkdir", _wrap_CBMSystemUnix_mkdir}, *************** *** 7284,7287 **** --- 8645,8650 ---- } while(0) /*@SWIG@*/; SWIG_TypeClientData(SWIGTYPE_p_CBMSystem, (void*) "CBM::CBMSystem"); + SWIG_TypeClientData(SWIGTYPE_p_CBMXMLAttribute, (void*) "CBM::CBMXMLAttribute"); + SWIG_TypeClientData(SWIGTYPE_p_CBMXMLNode, (void*) "CBM::CBMXMLNode"); SWIG_TypeClientData(SWIGTYPE_p_CBMSystemUnix, (void*) "CBM::CBMSystemUnix"); SWIG_TypeClientData(SWIGTYPE_p_CBMSystemLinux, (void*) "CBM::CBMSystemLinux"); Index: CBM.i =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/CBM-PI/CBM.i,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CBM.i 4 Jan 2007 19:37:29 -0000 1.3 --- CBM.i 17 Jan 2007 19:21:17 -0000 1.4 *************** *** 7,10 **** --- 7,15 ---- %} + %module CBMXML + %{ + #include "System/XML.h" + %} + %module CBMSystem %{ *************** *** 40,43 **** --- 45,49 ---- %include "libcompbenchmarks.h" %include "System/System.h" + %include "System/XML.h" %include "System/System-Unix.h" %include "System/System-Linux.h" |
From: Frederic T. <xf...@us...> - 2007-01-17 19:15:28
|
Update of /cvsroot/compbench/CompBenchmarks++/SupportedBenchmarks In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv18205 Modified Files: Benchmark-BENCHPPLINUX.cpp Log Message: Comments updated. Index: Benchmark-BENCHPPLINUX.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/SupportedBenchmarks/Benchmark-BENCHPPLINUX.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Benchmark-BENCHPPLINUX.cpp 10 Jan 2007 20:30:57 -0000 1.5 --- Benchmark-BENCHPPLINUX.cpp 17 Jan 2007 19:15:17 -0000 1.6 *************** *** 50,55 **** std::string CBMPackageBENCHPPLINUX::packageComments(void) { ! return("Bench++ for Linux was initially a port of Bench++ (based on " \ ! "ADA PIWG suite) to Linux."); } --- 50,56 ---- std::string CBMPackageBENCHPPLINUX::packageComments(void) { ! return("Bench++ for Linux is a port of Bench++ (based on " \ ! "ADA PIWG suite) to Linux. In compbenchmarks, it replaces " \ ! "the package named benchpp."); } |
From: Frederic T. <xf...@us...> - 2007-01-17 19:14:43
|
Update of /cvsroot/compbench/CompBenchmarks++/CBM-PI/t In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17826 Modified Files: Makefile.am Added Files: 00-XML.pl Log Message: XML handling classes tested. Index: Makefile.am =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/CBM-PI/t/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile.am 11 Jan 2007 17:34:27 -0000 1.6 --- Makefile.am 17 Jan 2007 19:14:40 -0000 1.7 *************** *** 1,5 **** SUBDIRS = lib reference ! prog_tests = 00-Glue.pl \ 00-CBMSystem-public.pl 01-CBMSystem-protected.pl \ 02-CBMSystem-benchs.pl \ --- 1,5 ---- SUBDIRS = lib reference ! prog_tests = 00-Glue.pl 00-XML.pl \ 00-CBMSystem-public.pl 01-CBMSystem-protected.pl \ 02-CBMSystem-benchs.pl \ *************** *** 7,10 **** --- 7,11 ---- tests = $(top_srcdir)/CBM-PI/t/00-Glue.pl \ + $(top_srcdir)/CBM-PI/t/00-XML.pl \ $(top_srcdir)/CBM-PI/t/00-CBMSystem-public.pl \ $(top_srcdir)/CBM-PI/t/01-CBMSystem-protected.pl \ --- NEW FILE: 00-XML.pl --- #!/usr/bin/perl -w -I .. use strict; use CBM; use Test::Simple tests => 32; my $sys; sub test_str { my $node = shift; my $expected = shift; my $v = $node->str(); ok($v eq $expected, "$node str is\n$v" . "END ***expected** :\n$expected" . "END"); } sub test_node { my $node = shift; my $name = shift; my $value = shift; my $childs = shift; ok(defined($node)); ok($node->Name() eq $name); my $v=$node->Value(); if (!defined($v)) { ok(!defined($value)); } else { ok($v eq $value); } ok($node->childNumber() == $childs); } sub test_attribute { my $attribute = shift; my $name = shift; my $value = shift; ok(defined($attribute)); ok($attribute->Name() eq $name); my $v=$attribute->Value(); if (!defined($v)) { ok(!defined($value)); } else { ok($v eq $value); } } sub test_node_eq { my $node0 = shift; my $node1 = shift; ok($node0->Name() eq $node1->Name()); ok($node0->childNumber() eq $node1->childNumber()); my $v0=$node0->Value(); my $v1=$node1->Value(); if (!defined($v0)) { ok(!defined($v1)); } else { ok($v0 eq $v1); } } sub test_xml { my $root = CBM::CBMXMLNode->new("root"); my $child = CBM::CBMXMLNode->new("child"); test_node($root, "root", undef, 0); test_str($root, "<root/>\n"); test_node($child, "child", undef, 0); test_str($child, "<child/>\n"); $root->add($child); ok($root->childNumber() == 1); ok($child->childNumber() == 0); test_node_eq($child, $root->getChild(0)); test_str($root, "<root>\n <child/>\n</root>\n"); $root->setValue("root-value"); test_node($root, "root", "root-value", 1); test_node($child, "child", undef, 0); test_str($root, "<root>\n <child/>\n root-value\n</root>\n"); my $att0 = CBM::CBMXMLAttribute->new("att0"); test_attribute($att0, "att0", undef); $root->add($att0); test_attribute($root->getAttribute(0), "att0", undef); } sub test_xml_sample { my $root = CBM::CBMXMLNode->new("point"); $root->addAttribute("x", "0"); $root->addAttribute("y", "1"); $root->addAttribute("z", "-1"); my $color = CBM::CBMXMLNode->new("color"); $color->addAttribute("mode", "plain"); $color->setValue("blue"); $root->setValue("blinking"); $root->add($color); my $x = <<EOF <point x="0" y="1" z="-1"> <color mode="plain"> blue </color> blinking </point> EOF ; ok($root->str() eq $x); } $sys = CBM::Init(); test_xml(); test_xml_sample(); $sys->done(); |
From: Frederic T. <xf...@us...> - 2007-01-17 19:14:15
|
Update of /cvsroot/compbench/CompBenchmarks++/CBM-PI/t In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17565 Modified Files: 02-CBMSystem-benchs.pl Log Message: Correct test number. Index: 02-CBMSystem-benchs.pl =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/CBM-PI/t/02-CBMSystem-benchs.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** 02-CBMSystem-benchs.pl 15 Jan 2007 20:39:42 -0000 1.2 --- 02-CBMSystem-benchs.pl 17 Jan 2007 19:14:05 -0000 1.3 *************** *** 10,14 **** my @benchmarks = `cat $top_srcdir/../../SupportedBenchmarks/benchmarks.list | grep -v '^#' | cut -f1 -d':'`; chomp(@benchmarks); ! plan tests => ((@benchmarks+0)*59)+1; my $sys; --- 10,14 ---- my @benchmarks = `cat $top_srcdir/../../SupportedBenchmarks/benchmarks.list | grep -v '^#' | cut -f1 -d':'`; chomp(@benchmarks); ! plan tests => ((@benchmarks+0)*59); my $sys; |
From: Frederic T. <xf...@us...> - 2007-01-17 19:08:54
|
Update of /cvsroot/compbench/CompBenchmarks++/System In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv14672 Modified Files: Makefile.am Added Files: XML.cpp XML.h Log Message: XML handling classes. --- NEW FILE: XML.h --- /* ---------------------------------------------------------------------------- $Id: XML.h,v 1.1 2007/01/17 19:08:35 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBMXML #define H_CBMXML #include <string> #include <vector> /** \brief XML Attribute * Internal representation for an XML attribute. */ class CBMXMLAttribute { protected: std::string name; /*!< Attribute name */ std::string value; /*!< Attribute value */ public: CBMXMLAttribute(std::string _name, std::string _value = ""); virtual std::string Name(void); virtual std::string Value(void); virtual void setValue(std::string _value); virtual ~CBMXMLAttribute(); }; /** \brief XML Node * Internal representation of an XML node. */ class CBMXMLNode { protected: std::vector<CBMXMLNode*> childs; /*!< Child nodes */ std::vector<CBMXMLAttribute*> attributes; /*!< Node's attributes */ std::string name; /*!< Node's name */ std::string value; /*!< Node value */ virtual void indent(std::string& str, int _indent); public: CBMXMLNode(std::string _name, std::string _value = ""); virtual std::string Name(void); virtual std::string Value(void); virtual void setValue(std::string _value); virtual int childNumber(void); virtual CBMXMLNode *getChild(int _index); virtual int attributeNumber(void); virtual CBMXMLAttribute *getAttribute(int _index); virtual CBMXMLNode *add(CBMXMLNode *_child); virtual CBMXMLNode *addNode(std::string _name, std::string _value = ""); virtual CBMXMLAttribute *add(CBMXMLAttribute *_attribute); virtual CBMXMLAttribute *addAttribute(std::string _name, std::string _value = ""); virtual std::string str(int _indent = 0); virtual ~CBMXMLNode(); }; #endif --- NEW FILE: XML.cpp --- /* ---------------------------------------------------------------------------- $Id: XML.cpp,v 1.1 2007/01/17 19:08:35 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <System/XML.h> CBMXMLAttribute::CBMXMLAttribute(std::string _name, std::string _value) { name=_name; value=_value; } std::string CBMXMLAttribute::Name(void) { return(name); } std::string CBMXMLAttribute::Value(void) { return(value); } void CBMXMLAttribute::setValue(std::string _value) { value=_value; } CBMXMLAttribute::~CBMXMLAttribute() { } CBMXMLNode::CBMXMLNode(std::string _name, std::string _value) { name=_name; value=_value; } void CBMXMLNode::indent(std::string& str, int _indent) { while (_indent--) str+=" "; } std::string CBMXMLNode::Name(void) { return(name); } std::string CBMXMLNode::Value(void) { return(value); } void CBMXMLNode::setValue(std::string _value) { value=_value; } int CBMXMLNode::childNumber(void) { return(childs.size()); } CBMXMLNode *CBMXMLNode::getChild(int _index) { return(childs[_index]); } int CBMXMLNode::attributeNumber(void) { return(attributes.size()); } CBMXMLAttribute *CBMXMLNode::getAttribute(int _index) { return(attributes[_index]); } CBMXMLNode *CBMXMLNode::add(CBMXMLNode *_child) { childs.push_back(_child); return(_child); } CBMXMLNode *CBMXMLNode::addNode(std::string _name, std::string _value) { CBMXMLNode *result = new CBMXMLNode(_name, _value); return(add(result)); } CBMXMLAttribute *CBMXMLNode::add(CBMXMLAttribute *_attribute) { attributes.push_back(_attribute); return(_attribute); } CBMXMLAttribute *CBMXMLNode::addAttribute(std::string _name, std::string _value) { CBMXMLAttribute *result = new CBMXMLAttribute(_name, _value); return(add(result)); } std::string CBMXMLNode::str(int _indent) { std::string result; CBMXMLAttribute *att; int i; int n_child; int n_attr; indent(result, _indent); n_attr=attributes.size(); n_child=childs.size(); result+="<" + name; if (n_attr) { result+=" "; for(i=0; i<n_attr; i++) { att=getAttribute(i); result+=att->Name() + "=\"" + att->Value() + "\""; if (i!=n_attr-1) { result+=" "; } } } if ((!n_child) && (value=="")) { result+="/>\n"; return(result); } result+=">\n"; if (n_child) { for(i=0; i<n_child; i++) { result+=childs[i]->str(_indent+1); } if (value!="") { indent(result, _indent+1); result+=value; result+="\n"; } indent(result, _indent); result+="</" + name + ">\n"; } else { if (value!="") { indent(result, _indent+1); result+=value; result+="\n"; } indent(result, _indent); result+="</" + name + ">\n"; } return(result); } CBMXMLNode::~CBMXMLNode() { } Index: Makefile.am =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/System/Makefile.am,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Makefile.am 7 Dec 2006 22:03:43 -0000 1.9 --- Makefile.am 17 Jan 2007 19:08:35 -0000 1.10 *************** *** 14,18 **** sources = System.cpp System-Unix.cpp \ ! md5.cpp libSystem_la_SOURCES = $(sources) $(source_sys) --- 14,18 ---- sources = System.cpp System-Unix.cpp \ ! md5.cpp XML.cpp libSystem_la_SOURCES = $(sources) $(source_sys) |
From: Frederic T. <xf...@us...> - 2007-01-16 18:43:00
|
Update of /cvsroot/compbench/CompBenchmarks++ In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv27738 Added Files: compbenchmarks-ui.pl Log Message: First import. --- NEW FILE: compbenchmarks-ui.pl --- #!/usr/bin/perl -w -I../CBM-PI # ----------------------------------------------------------------------------- # $Id: compbenchmarks-ui.pl,v 1.1 2007/01/16 18:42:51 xfred Exp $ # # This is free software. # For details, see the GNU Public License in the COPYING file, or # Look http://www.fsf.org # ----------------------------------------------------------------------------- use strict; use Gtk2 "-init" ; use Glib qw/TRUE FALSE/; use CBM; my $VERSION = "0.5.0"; my $CBM = CBM::Init(); my $CBM_STATUS_PRECONFIGURED = 4; my $CBM_STATUS_NA = 0; my $CBM_STATUS_DOWNLOADED = 1; my %CBM_STATUS = (0 => 'Not installed', $CBM_STATUS_DOWNLOADED => 'Downloaded', 2 => 'Extracted', 3 => 'Installed & patched', $CBM_STATUS_PRECONFIGURED => 'Installed & preconfigured', 5 => 'Installed & configured', 6 => 'Installed & built', 7 => 'Installed & tested', 8 => 'Benchmarked'); my @PACKAGES; my $SELECTED_PACKAGE; my $GUI_MAINWINDOW; my $GUI_MAINWINDOW_EBOX; my $GUI_MAINNOTEBOOK; my $GUI_PACKAGE_SELECTOR; my $GUI_PACKAGE_NAME; my $GUI_PACKAGE_NAME2; my $GUI_PACKAGE_VERSION; my $GUI_PACKAGE_LANGUAGE; my $GUI_PACKAGE_SIZE; my $GUI_PACKAGE_SIZE2; my $GUI_PACKAGE_HOMEPAGE; my $GUI_PACKAGE_DESCRIPTION; my $GUI_PACKAGE_AUTHOR; my $GUI_PACKAGE_LICENSE; my $GUI_PACKAGE_TSIZE; my $GUI_PACKAGE_STATUS; my $GUI_PACKAGE_STATUS2; my $GUI_PACKAGE_MANAGECOMBO; my $GUI_PACKAGE_MANAGECOMBO_NUMBER = 0; my $GUI_STATUS_LABEL; my $GUI_STATUS_PROGRESS; my @BENCHMARKS; my $GUI_BENCHMARK_SELECTOR; my $GUI_BENCHMARK_TREE; my $GUI_BENCHMARK_NAME; my $GUI_BENCHMARK_DESCRIPTION; my $SELECTED_BENCHMARK; my $PACKAGE_FIRST; my $BENCHMARK_FIRST; $CBM->packageList(); my $n = $CBM->packageNumber(); my $i; for($i=0;$i<$n;$i++) { push(@PACKAGES, $CBM->Package($i)); } sub supported_packages_frame { my $parent = shift; my $p; my $table = Gtk2::Table->new(1+1,1,FALSE); my $frame = Gtk2::Frame->new("Supported packages"); my $sw = Gtk2::ScrolledWindow->new (undef, undef); $sw->set_shadow_type ('etched-out'); $sw->set_policy ('automatic', 'automatic'); $sw->set_size_request (50, 50); $sw->set_border_width(5); my $tree_store = Gtk2::TreeStore->new(qw/Glib::String/); my $first = 1; foreach $p (@PACKAGES) { my $pn = $p->packageName(); my $iter = $tree_store->append(undef); $tree_store->set ($iter,0, "$pn"); if ($first) { $PACKAGE_FIRST=$iter; } $first=0; } $GUI_PACKAGE_SELECTOR = Gtk2::TreeView->new($tree_store); my $select = $GUI_PACKAGE_SELECTOR->get_selection(); my $tree_column = Gtk2::TreeViewColumn->new(); $tree_column->set_title("Package"); $select->signal_connect("changed", \&package_update) ; my $renderer = Gtk2::CellRendererText->new(); $tree_column->pack_start ($renderer, FALSE); $tree_column->add_attribute($renderer, text => 0); $GUI_PACKAGE_SELECTOR->append_column ($tree_column); # $GUI_PACKAGE_SELECTOR->set_search_column(0); # $tree_column->set_sort_column_id(0); $GUI_PACKAGE_SELECTOR->set_reorderable(FALSE); $GUI_PACKAGE_SELECTOR->show(); $sw->add($GUI_PACKAGE_SELECTOR); $sw->show(); $table->attach_defaults($sw,0,1,0,1); $frame->add($table); $frame->show(); # $table->add($frame); $table->show(); $parent->attach_defaults($frame,0,1,0,1); my $nb = Gtk2::Notebook->new(); # $table->add($nb); $table->attach_defaults($nb, 1, 2, 0, 1); $nb->show(); package_description_tab($nb); package_management_tab($nb); } sub gui_status_update { my $mode = shift; my $xlabel = shift; my $pc = shift; my $label; my $show_progress_bar = 0; my $arrow; $label="Status : "; if ($mode =~ /^install-/) { $xlabel=$SELECTED_PACKAGE->packageName() . "..."; } if ($mode eq 'idle') { $label.="Idle"; $arrow=Gtk2::Gdk::Cursor->new('GDK_LEFT_PTR'); } elsif ($mode eq 'uninstall') { $label.="Uninstalling package "; $arrow=Gtk2::Gdk::Cursor->new('GDK_WATCH'); } elsif ($mode eq 'install-resetcontext') { $label.="Reset context for "; $arrow=Gtk2::Gdk::Cursor->new('GDK_WATCH'); } elsif ($mode eq 'install-download') { $label.="Downloading "; $arrow=Gtk2::Gdk::Cursor->new('GDK_WATCH'); } elsif ($mode eq 'install-fetch') { $label.="Copying local archive for "; $arrow=Gtk2::Gdk::Cursor->new('GDK_WATCH'); } elsif ($mode eq 'install-extract') { $label.="Extracting "; $arrow=Gtk2::Gdk::Cursor->new('GDK_WATCH'); } elsif ($mode eq 'install-patch') { $label.="Patching "; $arrow=Gtk2::Gdk::Cursor->new('GDK_WATCH'); } elsif ($mode eq 'install-preconfigure') { $label.="Pre-configuring "; $arrow=Gtk2::Gdk::Cursor->new('GDK_WATCH'); } if (defined($xlabel)) { $label.=$xlabel; } if (defined($arrow)) { $GUI_MAINWINDOW_EBOX->window->set_cursor($arrow); # Gtk2::Gdk->set_cursor($arrow); } if (! $show_progress_bar) { $GUI_STATUS_PROGRESS->hide(); } else { $GUI_STATUS_PROGRESS->show(); } $GUI_STATUS_LABEL->set_text($label); $GUI_STATUS_LABEL->show(); while (Gtk2->events_pending()) { Gtk2->main_iteration(); } } sub package_description_tab { my $parent = shift; my $frame = Gtk2::Frame->new(); $frame->set_border_width(5); $frame->set_shadow_type('in'); $frame->show(); my $table = Gtk2::Table->new(1+1,9,FALSE); # my $tag = Gtk2::TextTag->new(); # $tag->set_property('justification' => 'left'); # $table->add($tag); my $name_l = Gtk2::Label->new("Package :"); $table->attach_defaults($name_l,0,1,0,1); $name_l->show(); $GUI_PACKAGE_NAME = Gtk2::Label->new("No package selected."); $table->attach_defaults($GUI_PACKAGE_NAME,1,2,0,1); $GUI_PACKAGE_NAME->show(); my $ver_l = Gtk2::Label->new("Version :"); $table->attach_defaults($ver_l,0,1,1,2); $ver_l->show(); $GUI_PACKAGE_VERSION = Gtk2::Label->new(""); $table->attach_defaults($GUI_PACKAGE_VERSION,1,2,1,2); $GUI_PACKAGE_VERSION->show(); my $lang_l = Gtk2::Label->new("Language :"); $table->attach_defaults($lang_l,0,1,2,3); $lang_l->show(); $GUI_PACKAGE_LANGUAGE = Gtk2::Label->new(""); $table->attach_defaults($GUI_PACKAGE_LANGUAGE,1,2,2,3); $GUI_PACKAGE_LANGUAGE->show(); my $size_l = Gtk2::Label->new("Size :"); $table->attach_defaults($size_l,0,1,3,4); $size_l->show(); $GUI_PACKAGE_SIZE = Gtk2::Label->new(""); $table->attach_defaults($GUI_PACKAGE_SIZE,1,2,3,4); $GUI_PACKAGE_SIZE->show(); my $home_l = Gtk2::Label->new("Homepage :"); $table->attach_defaults($home_l,0,1,4,5); $home_l->show(); $GUI_PACKAGE_HOMEPAGE = Gtk2::Label->new(""); $table->attach_defaults($GUI_PACKAGE_HOMEPAGE,1,2,4,5); $GUI_PACKAGE_HOMEPAGE->show(); my $auth_l = Gtk2::Label->new("Author :"); $table->attach_defaults($auth_l,0,1,5,6); $auth_l->show(); $GUI_PACKAGE_AUTHOR = Gtk2::Label->new(""); $table->attach_defaults($GUI_PACKAGE_AUTHOR,1,2,5,6); $GUI_PACKAGE_AUTHOR->show(); my $lic_l = Gtk2::Label->new("License :"); $table->attach_defaults($lic_l,0,1,6,7); $lic_l->show(); $GUI_PACKAGE_LICENSE = Gtk2::Label->new(""); $table->attach_defaults($GUI_PACKAGE_LICENSE,1,2,6,7); $GUI_PACKAGE_LICENSE->show(); my $status_l = Gtk2::Label->new("Status :"); $table->attach_defaults($status_l,0,1,7,8); $status_l->show(); $GUI_PACKAGE_STATUS = Gtk2::Label->new(""); $table->attach_defaults($GUI_PACKAGE_STATUS,1,2,7,8); $GUI_PACKAGE_STATUS->show(); my $desc_l = Gtk2::Label->new("Description :"); $table->attach_defaults($desc_l,0,1,8,9); $desc_l->show(); my $sw = Gtk2::ScrolledWindow->new (undef, undef); $sw->set_shadow_type ('etched-out'); $sw->set_policy ('automatic', 'automatic'); $sw->set_size_request (300, 200); $sw->set_border_width(5); $table->attach_defaults($sw,1,2,8,9); $table->show(); my $buf = Gtk2::TextBuffer->new(); $buf->set_text("Select a package..."); $GUI_PACKAGE_DESCRIPTION = Gtk2::TextView->new_with_buffer($buf); $GUI_PACKAGE_DESCRIPTION->set_wrap_mode('word'); $GUI_PACKAGE_DESCRIPTION->set_editable(FALSE); $sw->add($GUI_PACKAGE_DESCRIPTION); $sw->show(); $GUI_PACKAGE_DESCRIPTION->show(); # $parent->attach_defaults($frame, 1, 2, 0, 1); $parent->append_page($frame, "Description"); $frame->add($table); } sub package_management_tab { my $parent = shift; my $frame = Gtk2::Frame->new(); $frame->set_border_width(5); $frame->set_shadow_type('in'); $frame->show(); my $table = Gtk2::Table->new(1+1,6,FALSE); # my $tag = Gtk2::TextTag->new(); # $tag->set_property('justification' => 'left'); # $table->add($tag); my $name_l = Gtk2::Label->new("Package :"); $table->attach($name_l,0,1,0,1, 'fill', 'shrink', 0, 0); $name_l->show(); $GUI_PACKAGE_NAME2 = Gtk2::Label->new("No package selected."); $table->attach($GUI_PACKAGE_NAME2,1,2,0,1, 'fill', 'shrink', 0, 0); $GUI_PACKAGE_NAME2->show(); my $size_l = Gtk2::Label->new("Package size :"); $table->attach($size_l,0,1,1,2, 'fill', 'shrink', 0, 0); $size_l->show(); $GUI_PACKAGE_SIZE2 = Gtk2::Label->new(""); $table->attach($GUI_PACKAGE_SIZE2,1,2,1,2, 'fill', 'shrink', 0, 0); $GUI_PACKAGE_SIZE2->show(); my $tsize_l = Gtk2::Label->new("Extra data size :"); $table->attach($tsize_l,0,1,3,4, 'fill', 'shrink', 0, 0); $tsize_l->show(); $GUI_PACKAGE_TSIZE = Gtk2::Label->new(""); $table->attach($GUI_PACKAGE_TSIZE,1,2,3,4, 'fill', 'shrink', 0, 0); $GUI_PACKAGE_TSIZE->show(); my $status_l = Gtk2::Label->new("Status :"); $table->attach($status_l,0,1,4,5, 'fill', 'shrink', 0, 0); $status_l->show(); $GUI_PACKAGE_STATUS2 = Gtk2::Label->new(""); $table->attach($GUI_PACKAGE_STATUS2,1,2,4,5, 'fill', 'shrink', 0, 0); $GUI_PACKAGE_STATUS2->show(); $GUI_PACKAGE_MANAGECOMBO = Gtk2::ComboBox->new_text; $GUI_PACKAGE_MANAGECOMBO->append_text("Keep in current state"); $GUI_PACKAGE_MANAGECOMBO->set_active(0); $table->attach($GUI_PACKAGE_MANAGECOMBO,0,2,5,6, 'fill', 'shrink', 0, 0); $GUI_PACKAGE_MANAGECOMBO->show(); $GUI_PACKAGE_MANAGECOMBO_NUMBER++; $GUI_PACKAGE_MANAGECOMBO->signal_connect("changed", \&package_management) ; $frame->add($table); $table->show(); $frame->show(); $parent->append_page($frame, "Management"); } sub nice_bytes { my $b = shift; my $u = 0; my @u = ('b.', 'kb.', 'Mb.'); if (! $b) { return("0b."); } while ($b>1024) { if ($u>=2) { last; } $b/=1024.0; $u++; } return(sprintf("%0.2f", $b) . "$u[$u]"); } sub package_update { my $widget = shift; my $selected; my $package; my $txt = ""; my $status; if (defined($widget)) { $selected=$widget->get_selected_rows(); if (!defined($selected)) { $package=$PACKAGES[0]; } else { $package=$PACKAGES[$selected->to_string]; } $SELECTED_PACKAGE=$package; } else { $package=$SELECTED_PACKAGE; } $txt=$package->packageComments(); my $buf = Gtk2::TextBuffer->new(); $buf->set_text($txt); $GUI_PACKAGE_NAME->set_text($package->packageName()); $GUI_PACKAGE_NAME2->set_text($package->packageName()); $GUI_PACKAGE_VERSION->set_text($package->packageVersion()); $GUI_PACKAGE_SIZE->set_text(nice_bytes($package->packageSize())); $GUI_PACKAGE_SIZE2->set_text(nice_bytes($package->packageSize())); $GUI_PACKAGE_HOMEPAGE->set_text($package->homePage()); $GUI_PACKAGE_LANGUAGE->set_text($package->language()); $GUI_PACKAGE_AUTHOR->set_text($package->author()); $GUI_PACKAGE_LICENSE->set_text($package->license()); $GUI_PACKAGE_DESCRIPTION->set_buffer($buf); $GUI_PACKAGE_TSIZE->set_text(nice_bytes($package->benchmarkSize()-$package->packageSize())); $status=$package->getStatus(); $GUI_PACKAGE_STATUS->set_text($CBM_STATUS{$status}); $GUI_PACKAGE_STATUS2->set_text($CBM_STATUS{$status}); while ($GUI_PACKAGE_MANAGECOMBO_NUMBER--) { $GUI_PACKAGE_MANAGECOMBO->remove_text(0); } $GUI_PACKAGE_MANAGECOMBO_NUMBER=0; $GUI_PACKAGE_MANAGECOMBO->append_text("Keep in current state"); $GUI_PACKAGE_MANAGECOMBO_NUMBER++; if ($status>=$CBM_STATUS_DOWNLOADED) { $GUI_PACKAGE_MANAGECOMBO->append_text("Uninstall"); $GUI_PACKAGE_MANAGECOMBO_NUMBER++; } if ($status < $CBM_STATUS_PRECONFIGURED) { if (defined($package->downloadURL()) && ($package->downloadURL() ne '')) { $GUI_PACKAGE_MANAGECOMBO->append_text("Install"); $GUI_PACKAGE_MANAGECOMBO_NUMBER++; } $GUI_PACKAGE_MANAGECOMBO->append_text("Install from a local archive"); $GUI_PACKAGE_MANAGECOMBO_NUMBER++; } $GUI_PACKAGE_MANAGECOMBO->show(); $GUI_PACKAGE_MANAGECOMBO->set_active(0); } sub package_management_common_install { gui_status_update('install-extract'); $SELECTED_PACKAGE->Extract(); gui_status_update('install-patch'); $SELECTED_PACKAGE->Patch(); gui_status_update('install-preconfigure'); $SELECTED_PACKAGE->PreConfigure(); gui_status_update('idle'); package_update(undef); } sub package_management { my $widget = shift; my $action = $widget->get_active_text(); my $do_common_install = 0; my $status_old = $SELECTED_PACKAGE->getStatus(); if ($action eq 'Uninstall') { gui_status_update('uninstall'); $SELECTED_PACKAGE->Uninstall(); gui_status_update('idle'); package_update(undef); } elsif ($action eq 'Install') { gui_status_update('install-resetcontext'); $SELECTED_PACKAGE->resetContext(); gui_status_update('install-download'); $SELECTED_PACKAGE->Download(); $do_common_install=1; } elsif ($action eq 'Install from a local archive') { my $file_dialog = Gtk2::FileSelection->new("Please select archive for " . $SELECTED_PACKAGE->packageName()) ; $file_dialog->signal_connect('destroy', \&package_archive_dialog_destroy, $file_dialog); $file_dialog->ok_button->signal_connect('clicked', \&package_archive_selected, $file_dialog ); $file_dialog->cancel_button->signal_connect('clicked', \&package_archive_dialog_destroy, $file_dialog); $file_dialog->show(); } if ($do_common_install) { package_management_common_install(); } if ($SELECTED_PACKAGE->getStatus()!=$status_old) { benchmarks_update(); benchmark_update_info(); } } sub benchmarks_update { my $p; my $first = 1; @BENCHMARKS=(); $GUI_BENCHMARK_TREE->clear(); foreach $p (@PACKAGES) { if ($p->getStatus()<$CBM_STATUS_PRECONFIGURED) { next; } my $n = $p->benchmarkNumber(); my $i; for($i=0; $i<$n; $i++) { push(@BENCHMARKS, $p->Benchmark($i)); } } my $b; foreach $b (@BENCHMARKS) { my $bn = $b->benchmarkName(); my $iter = $GUI_BENCHMARK_TREE->append(undef); $GUI_BENCHMARK_TREE->set ($iter,0, "$bn"); if ($first) { $BENCHMARK_FIRST=$iter; } $first=0; } } sub benchmark_update_info { my $widget = shift; my $selected; my $benchmark; my $txt = ""; my $status; if (defined($widget)) { $selected=$widget->get_selected_rows(); if (!defined($selected)) { $benchmark=$BENCHMARKS[0]; } else { $benchmark=$BENCHMARKS[$selected->to_string]; } $SELECTED_BENCHMARK=$benchmark; } else { return; # $benchmark=$SELECTED_BENCHMARK; } if (!defined($benchmark)) { $GUI_BENCHMARK_NAME->set_text("No benchmark selected."); my $buf = Gtk2::TextBuffer->new(); $buf->set_text(""); $GUI_PACKAGE_DESCRIPTION->set_buffer($buf); return; } $GUI_BENCHMARK_NAME->set_text($benchmark->benchmarkName()); my $buf = Gtk2::TextBuffer->new(); $txt=$benchmark->benchmarkComments(); $buf->set_text($txt); $GUI_BENCHMARK_DESCRIPTION->set_buffer($buf); } sub package_archive_selected { my ( $widget, $file_selection ) = @_ ; my $file = $file_selection->get_filename() ; my $status_old = $SELECTED_PACKAGE->getStatus(); package_archive_dialog_destroy(undef, $file_selection); gui_status_update('install-resetcontext'); $SELECTED_PACKAGE->resetContext(); gui_status_update('install-fetch'); $SELECTED_PACKAGE->Fetch($file); package_management_common_install(); if ($SELECTED_PACKAGE->getStatus()!=$status_old) { benchmarks_update(); benchmark_update_info(); } } sub package_archive_dialog_destroy { my $window = shift; my $widget = shift; $widget->destroy(); package_update(undef); } sub main_widget { my $window = shift; my $main_table = Gtk2::Table->new(1,2,FALSE); $GUI_MAINWINDOW_EBOX = Gtk2::EventBox->new; $GUI_STATUS_LABEL = Gtk2::Label->new(""); $GUI_STATUS_PROGRESS = Gtk2::ProgressBar->new(); $GUI_MAINNOTEBOOK = Gtk2::Notebook->new(); $main_table->attach_defaults($GUI_MAINNOTEBOOK,0,1,0,1); my $table = Gtk2::Table->new(1,2,FALSE); $GUI_MAINWINDOW_EBOX->add($main_table); $window->add($GUI_MAINWINDOW_EBOX); $GUI_MAINWINDOW_EBOX->realize(); $GUI_MAINNOTEBOOK->append_page($table, "Package"); my $bottom = Gtk2::Frame->new(); $bottom->set_border_width(5); $bottom->set_shadow_type('in'); $bottom->show(); $main_table->attach_defaults($bottom, 0, 1, 1, 2); my $status_t = Gtk2::Table->new(2,1,FALSE); $bottom->add($status_t); $status_t->show(); $status_t->attach_defaults($GUI_STATUS_LABEL, 0, 1, 0, 1); $GUI_STATUS_LABEL->show(); $status_t->attach_defaults($GUI_STATUS_PROGRESS, 1, 2, 0, 1); $GUI_STATUS_PROGRESS->hide(); return($table); } sub benchmarks_frame { my $parent = shift; my $frame = Gtk2::Frame->new("Benchmarks"); my $table_main = Gtk2::Table->new(1+1,1,FALSE); my $sw = Gtk2::ScrolledWindow->new (undef, undef); $sw->set_shadow_type ('etched-out'); $sw->set_policy ('automatic', 'automatic'); $sw->set_size_request (50, 50); $sw->set_border_width(5); $GUI_BENCHMARK_TREE = Gtk2::TreeStore->new(qw/Glib::String/); $GUI_MAINNOTEBOOK->append_page($frame, "Benchmarks' selection"); $GUI_BENCHMARK_SELECTOR = Gtk2::TreeView->new($GUI_BENCHMARK_TREE); my $select = $GUI_BENCHMARK_SELECTOR->get_selection(); $select->signal_connect("changed", \&benchmark_update_info); my $tree_column = Gtk2::TreeViewColumn->new(); $tree_column->set_title("Benchmark"); benchmarks_update(); # $select->signal_connect("changed", \&package_update) ; my $renderer = Gtk2::CellRendererText->new(); $tree_column->pack_start ($renderer, FALSE); $tree_column->add_attribute($renderer, text => 0); $GUI_BENCHMARK_SELECTOR->append_column ($tree_column); # $GUI_BENCHMARK_SELECTOR->set_search_column(0); # $tree_column->set_sort_column_id(0); $GUI_BENCHMARK_SELECTOR->set_reorderable(FALSE); $GUI_BENCHMARK_SELECTOR->show(); $frame->show(); # $table->add($frame); $table_main->attach_defaults($sw, 0, 1, 0, 1); $sw->show(); $sw->add($GUI_BENCHMARK_SELECTOR); $frame->add($table_main); $table_main->show(); my $table = Gtk2::Table->new(1+1,3,FALSE); my $sw_d = Gtk2::ScrolledWindow->new (undef, undef); $sw_d->set_shadow_type ('etched-out'); $sw_d->set_policy ('automatic', 'automatic'); $sw_d->set_size_request (50, 50); $sw_d->set_border_width(5); my $name_l = Gtk2::Label->new("Benchmark :"); $table->attach_defaults($name_l,0,1,0,1); $name_l->show(); $GUI_BENCHMARK_NAME = Gtk2::Label->new("No benchmark selected."); $table->attach_defaults($GUI_BENCHMARK_NAME,1,2,0,1); $GUI_BENCHMARK_NAME->show(); my $desc_l = Gtk2::Label->new("Description :"); $table->attach_defaults($desc_l,0,1,1,2); $desc_l->show(); my $buf = Gtk2::TextBuffer->new(); $buf->set_text(""); $GUI_BENCHMARK_DESCRIPTION = Gtk2::TextView->new_with_buffer($buf); $GUI_BENCHMARK_DESCRIPTION->set_wrap_mode('word'); $GUI_BENCHMARK_DESCRIPTION->set_editable(FALSE); $sw_d->show(); $sw_d->add($GUI_BENCHMARK_DESCRIPTION); $GUI_BENCHMARK_DESCRIPTION->show(); $table->attach_defaults($sw_d,1,2,1,2); $table_main->attach_defaults($table, 1, 2, 0, 1); # package_description_tab($nb); # package_management_tab($nb); } sub Destroy_Window { Gtk2->main_quit; $CBM->done(); return FALSE; } $GUI_MAINWINDOW = Gtk2::Window->new('toplevel'); $GUI_MAINWINDOW->set_title("CompBenchmarks $VERSION"); $GUI_MAINWINDOW->signal_connect("destroy", \&Destroy_Window ) ; my $mw = main_widget($GUI_MAINWINDOW); $mw->set_border_width(5); # $ebox->show(); supported_packages_frame($mw); benchmarks_frame($mw); $GUI_MAINWINDOW->show_all() ; gui_status_update('idle'); $GUI_PACKAGE_SELECTOR->get_selection()->select_iter($PACKAGE_FIRST); if (defined($BENCHMARK_FIRST)) { $GUI_BENCHMARK_SELECTOR->get_selection()->select_iter($BENCHMARK_FIRST); } Gtk2->main ; |
From: Frederic T. <xf...@us...> - 2007-01-15 20:44:10
|
Update of /cvsroot/compbench/CompBenchmarks++/CBM-PI In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv18420 Modified Files: CBM.pm CBM_wrap.cxx Log Message: Improvements for CBMPackage and new related API usage. hasPatch() is now public. Index: CBM.pm =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/CBM-PI/CBM.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CBM.pm 10 Jan 2007 20:27:00 -0000 1.5 --- CBM.pm 15 Jan 2007 20:44:06 -0000 1.6 *************** *** 71,74 **** --- 71,76 ---- *Package = *CBMc::CBMSystem_Package; *Benchmark = *CBMc::CBMSystem_Benchmark; + *displayAllPackages = *CBMc::CBMSystem_displayAllPackages; + *displayAllBenchmarks = *CBMc::CBMSystem_displayAllBenchmarks; *Split = *CBMc::CBMSystem_Split; *Chomp = *CBMc::CBMSystem_Chomp; *************** *** 201,206 **** --- 203,210 ---- *Tested = *CBMc::CBMPackage_Tested; *Benchmarked = *CBMc::CBMPackage_Benchmarked; + *hasPatch = *CBMc::CBMPackage_hasPatch; *resetContext = *CBMc::CBMPackage_resetContext; *display = *CBMc::CBMPackage_display; + *displayBenchmarks = *CBMc::CBMPackage_displayBenchmarks; *System = *CBMc::CBMPackage_System; *Benchmarks = *CBMc::CBMPackage_Benchmarks; Index: CBM_wrap.cxx =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/CBM-PI/CBM_wrap.cxx,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CBM_wrap.cxx 10 Jan 2007 20:27:00 -0000 1.5 --- CBM_wrap.cxx 15 Jan 2007 20:44:06 -0000 1.6 *************** *** 2393,2396 **** --- 2393,2452 ---- + XS(_wrap_CBMSystem_displayAllPackages) { + { + CBMSystem *arg1 = (CBMSystem *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: CBMSystem_displayAllPackages(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBMSystem, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CBMSystem_displayAllPackages" "', argument " "1"" of type '" "CBMSystem *""'"); + } + arg1 = reinterpret_cast<CBMSystem * >(argp1); + (arg1)->displayAllPackages(); + + + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } + } + + + XS(_wrap_CBMSystem_displayAllBenchmarks) { + { + CBMSystem *arg1 = (CBMSystem *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: CBMSystem_displayAllBenchmarks(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBMSystem, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CBMSystem_displayAllBenchmarks" "', argument " "1"" of type '" "CBMSystem *""'"); + } + arg1 = reinterpret_cast<CBMSystem * >(argp1); + (arg1)->displayAllBenchmarks(); + + + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } + } + + XS(_wrap_CBMSystem_Split) { { *************** *** 3733,3736 **** --- 3789,3821 ---- + XS(_wrap_CBMPackage_hasPatch) { + { + CBMPackage *arg1 = (CBMPackage *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: CBMPackage_hasPatch(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBMPackage, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CBMPackage_hasPatch" "', argument " "1"" of type '" "CBMPackage *""'"); + } + arg1 = reinterpret_cast<CBMPackage * >(argp1); + result = (int)(arg1)->hasPatch(); + + ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast<int >(result)); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } + } + + XS(_wrap_CBMPackage_resetContext) { { *************** *** 3790,3793 **** --- 3875,3906 ---- + XS(_wrap_CBMPackage_displayBenchmarks) { + { + CBMPackage *arg1 = (CBMPackage *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: CBMPackage_displayBenchmarks(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CBMPackage, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CBMPackage_displayBenchmarks" "', argument " "1"" of type '" "CBMPackage *""'"); + } + arg1 = reinterpret_cast<CBMPackage * >(argp1); + (arg1)->displayBenchmarks(); + + + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } + } + + XS(_wrap_CBMPackage_System) { { *************** *** 6532,6535 **** --- 6645,6650 ---- {"CBMc::CBMSystem_Package", _wrap_CBMSystem_Package}, {"CBMc::CBMSystem_Benchmark", _wrap_CBMSystem_Benchmark}, + {"CBMc::CBMSystem_displayAllPackages", _wrap_CBMSystem_displayAllPackages}, + {"CBMc::CBMSystem_displayAllBenchmarks", _wrap_CBMSystem_displayAllBenchmarks}, {"CBMc::CBMSystem_Split", _wrap_CBMSystem_Split}, {"CBMc::CBMSystem_Chomp", _wrap_CBMSystem_Chomp}, *************** *** 6568,6573 **** --- 6683,6690 ---- {"CBMc::CBMSystemLinux_processor_number", _wrap_CBMSystemLinux_processor_number}, {"CBMc::delete_CBMSystemLinux", _wrap_delete_CBMSystemLinux}, + {"CBMc::CBMPackage_hasPatch", _wrap_CBMPackage_hasPatch}, {"CBMc::CBMPackage_resetContext", _wrap_CBMPackage_resetContext}, {"CBMc::CBMPackage_display", _wrap_CBMPackage_display}, + {"CBMc::CBMPackage_displayBenchmarks", _wrap_CBMPackage_displayBenchmarks}, {"CBMc::CBMPackage_System", _wrap_CBMPackage_System}, {"CBMc::CBMPackage_Benchmarks", _wrap_CBMPackage_Benchmarks}, |
From: Frederic T. <xf...@us...> - 2007-01-15 20:42:23
|
Update of /cvsroot/compbench/CompBenchmarks++/Benchmark In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17955 Modified Files: Package.h Log Message: Improvements for CBMPackage and new related API usage. hasPatch() is now public. Index: Package.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Package.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Package.h 15 Jan 2007 17:52:11 -0000 1.5 --- Package.h 15 Jan 2007 20:42:20 -0000 1.6 *************** *** 91,102 **** virtual int extract(int _force = 0) = 0; - /** 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); - /** Method to patch package * Must be overloaded to patch package. --- 91,94 ---- *************** *** 164,167 **** --- 156,167 ---- 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() |
From: Frederic T. <xf...@us...> - 2007-01-15 20:39:48
|
Update of /cvsroot/compbench/CompBenchmarks++/CBM-PI/t In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv16756 Modified Files: 02-CBMSystem-benchs.pl Log Message: benchmarkSize() and hasTest() tested. Index: 02-CBMSystem-benchs.pl =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/CBM-PI/t/02-CBMSystem-benchs.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** 02-CBMSystem-benchs.pl 4 Jan 2007 19:46:23 -0000 1.1 --- 02-CBMSystem-benchs.pl 15 Jan 2007 20:39:42 -0000 1.2 *************** *** 10,14 **** my @benchmarks = `cat $top_srcdir/../../SupportedBenchmarks/benchmarks.list | grep -v '^#' | cut -f1 -d':'`; chomp(@benchmarks); ! plan tests => (@benchmarks+0)*53; my $sys; --- 10,14 ---- my @benchmarks = `cat $top_srcdir/../../SupportedBenchmarks/benchmarks.list | grep -v '^#' | cut -f1 -d':'`; chomp(@benchmarks); ! plan tests => ((@benchmarks+0)*59)+1; my $sys; *************** *** 51,54 **** --- 51,58 ---- check_simple($p->localPackageName()); + my $siz_b = $p->benchmarkSize(); + check_simple($siz_b); + ok($siz_b > 0); + my $bn = $b->benchmarkName(); *************** *** 70,73 **** --- 74,80 ---- my $hast = $p->hasTest(); ok( ($hast==0) || ($hast==1) ); + + my $p = $p->hasPatch(); + ok( ($p == 0) || ($p == 1), "hasPatch() returns 0 or 1"); } |
From: Frederic T. <xf...@us...> - 2007-01-15 20:09:21
|
Update of /cvsroot/compbench/CompBenchmarks++/Benchmark In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv4595 Modified Files: Benchmark.h Log Message: Fixes for CBMPackage and new related API usage. Index: Benchmark.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Benchmark.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Benchmark.h 4 Jan 2007 19:39:52 -0000 1.15 --- Benchmark.h 15 Jan 2007 20:09:09 -0000 1.16 *************** *** 79,83 **** #define DLPackageWrapper_declare() \ virtual BenchmarkVector& Benchmarks(void); \ ! virtual CBMBenchmark *Benchmark(std::string bid) #endif --- 79,84 ---- #define DLPackageWrapper_declare() \ virtual BenchmarkVector& Benchmarks(void); \ ! virtual CBMBenchmark *Benchmark(std::string bid); \ ! virtual int benchmarkNumber(void) #endif |
From: Frederic T. <xf...@us...> - 2007-01-15 20:08:42
|
Update of /cvsroot/compbench/CompBenchmarks++/Benchmark In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv4146 Modified Files: Package.cpp Log Message: Minor optimisation. Fix : Benchmarks() is always called before dependend methods. Index: Package.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Package.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Package.cpp 15 Jan 2007 17:53:14 -0000 1.5 --- Package.cpp 15 Jan 2007 20:08:37 -0000 1.6 *************** *** 30,33 **** --- 30,34 ---- int CBMPackage::benchmarkNumber(void) { + Benchmarks(); return(benchmarks.size()); } *************** *** 35,38 **** --- 36,40 ---- CBMBenchmark *CBMPackage::Benchmark(int i) { + Benchmarks(); return(Benchmark(benchmarks[i])); } *************** *** 644,652 **** std::string localFile = localPackageAbsoluteName(); ! if (status==Unknown) { readStatus(); ! return(status); ! } else ! return(status); } --- 646,653 ---- std::string localFile = localPackageAbsoluteName(); ! if (status==Unknown) readStatus(); ! ! return(status); } |
From: Frederic T. <xf...@us...> - 2007-01-15 20:07:37
|
Update of /cvsroot/compbench/CompBenchmarks++/SupportedBenchmarks In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv3516 Modified Files: Benchmark-BENCHPP.libwrapper.h Benchmark-BENCHPPLINUX.libwrapper.h Benchmark-BZIP2.libwrapper.h Benchmark-GZIP.libwrapper.h Benchmark-LINPACKC.cpp Benchmark-LINPACKC.libwrapper.h Benchmark-NBENCH.libwrapper.h Benchmark-SCIMARK2.libwrapper.h benchmarks-genlibwrapper.pl Log Message: Fixes for CBMPackage and new related API usage. Index: Benchmark-NBENCH.libwrapper.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/SupportedBenchmarks/Benchmark-NBENCH.libwrapper.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Benchmark-NBENCH.libwrapper.h 3 Jan 2007 22:06:27 -0000 1.2 --- Benchmark-NBENCH.libwrapper.h 15 Jan 2007 20:07:21 -0000 1.3 *************** *** 2,5 **** --- 2,9 ---- #include <UI/UI.h> + int CBMPackageNBENCH::benchmarkNumber(void) { + return(10); + } + BenchmarkVector& CBMPackageNBENCH::Benchmarks(void) { if (benchmarks.size()) return(benchmarks); Index: Benchmark-GZIP.libwrapper.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/SupportedBenchmarks/Benchmark-GZIP.libwrapper.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Benchmark-GZIP.libwrapper.h 3 Jan 2007 22:06:27 -0000 1.2 --- Benchmark-GZIP.libwrapper.h 15 Jan 2007 20:07:20 -0000 1.3 *************** *** 2,5 **** --- 2,9 ---- #include <UI/UI.h> + int CBMPackageGZIP::benchmarkNumber(void) { + return(2); + } + BenchmarkVector& CBMPackageGZIP::Benchmarks(void) { if (benchmarks.size()) return(benchmarks); Index: benchmarks-genlibwrapper.pl =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/SupportedBenchmarks/benchmarks-genlibwrapper.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** benchmarks-genlibwrapper.pl 3 Jan 2007 22:04:18 -0000 1.1 --- benchmarks-genlibwrapper.pl 15 Jan 2007 20:07:21 -0000 1.2 *************** *** 32,35 **** --- 32,41 ---- print "#include <UI/UI.h>\n\n"; + my $n = (keys %{$DATA{$PACKAGE}})+0; + + + print "int CBMPackage$PACKAGE\::benchmarkNumber(void) {\n"; + print " return($n);\n}\n\n"; + print "BenchmarkVector& CBMPackage$PACKAGE\::Benchmarks(void) {\n"; print " if (benchmarks.size()) return(benchmarks);\n"; Index: Benchmark-BZIP2.libwrapper.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/SupportedBenchmarks/Benchmark-BZIP2.libwrapper.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Benchmark-BZIP2.libwrapper.h 3 Jan 2007 22:06:26 -0000 1.2 --- Benchmark-BZIP2.libwrapper.h 15 Jan 2007 20:07:20 -0000 1.3 *************** *** 2,5 **** --- 2,9 ---- #include <UI/UI.h> + int CBMPackageBZIP2::benchmarkNumber(void) { + return(2); + } + BenchmarkVector& CBMPackageBZIP2::Benchmarks(void) { if (benchmarks.size()) return(benchmarks); Index: Benchmark-BENCHPP.libwrapper.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/SupportedBenchmarks/Benchmark-BENCHPP.libwrapper.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Benchmark-BENCHPP.libwrapper.h 3 Jan 2007 22:06:26 -0000 1.2 --- Benchmark-BENCHPP.libwrapper.h 15 Jan 2007 20:07:20 -0000 1.3 *************** *** 2,5 **** --- 2,9 ---- #include <UI/UI.h> + int CBMPackageBENCHPP::benchmarkNumber(void) { + return(3); + } + BenchmarkVector& CBMPackageBENCHPP::Benchmarks(void) { if (benchmarks.size()) return(benchmarks); Index: Benchmark-LINPACKC.libwrapper.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/SupportedBenchmarks/Benchmark-LINPACKC.libwrapper.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Benchmark-LINPACKC.libwrapper.h 11 Jan 2007 19:57:14 -0000 1.3 --- Benchmark-LINPACKC.libwrapper.h 15 Jan 2007 20:07:20 -0000 1.4 *************** *** 2,5 **** --- 2,9 ---- #include <UI/UI.h> + int CBMPackageLINPACKC::benchmarkNumber(void) { + return(4); + } + BenchmarkVector& CBMPackageLINPACKC::Benchmarks(void) { if (benchmarks.size()) return(benchmarks); Index: Benchmark-BENCHPPLINUX.libwrapper.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/SupportedBenchmarks/Benchmark-BENCHPPLINUX.libwrapper.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Benchmark-BENCHPPLINUX.libwrapper.h 3 Jan 2007 22:06:26 -0000 1.2 --- Benchmark-BENCHPPLINUX.libwrapper.h 15 Jan 2007 20:07:20 -0000 1.3 *************** *** 2,5 **** --- 2,9 ---- #include <UI/UI.h> + int CBMPackageBENCHPPLINUX::benchmarkNumber(void) { + return(35); + } + BenchmarkVector& CBMPackageBENCHPPLINUX::Benchmarks(void) { if (benchmarks.size()) return(benchmarks); Index: Benchmark-LINPACKC.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/SupportedBenchmarks/Benchmark-LINPACKC.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Benchmark-LINPACKC.cpp 11 Jan 2007 20:33:29 -0000 1.6 --- Benchmark-LINPACKC.cpp 15 Jan 2007 20:07:20 -0000 1.7 *************** *** 39,43 **** std::string CBMPackageLINPACKC::packageComments(void) { ! return("The former linpackc benchmark translated to C by Bonnie Toy has modified to suit compbenchmarks requirements."); } --- 39,43 ---- std::string CBMPackageLINPACKC::packageComments(void) { ! return("This is the former linpackc benchmark translated to C by Bonnie Toy, which has been modified to suit compbenchmarks requirements."); } Index: Benchmark-SCIMARK2.libwrapper.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/SupportedBenchmarks/Benchmark-SCIMARK2.libwrapper.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Benchmark-SCIMARK2.libwrapper.h 3 Jan 2007 22:06:27 -0000 1.2 --- Benchmark-SCIMARK2.libwrapper.h 15 Jan 2007 20:07:21 -0000 1.3 *************** *** 2,5 **** --- 2,9 ---- #include <UI/UI.h> + int CBMPackageSCIMARK2::benchmarkNumber(void) { + return(5); + } + BenchmarkVector& CBMPackageSCIMARK2::Benchmarks(void) { if (benchmarks.size()) return(benchmarks); |
From: Frederic T. <xf...@us...> - 2007-01-15 18:58:13
|
Update of /cvsroot/compbench/CompBenchmarks++ In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv7302 Modified Files: main.h Log Message: Updated doxygen documentation. Index: main.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/main.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** main.h 21 Dec 2006 18:38:18 -0000 1.6 --- main.h 15 Jan 2007 18:58:05 -0000 1.7 *************** *** 20,30 **** * who like to get an overview about how things are done. * * \section abstraction General organisation * * CompBenchmarks suite has been (re)written in C++, to add more flexibility. ! * Its core rely on a few abstracts (as in C++) definitions : * - \link CBMSystem operating system\endlink, ! * - \link CBMBenchmark benchmark\endlink or packages, ! * - \link CBMCompiler compiler\endlink, * - \link CBMUI user interface\endlink. * --- 20,34 ---- * who like to get an overview about how things are done. * + * New releases and complementory information can be found at + * http://compbench.sourceforge.net. + * * \section abstraction General organisation * * CompBenchmarks suite has been (re)written in C++, to add more flexibility. ! * Its core rely on a few abstracts (as in C++) definitions (concepts) : * - \link CBMSystem operating system\endlink, ! * - \link CBMPackage package\endlink, ! * - \link CBMBenchmark benchmark\endlink, ! * - \link CBMCompiler compiler\endlink and \link CBMCompilerOptions compilation options\endlink, * - \link CBMUI user interface\endlink. * *************** *** 33,39 **** * Only one user interface, compbenchmarks-ui-perl as been coded for actual * needs, and it uses the compbenchmarks-core program. ! * Many benchmarks have been derivated from base benchmark object; ! * each benchmark can use compilers and options instances (e.g. through ! * the operating system object). * * \section behaviour Behaviour --- 37,41 ---- * Only one user interface, compbenchmarks-ui-perl as been coded for actual * needs, and it uses the compbenchmarks-core program. ! * Many benchmarks have been derivated from base benchmark and package classes. * * \section behaviour Behaviour *************** *** 48,52 **** * * To start a new benchmark or package implementation, you can ! * - download the sources (http://compbench.sf.net), * - take a quick look at \link CBMBenchmark CBMBenchmark\endlink class. * - for, said, Foo_benchpack.tar.gz package, create the Benchmark-FOO-BENCHPACK.cpp and corresponding header files in Benchmark directory, --- 50,54 ---- * * To start a new benchmark or package implementation, you can ! * - download the sources (http://compbench.sourceforge.net), * - take a quick look at \link CBMBenchmark CBMBenchmark\endlink class. * - for, said, Foo_benchpack.tar.gz package, create the Benchmark-FOO-BENCHPACK.cpp and corresponding header files in Benchmark directory, |
From: Frederic T. <xf...@us...> - 2007-01-15 17:59:20
|
Update of /cvsroot/compbench/CompBenchmarks++/System In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv2843 Modified Files: System.h Log Message: Updated doxygen documentation. Index: System.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/System/System.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** System.h 15 Jan 2007 17:50:13 -0000 1.19 --- System.h 15 Jan 2007 17:59:14 -0000 1.20 *************** *** 148,152 **** /** Get a package acoording to its internal identifier ! * \param std::string containing the package's identifier * \return CBMPackage instance * \sa packageList() --- 148,152 ---- /** Get a package acoording to its internal identifier ! * \param pid std::string containing the package's identifier * \return CBMPackage instance * \sa packageList() |
From: Frederic T. <xf...@us...> - 2007-01-15 17:53:18
|
Update of /cvsroot/compbench/CompBenchmarks++/Benchmark In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv461 Modified Files: Package.cpp Log Message: Displaying methods refactored. Index: Package.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Package.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Package.cpp 10 Jan 2007 20:26:34 -0000 1.4 --- Package.cpp 15 Jan 2007 17:53:14 -0000 1.5 *************** *** 56,59 **** --- 56,72 ---- } + void CBMPackage::displayBenchmarks(void) + { + int i; + int n; + CBMBenchmark *B; + + n=benchmarkNumber(); + for(i=0; i<n; i++) { + B=Benchmark(i); + B->display(); + } + } + CBMSystem *CBMPackage::System(void) { |
From: Frederic T. <xf...@us...> - 2007-01-15 17:52:22
|
Update of /cvsroot/compbench/CompBenchmarks++/Benchmark In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv32480 Modified Files: Package.h Log Message: Updated doxygen documentation. Index: Package.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Package.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Package.h 10 Jan 2007 20:26:06 -0000 1.4 --- Package.h 15 Jan 2007 17:52:11 -0000 1.5 *************** *** 172,175 **** --- 172,178 ---- virtual void display(void); + /** Display informations about all supported benchmarks */ + virtual void displayBenchmarks(void); + /** Get system abstraction object \return CBMSystem |
From: Frederic T. <xf...@us...> - 2007-01-15 17:51:33
|
Update of /cvsroot/compbench/CompBenchmarks++/System In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv31721 Modified Files: System.cpp Log Message: displayAllBenchmarks() has been simplified. Index: System.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/System/System.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** System.cpp 15 Jan 2007 17:39:32 -0000 1.19 --- System.cpp 15 Jan 2007 17:51:28 -0000 1.20 *************** *** 236,251 **** int i; int n = packageNumber(); - int j; - int m; CBMPackage *P; - CBMBenchmark *B; for(i=0; i<n; i++) { P=Package(i); ! m=P->benchmarkNumber(); ! for(j=0; j<m; j++) { ! B=P->Benchmark(i); ! B->display(); ! } } } --- 236,245 ---- int i; int n = packageNumber(); CBMPackage *P; for(i=0; i<n; i++) { P=Package(i); ! P->display(); ! P->displayBenchmarks(); } } |
From: Frederic T. <xf...@us...> - 2007-01-15 17:50:18
|
Update of /cvsroot/compbench/CompBenchmarks++/System In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv31440 Modified Files: System.h Log Message: Updated doxygen documentation. Index: System.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/System/System.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** System.h 15 Jan 2007 17:39:32 -0000 1.18 --- System.h 15 Jan 2007 17:50:13 -0000 1.19 *************** *** 132,145 **** /** Give a list containing the compatible benchmarks * in declared directories. ! * \return a std::string list of benchmarks (id) */ virtual PackageVector& packageList(int _force = 0); virtual int packageNumber(void); virtual class CBMPackage *Package(int index); virtual class CBMPackage *Package(std::string pid); virtual class CBMBenchmark *Benchmark(std::string bid); virtual void displayAllPackages(void); virtual void displayAllBenchmarks(void); --- 132,168 ---- /** Give a list containing the compatible benchmarks * in declared directories. ! * \return a std::string list of benchmarks (id) ! * \sa Package() */ virtual PackageVector& packageList(int _force = 0); + /** Get supported packages' number + * \return integer + * \sa Package() */ virtual int packageNumber(void); + + /** Get a package according to its index + * \return CBMPackage instance + * \sa packageNumber() + */ virtual class CBMPackage *Package(int index); + /** Get a package acoording to its internal identifier + * \param std::string containing the package's identifier + * \return CBMPackage instance + * \sa packageList() + */ virtual class CBMPackage *Package(std::string pid); + + /** Get a benchmark according to its internal identifier + * \param bid std:string containing the benchmark's identifier + * \return CBMBenchmark instance */ virtual class CBMBenchmark *Benchmark(std::string bid); + /** Display informations about all packages + * Used by compbenchmarks-core */ virtual void displayAllPackages(void); + + /** Display informations about all benchmarks + * Used by compbenchmarks-core */ virtual void displayAllBenchmarks(void); |
From: Frederic T. <xf...@us...> - 2007-01-15 17:39:43
|
Update of /cvsroot/compbench/CompBenchmarks++/System In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv27307 Modified Files: System.cpp System.h Log Message: Internal methods to display all packages and benchmarks informations. Index: System.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/System/System.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** System.cpp 11 Jan 2007 20:34:56 -0000 1.18 --- System.cpp 15 Jan 2007 17:39:32 -0000 1.19 *************** *** 220,223 **** --- 220,254 ---- } + void CBMSystem::displayAllPackages(void) + { + int i; + int n = packageNumber(); + CBMPackage *P; + + for(i=0; i<n; i++) { + P=Package(i); + P->display(); + } + } + + void CBMSystem::displayAllBenchmarks(void) + { + int i; + int n = packageNumber(); + int j; + int m; + CBMPackage *P; + CBMBenchmark *B; + + for(i=0; i<n; i++) { + P=Package(i); + m=P->benchmarkNumber(); + for(j=0; j<m; j++) { + B=P->Benchmark(i); + B->display(); + } + } + } + std::string CBMSystem::Split(const std::string& str, const std::string& delim, unsigned int wantedIndex) { Index: System.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/System/System.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** System.h 10 Jan 2007 18:04:30 -0000 1.17 --- System.h 15 Jan 2007 17:39:32 -0000 1.18 *************** *** 141,144 **** --- 141,147 ---- virtual class CBMBenchmark *Benchmark(std::string bid); + virtual void displayAllPackages(void); + virtual void displayAllBenchmarks(void); + /** Split a std::string. * Split given string as sub-strings, according to an arbitrary delimiter. |