#!/usr/bin/perl
# @(#) compall
#
# Für jedes *.punix-File wird verglichen, ob es mit
# tpunx/uunix/upnix/cunix gleich ist oder diese untereinander
# gleich, d.h. überflüssig sind.
# Die Differenzen stehen mit (eigentlich) logischen, aber
# fürchterlichen Namen unter $SUT/diff, einer Directory, die
# innerhalb dieses Scripts angelegt wird.
#
#
#
#    ========== licence begin  GPL
#    Copyright (C) 2001 SAP AG
#
#    This program is free software; you can redistribute it and/or
#    modify it under the terms of the GNU General Public License
#    as published by the Free Software Foundation; either version 2
#    of the License, or (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#    ========== licence end
#

use Env;
use Carp;
use File::Copy;
do "$TOOL/bin/sutvars$TOOLEXT";

$USAGE="usage: compall \n";

chdir($SUT) || die "Can't change directory: $!\n";

$ProtDir = "diff";
$ProtDir = "$SUT/$ProtDir";

system("mkdir $ProtDir");

unlink (<$ProtDir/*.up_cu>);
unlink (<$ProtDir/*.uu_cu>);
unlink (<$ProtDir/*.cudiff>);
unlink (<$ProtDir/*.uu_up>);
unlink (<$ProtDir/*.updiff>);
unlink (<$ProtDir/*.uudiff>);
unlink (<$ProtDir/*.tpdiff>);

print "\n==============================\n";
print "Liste der Teststroeme erzeugen\n";
print "==============================\n";

#push @alltest, "XINITDB.punix";

opendir(DIR_IN, $SUT);
@Files = grep /^[A-Z].*\.punix/i, readdir(DIR_IN);
push @alltest, @Files;
closedir DIR_IN;

open(FILE_OUT, ">$AllTest");
print FILE_OUT join "\n", @alltest;
close(FILE_OUT);

print "\nJeden Teststrom vergleichen\n";
print "=============================\n";

@ARGV = ( @alltest);
do "$TOOL/bin/compunix$TOOLEXT";

print "\n=====================\n";
print "Alle Vergleiche fertig \n";
print "=======================\n\n";
