From: Will Budic Date: Fri, 5 Jul 2024 12:01:42 +0000 (+1000) Subject: Fix: Test result footer regex failing bug. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=4cd1a69eb77f0711041e0e7786b2e4fd911a8b00;p=PerlCNF.git Fix: Test result footer regex failing bug. --- diff --git a/tests/TestManager.pm b/tests/TestManager.pm index 637e16b..c1b4641 100644 --- a/tests/TestManager.pm +++ b/tests/TestManager.pm @@ -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 diff --git a/tests/testAll.pl b/tests/testAll.pl index 5a0589c..1ee895b 100644 --- a/tests/testAll.pl +++ b/tests/testAll.pl @@ -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){