2
0
Fork 0
Verif_Herezh/Batterie/FONCTION_UNIQUE/SORTIES/Test_R_non_dynamique_suite_point_info/non_dynamique_suite_point_info.verif1

61 lines
1.5 KiB
Perl
Executable file

#!/usr/bin/env perl
use strict;
use warnings;
use English;
use File::Basename;
my $NOM_PROG = basename $PROGRAM_NAME;
#executable Herezh
my $exeHZ = shift(@ARGV);
#fichier redirection affichage
my $flog = shift(@ARGV);
#fichier .info
my $finfo = shift(@ARGV);
#
#
# verification des numeros d increment dans le fichier $flog (INCREMENT_DE_CHARGE)
#
# pour ce calcul, on s attend a trouver 20 increments de numeros : 1, 2, 3, ..., 20
#
# ce script renvoie OK si il y a 20 increments numerotes de 1 a 20
# sinon ECHEC
#
#
#liste des increments
my @liste_increments;
open(FIC, "<$flog");
while(<FIC>) {
next if(not /^\s*INCREMENT\s+DE\s+CHARGE\s+:\s+(\d+)\b/o);
push(@liste_increments, $1);#ajout du numero increment dans la liste
}
close(FIC);
#nombre d increments
my $nb_incr = $#liste_increments + 1;
#ECHEC si le nombre d increments n est pas egal a 20
if($nb_incr != 20) {
print "\nErreur (prog:$NOM_PROG) : $nb_incr increments ont ete calcules (on s attendait a 20 increments)\n\n";
print "resultat verification : ECHEC $nb_incr increments ont ete calcules (on s attendait a 20 increments)\n";
exit;
}
#ECHEC si la liste n est pas dans l ordre exact 1 2 3 ... 20
for(1 .. 20) {
if($liste_increments[$_-1] != $_) {
print "\nErreur (prog:$NOM_PROG) : probleme dans les numeros des increments\n\n";
print "resultat verification : ECHEC probleme dans les numeros des increments\n";
exit;
}
}
#OK : aucun probleme n a ete rencontre
print "resultat verification : OK\n";