[otrs-cvs] otrs/scripts/test CheckModules.t,1.5,1.6

"CVS commits notifications of OTRS.org" <[email protected]>
Newsgroups gmane.comp.otrs.cvs
Message-ID <[email protected]>
Comments:
Update of /home/cvs/otrs/scripts/test
In directory lancelot:/tmp/cvs-serv21974/scripts/test

Modified Files:
	CheckModules.t 
Log Message:
Improved logic for module checking. Added ANSI terminal coloring for the statuses.

Author: mg

Index: CheckModules.t
===================================================================
RCS file: /home/cvs/otrs/scripts/test/CheckModules.t,v
retrieving revision 1.5
retrieving revision 1.6
diff -2 -u -d -r1.5 -r1.6
--- CheckModules.t	10 Jan 2013 09:46:32 -0000	1.5
+++ CheckModules.t	15 Jan 2013 10:04:18 -0000	1.6
@@ -15,30 +15,22 @@
 use vars (qw($Self));
 
-my $ErrorMessage = "Unable to check Perl modules.";
-my $Home         = $Self->{ConfigObject}->Get('Home');
+my $Home = $Self->{ConfigObject}->Get('Home');
 my $TmpSumString;
 
 if ( open( $TmpSumString, "$^X $Home/bin/otrs.CheckModules.pl |" ) ) {
 
-    open( $TmpSumString, "$^X $Home/bin/otrs.CheckModules.pl |" );
-
     while (<$TmpSumString>) {
         my $TmpLine = $_;
         $TmpLine =~ s/\n//g;
-        if (
-            $TmpLine    =~ m{Not \s installed! (.+?) \(Required}smx
-            || $TmpLine =~ m{Not \s supported}smx
-            || $TmpLine =~ m{failed!}smx
-            )
-        {
-            $Self->False(
+        if ( $TmpLine =~ m{ok|optional}ismx ) {
+            $Self->True(
                 $TmpLine,
-                "Error in your installed perl modules: $TmpLine",
+                "$TmpLine",
             );
         }
         else {
-            $Self->True(
+            $Self->False(
                 $TmpLine,
-                "$TmpLine",
+                "Error in your installed perl modules: $TmpLine",
             );
         }
@@ -49,6 +41,6 @@
 else {
     $Self->False(
-        $ErrorMessage,
-        $ErrorMessage,
+        1,
+        'Unable to check Perl modules',
     );
 }
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.