Update of /cvsroot/compbench/CompBenchmarks++/CBM-PI/t
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv2756
Modified Files:
05-Option-Descriptions.pl
Log Message:
New tests. Take care of compiler's versions.
Index: 05-Option-Descriptions.pl
===================================================================
RCS file: /cvsroot/compbench/CompBenchmarks++/CBM-PI/t/05-Option-Descriptions.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** 05-Option-Descriptions.pl 14 Mar 2007 19:44:50 -0000 1.2
--- 05-Option-Descriptions.pl 18 Mar 2007 21:46:19 -0000 1.3
***************
*** 19,28 ****
);
! my %OPTIONS = ('gxx' => \%OPTIONS_GXX,
! 'gcc' => \%OPTIONS_GCC,
! 'g++' => \%OPTIONS_GPP
);
! my @COMPILERS = ('gxx', 'gcc', 'g++');
use Test::More;
--- 19,28 ----
);
! my %OPTIONS = ('gxx-2.95.0' => \%OPTIONS_GXX,
! 'gcc-2.95.0' => \%OPTIONS_GCC,
! 'g++-2.95.0' => \%OPTIONS_GPP
);
! my @COMPILERS = ('gcc-2.95.0', 'gxx-2.95.0', 'gcc-2.95.0', 'g++-2.95.0');
use Test::More;
***************
*** 47,53 ****
sub test_options_compiler {
! my $compiler_id = shift;
! my $OD = new CBM::CompilerOptionDescriptions($compiler_id);
ok($OD, "descriptions' initialization works for $compiler_id");
--- 47,54 ----
sub test_options_compiler {
! my $compiler = shift;
! my ($compiler_id, $version) = split('-', $compiler);
! my $OD = new CBM::CompilerOptionDescriptions($compiler_id, $version);
ok($OD, "descriptions' initialization works for $compiler_id");
***************
*** 55,59 ****
$n=$OD->DescriptionNumber();
! ok($n eq $OPTIONS{$compiler_id}->{expect}, "$compiler_id: DescriptionNumber() returns $OPTIONS{$compiler_id}->{expect} (has $n)");
my $i;
--- 56,60 ----
$n=$OD->DescriptionNumber();
! ok($n eq $OPTIONS{$compiler}->{expect}, "$compiler: DescriptionNumber() returns $OPTIONS{$compiler}->{expect} (has $n)");
my $i;
***************
*** 65,85 ****
for($i=0; $i<$n; $i++) {
$D = $OD->Description($i);
! ok($D->Id() ne "", "$compiler_id: D$i has identifier");
$unique_id{$D->Id()}++;
ok($D->ShortDescription() ne "",
! "$compiler_id: D$i has short description");
ok($D->EditorDescription() ne "",
! "$compiler_id: D$i has editor's description");
ok($D->Option() ne "",
! "$compiler_id: D$i has option (value)");
$unique_id{$D->Option()}++;
}
foreach(keys %unique_id) {
! ok($unique_id{$_} == 1, "$compiler_id: option $_ is defined only once");
}
foreach(keys %unique_opt) {
! ok($unique_opt{$_} == 1, "$compiler_id: value $_ is defined only once");
}
}
--- 66,86 ----
for($i=0; $i<$n; $i++) {
$D = $OD->Description($i);
! ok($D->Id() ne "", "$compiler: D$i has identifier");
$unique_id{$D->Id()}++;
ok($D->ShortDescription() ne "",
! "$compiler: D$i has short description");
ok($D->EditorDescription() ne "",
! "$compiler: D$i has editor's description");
ok($D->Option() ne "",
! "$compiler: D$i has option (value)");
$unique_id{$D->Option()}++;
}
foreach(keys %unique_id) {
! ok($unique_id{$_} == 1, "$compiler: option $_ is defined only once");
}
foreach(keys %unique_opt) {
! ok($unique_opt{$_} == 1, "$compiler: value $_ is defined only once");
}
}
|