summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2004-12-30 04:42:41 +0000
committerfukachan <fukachan>2004-12-30 04:42:41 +0000
commit7e183313fa8051ace442fc0c96f3b216baddd06c (patch)
treeb8d69fde111a6fe6c919390981f4d6356f02bda4
parentc4341dbb5b801bed4a03458dac557f4c2d94c6f0 (diff)
downloadfml8-7e183313fa8051ace442fc0c96f3b216baddd06c.tar.gz
fml8-7e183313fa8051ace442fc0c96f3b216baddd06c.tar.bz2
fml8-7e183313fa8051ace442fc0c96f3b216baddd06c.zip
cosmetic changes.
handle "ignored" and "error" states properly.
-rwxr-xr-xregress/fml4to8/configtest.pl33
1 files changed, 23 insertions, 10 deletions
diff --git a/regress/fml4to8/configtest.pl b/regress/fml4to8/configtest.pl
index 8b891597..beba4833 100755
--- a/regress/fml4to8/configtest.pl
+++ b/regress/fml4to8/configtest.pl
@@ -1,6 +1,6 @@
#!/usr/bin/env perl
#
-# $FML: configtest.pl,v 1.1 2004/12/09 11:35:58 fukachan Exp $
+# $FML: configtest.pl,v 1.2 2004/12/29 01:02:26 fukachan Exp $
#
use strict;
@@ -10,17 +10,19 @@ use vars qw(@failed_queue %failed_queue $base_dir);
my $base_dir = shift || '/var/spool/ml';
-for my $f (<$base_dir/*/config.ph>) {
+for my $f (sort <$base_dir/*/config.ph>) {
if (-f $f) {
- print STDERR "// check $f\n";
- check($f);
+ print "\n// check $f\n";
+ eval q{ check($f); };
+ print $@ if $@;
}
}
-for my $f (<$base_dir/*/.fml4rc/config.ph>) {
+for my $f (sort <$base_dir/*/.fml4rc/config.ph>) {
if (-f $f) {
- print STDERR "// check $f\n";
- check($f);
+ print "\n// check $f\n";
+ eval q{ check($f); };
+ print $@ if $@;
}
}
@@ -36,6 +38,7 @@ if (@failed_queue) {
print "\n";
}
else {
+ print "\n";
print "Congraturations! ALL OK\n";
}
@@ -70,12 +73,22 @@ sub check
my $query = "# Q: $k => $y\n";
if ($x = $config_ph->translate($diff, $k, $v)) {
- print "# A: OK TRANSLATION FOUND\n";
- print $x ,"\n";
+ if ($x =~ /IGNORED (since .*)/) {
+ print "# A: OK (IGNORED $1)\n";
+ }
+ elsif ($x =~ /ERROR/) {
+ push(@failed_queue, $query);
+ print "# A: ERROR ($x)\n";
+ }
+ else {
+ print "# A: OK TRANSLATION FOUND\n";
+ print $x ,"\n";
+ }
}
else {
- if ($k =~ /_HOOK$/) {
+ if ($k =~ /_HOOK$|ML_FN|WELCOME_STATEMENT|XMLNAME|BRACKET/) {
print "# A: OK (IGNORED SINCE HOOK CAN NOT TRANSLATED)\n";
+ $query = "# Q: $k => ...\n";
}
else {
print "# A: FAILED (NOT TRANSLATED)\n";