cvsuser 02/01/03 10:55:09
Modified: P5EEx/Blue MANIFEST
Added: P5EEx/Blue/t Config.t Reference.t
Log:
added missing test files
Revision Changes Path
1.6 +2 -0 p5ee/P5EEx/Blue/MANIFEST
Index: MANIFEST
===================================================================
RCS file: /cvs/public/p5ee/P5EEx/Blue/MANIFEST,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -r1.5 -r1.6
--- MANIFEST 11 Dec 2001 05:03:46 -0000 1.5
+++ MANIFEST 3 Jan 2002 18:55:09 -0000 1.6
@@ -42,3 +42,5 @@
examples/config.xml
examples/Reference.1
examples/Reference.1.out
+t/Config.t
+t/Reference.t
1.1 p5ee/P5EEx/Blue/t/Config.t
Index: Config.t
===================================================================
#!/usr/local/bin/perl
######################################################################
## $Id: Config.t,v 1.1 2002/01/03 18:55:09 spadkins Exp $
######################################################################
@files = <examples/Config.*[0-9]>;
foreach $file (@files) {
push(@cmds,$file) if ($file !~ /\.out$/);
}
print "1..", $#cmds+1, "\n";
for ($i = 0; $i <= $#cmds; $i++) {
$cmd = $cmds[$i];
$output = &readfile("$cmd |");
$goodoutput = &readfile("< $cmd.out");
if ($goodoutput eq "") {
$goodoutput = $output;
&writefile("$cmd.out",$goodoutput);
}
if ($output eq $goodoutput) {
print "ok\n";
}
else {
print "not ok\n";
}
}
sub readfile {
my ($file) = @_;
if (!open(FILE,$file)) {
return("");
}
my @data = <FILE>;
close(FILE);
return (join("", @data));
}
sub writefile {
my ($file,$data) = @_;
open(FILE,"> $file") || die "Unable to open $file: $!\n";
print FILE $data;
close(FILE);
}
1.1 p5ee/P5EEx/Blue/t/Reference.t
Index: Reference.t
===================================================================
#!/usr/local/bin/perl
######################################################################
## $Id: Reference.t,v 1.1 2002/01/03 18:55:09 spadkins Exp $
######################################################################
@files = <examples/Reference.*[0-9]>;
foreach $file (@files) {
push(@cmds,$file) if ($file !~ /\.out$/);
}
print "1..", $#cmds+1, "\n";
for ($i = 0; $i <= $#cmds; $i++) {
$cmd = $cmds[$i];
$output = &readfile("$cmd |");
$goodoutput = &readfile("< $cmd.out");
if ($goodoutput eq "") {
$goodoutput = $output;
&writefile("$cmd.out",$goodoutput);
}
if ($output eq $goodoutput) {
print "ok\n";
}
else {
print "not ok\n";
}
}
sub readfile {
my ($file) = @_;
if (!open(FILE,$file)) {
return("");
}
my @data = <FILE>;
close(FILE);
return (join("", @data));
}
sub writefile {
my ($file,$data) = @_;
open(FILE,"> $file") || die "Unable to open $file: $!\n";
print FILE $data;
close(FILE);
}