Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/share/perl/CBM
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22189
Modified Files:
LibUI.pm
Log Message:
Interface to planned benchmarks and compilers.
Hash defining standard compilers.
Index: LibUI.pm
===================================================================
RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/share/perl/CBM/LibUI.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** LibUI.pm 30 Jan 2007 19:10:54 -0000 1.1
--- LibUI.pm 15 Feb 2007 19:01:36 -0000 1.2
***************
*** 18,21 ****
--- 18,35 ----
use vars qw($VERSION @ISA @EXPORT_OK);
+ our %DEFAULT_COMPILERS = ('C' =>
+ ['/usr/bin/gccx',
+ '/usr/bin/tcc',
+ 'gcc-2.95', 'gcc-2.96',
+ 'gcc-3.1', 'gcc-3.2', 'gcc-3.3',
+ 'gcc-3.4', 'gcc-4.0', 'gcc-4.1',
+ '/usr/local/bin/gcc',
+ '/usr/local/bin/tcc'],
+ 'C++' =>
+ ['/usr/bin/g++',
+ 'g++-2.95', 'g++-2.96',
+ 'g++-3.1', 'g++-3.2', 'g++-3.3',
+ 'g++-3.4', 'g++-4.0', 'g++-4.1',
+ '/usr/local/bin/g++']);
$VERSION="0.5.0";
***************
*** 130,133 ****
--- 144,199 ----
}
+ sub plannedBenchmarks {
+ my $self = shift;
+ my $P = Plan();
+
+ my $n = $P->benchmarkNumber();
+ my $i;
+ my @result;
+
+ for($i=0; $i<$n; $i++) {
+ push(@result, $P->getBenchmark($i));
+ }
+ return(@result);
+ }
+
+ sub plannedBenchmark {
+ my $self = shift;
+ my $b = shift;
+ my $P = Plan();
+
+ my $n = $P->benchmarkNumber();
+ my $i;
+
+ for($i=0; $i<$n; $i++) {
+ if ($P->getBenchmark($i)->Name() eq $b->Name()) {
+ return(1);
+ }
+ }
+
+ return(0);
+ }
+
+ sub bytes {
+ my $self = shift;
+ my $remains = shift;
+ my $tot = 0;
+
+ if ($remains>1024) {
+ $tot=$remains/1024.0;
+ $tot=sprintf("%0.2f", $tot);
+ if ($tot>1024.0) {
+ $tot=$tot/1024.0;
+ $tot=sprintf("%0.2f", $tot);
+ $tot.="Mb";
+ } else {
+ $tot.="Kb";
+ }
+ } else {
+ $tot="$remains" . "b";
+ }
+
+ return($tot);
+ }
sub DESTROY {
my $self = shift;
|