[Compbench-devel] CompBenchmarks++/CBM-PI/t 00-Glue.pl, NONE, 1.1 02-CBMBenchmarkSelector-public.pl
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2006-12-28 13:16:28
|
Update of /cvsroot/compbench/CompBenchmarks++/CBM-PI/t In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17508 Added Files: 00-Glue.pl 02-CBMBenchmarkSelector-public.pl Log Message: First import. --- NEW FILE: 00-Glue.pl --- #!/usr/bin/perl -w -I .. use strict; use CBM; use Test::Simple tests => 4; my $t0 = CBM::stringref(" test"); my $t1 = CBM::stringref(" test\n"); my $sys = CBM::Init(); ok(CBM::c_str($t0) eq " test"); ok(CBM::c_str($t1) eq " test\n"); $t1=$t0; ok(CBM::c_str($t0) eq " test"); ok(CBM::c_str($t1) eq " test"); $sys->done(); --- NEW FILE: 02-CBMBenchmarkSelector-public.pl --- #!/usr/bin/perl -w -I .. use strict; use CBM; use Test::More; my $top_srcdir = $0; $top_srcdir =~ s/(.+)\/.*/$1/; my @benchmarks = `cat $top_srcdir/../../Benchmark/benchmarks.list | grep -v '^#' | cut -f1 -d':'`; chomp(@benchmarks); plan tests => (@benchmarks+0)*5; my $sys; sub check_simple { my $str = shift; ok($str ne ""); if ($str =~ /\n/) { ok(0); } else { ok(1); } if ($str =~ /^ +(.*)/) { ok(0, "'$str' starts with space(s)"); } else { ok(1); } if ($str =~ / $/) { ok(0, "'$str' ends with space(s)"); } else { ok(1); } } $sys = CBM::Init(); my $BMS = CBM::CBMBenchmarkSelector->new($sys); my $b; foreach(@benchmarks) { $b = $BMS->select($_); ok(defined($b), "loading $_"); if (!defined($b)) { ok(0); ok(0); } my $s=$b->getStatus(); ok(defined($s), "status exists for $_"); ok(($s>=0) && ($s<=8), "valid status for $_ : '$s'"); my $pack = "$_"; $pack =~ s/^(.*?)-.+/$1/g; ok($pack eq $b->packageName(), "checking packageName() for $_"); } $sys->done(); |