]> lifelog.hopto.org Git - PerlCNF.git/commitdiff
Fix: Test result footer regex failing bug.
authorWill Budic <redacted>
Fri, 5 Jul 2024 12:01:42 +0000 (22:01 +1000)
committerWill Budic <redacted>
Fri, 5 Jul 2024 12:01:42 +0000 (22:01 +1000)
tests/TestManager.pm
tests/testAll.pl

index 637e16bcba1e69f33e9fb009fb76dc29dd13cdcd..c1b4641c513af0333ce029a4d9d3af594ab6959d 100644 (file)
@@ -192,7 +192,8 @@ sub done {
       print $result, BRIGHT_RED."FAILED".RESET." for test file:". RESET WHITE.$self->{test_file}."\n". RESET;
       print $self->{test_cnt}."|FAILED|".$self->{test_file},"\n"
     }else{
-      print $result, BRIGHT_GREEN."PASSED".RESET." for test file: ". RESET WHITE.$self->{test_file}."\n". RESET;
+      print $result, BRIGHT_GREEN."PASSED".RESET." for test file: ". RESET WHITE.$self->{test_file}.RESET."\n";
+      # NOTICE! - Following print is test result footer it is very important not to change.
       print $self->{test_cnt}."|SUCCESS|".$self->{test_file},"\n"
     }
 }
@@ -337,5 +338,5 @@ Open Source Code License -> https://github.com/wbudic/PerlCNF/blob/master/ISC_Li
 #     "/home/will/dev_new/PerlCNF/tests",
 #     "/home/will/dev_new/PerlCNF/system/modules"
 # ]
-# 
+#
 ###
\ No newline at end of file
index 5a0589c4ab43bcb8080a0e60a1103cfb0dd04498..1ee895b93ddcc5eb583076ae0fd793c4a94fbd36 100644 (file)
@@ -10,6 +10,8 @@ use Date::Manip;
 use Term::ANSIColor qw(:constants);
 use IPC::Run qw( run timeout );
 use File::Spec;
+use Cwd qw(getcwd);
+my $CWD = getcwd;
 
 use lib "./local";
 use lib "./tests";
@@ -42,18 +44,18 @@ try{
     my @files = grep { !/^\./ && /^test.*?\.pl$/ && $0 !~ m/$_$/ && -f "./tests/$_" } readdir($dh);
     closedir $dh;
 
-    my ($test_pass, $test_fail, $test_cases, @OUT, %WARN);
+    my ($test_pass, $test_fail, $test_cases, @OUT, %WARN)=(0,0,0,(),());
 
     foreach my $file(sort @files) {
 
-        $file = "./tests/$file";
+        $file = "tests/$file";
         my ($in,$output, $warnings);
         my @perl = ('/usr/bin/env','perl',$file);
         print "Running->$file\n";
         ###
         run  (\@perl, \$in, \$output, '2>>', \$warnings);
         ###
-        my @test_ret = $output=~m/(\d*)\|(.*)\|($file)$/g;
+        my @test_ret = $output=~m/(\d*)\|(\w*)\|($CWD\/$file)$/g;
         $output=~s/\d*\|.*\|$file\s$//g;
         push @OUT, $output;
             if ($warnings){