[Compbench-devel] CompBenchmarks++/CBM-PI/t 05-Option-Descriptions.pl, 1.4, 1.5
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-04-10 17:40:30
|
Update of /cvsroot/compbench/CompBenchmarks++/CBM-PI/t In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv4171 Modified Files: 05-Option-Descriptions.pl Log Message: Uses compilers.pl ; Index: 05-Option-Descriptions.pl =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/CBM-PI/t/05-Option-Descriptions.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** 05-Option-Descriptions.pl 20 Mar 2007 20:29:56 -0000 1.4 --- 05-Option-Descriptions.pl 10 Apr 2007 17:40:26 -0000 1.5 *************** *** 1,3 **** --- 1,11 ---- #!/usr/bin/perl -w -I .. + # ----------------------------------------------------------------------------- + # $Id$ + # + # This is free software. + # For details, see the GNU Public License in the COPYING file, or + # Look http://www.fsf.org + # ----------------------------------------------------------------------------- + use strict; use CBM; *************** *** 7,35 **** push(@INC, "lib"); require "libtest.pl"; ! # !!! g++ options not checked ! my %OPTIONS_GXX = ( 'expect' => 25 ! ); ! ! my %OPTIONS_GCC = ( 'expect' => 25 ! ); ! ! my %OPTIONS_GPP = ( 'expect' => 26 ! ); ! ! 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'); ! ! my %COMPILER_INTERFACES = ('compiler-fake-gcc-3.2.3-20-rh' => 'gcc-2.95.0', ! 'compiler-fake-g++-4.1.1-13' => 'g++-2.95.0', ! 'compiler-fake-gcc-4.1.1-13' => 'gcc-2.95.0' ); - my @COMPILER_INTERFACES = ('compiler-fake-gcc-3.2.3-20-rh', - 'compiler-fake-g++-4.1.1-13', - 'compiler-fake-gcc-4.1.1-13'); use Test::More; --- 15,24 ---- push(@INC, "lib"); require "libtest.pl"; + require "compilers.pl"; ! our %COMPILER_FAKE_INTERFACES; ! our @COMPILER_FAKE_INTERFACES; ! our %COMPILER_FAKE_OPTIONS; use Test::More; *************** *** 38,48 **** my $c; ! foreach $c (@COMPILERS) { ! my $expect = $OPTIONS{$c}->{expect}; ! $n+=(2+($expect*6)); ! } ! ! foreach $c (@COMPILER_INTERFACES) { ! my $expect = $OPTIONS{$COMPILER_INTERFACES{$c}}->{expect}; $n+=(3+($expect*6)); } --- 27,32 ---- my $c; ! foreach $c (@COMPILER_FAKE_INTERFACES) { ! my $expect = compiler_option_number_expected($COMPILER_FAKE_INTERFACES{$c}); $n+=(3+($expect*6)); } *************** *** 64,68 **** $n=$OD->DescriptionNumber(); ! ok($n eq $OPTIONS{$compiler}->{expect}, "$compiler: DescriptionNumber() returns $OPTIONS{$compiler}->{expect} (has $n)"); my $i; --- 48,53 ---- $n=$OD->DescriptionNumber(); ! my $expect = compiler_option_number_expected($compiler); ! ok($n eq $expect, "$compiler: DescriptionNumber() returns $expect (has $n in " . $OD->DescriptionFile() . ")"); my $i; *************** *** 71,74 **** --- 56,62 ---- my %unique_opt; + my $c = (split('-', $compiler))[0]; + $c=~ s/g\+\+/gxx/; + my $D; for($i=0; $i<$n; $i++) { *************** *** 83,86 **** --- 71,78 ---- "$compiler: D$i has option (value)"); $unique_id{$D->Option()}++; + + # !!! + # my $fid = "kb-$c-option-" . $D->Id() . "-is-compatible"; + # ok(defined(CBM::celFunctionGet($fid)), "$fid defined"); } *************** *** 94,114 **** } - 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"); - - - test_options_descriptions($OD, $compiler); - } - - sub test_options { - foreach(@COMPILERS) { - test_options_compiler($_); - } - } - sub test_compilers { my $fake; --- 86,89 ---- *************** *** 116,120 **** my $CS = CBM::CompilerSelector->new($sys); ! foreach(@COMPILER_INTERFACES) { $fake="$top_srcdir/reference/$_"; ok(-x $fake, "$fake is an executable"); --- 91,95 ---- my $CS = CBM::CompilerSelector->new($sys); ! foreach(@COMPILER_FAKE_INTERFACES) { $fake="$top_srcdir/reference/$_"; ok(-x $fake, "$fake is an executable"); *************** *** 123,132 **** test_options_descriptions($C->OptionDescriptions(), ! $COMPILER_INTERFACES{$_}); } } $sys = CBM::Init(); - test_options(); test_compilers(); --- 98,106 ---- test_options_descriptions($C->OptionDescriptions(), ! $COMPILER_FAKE_INTERFACES{$_}); } } $sys = CBM::Init(); test_compilers(); |