unit_tests/run_tests.pl
changeset 889 d3ecff60a3f5
parent 888 3f13aefabfce
equal deleted inserted replaced
888:3f13aefabfce 889:d3ecff60a3f5
   122         my $testtype = $_;
   122         my $testtype = $_;
   123         my $fn = $tests{$_};
   123         my $fn = $tests{$_};
   124         my $d = "$module/$testtype";
   124         my $d = "$module/$testtype";
   125         next if (not -d $d);  # no tests at the moment.
   125         next if (not -d $d);  # no tests at the moment.
   126         opendir(TESTDIR, $d) || die("Failed to open dir '$d': $!\n");
   126         opendir(TESTDIR, $d) || die("Failed to open dir '$d': $!\n");
   127         print(" ... $module / $testtype ...\n");
   127         my $subsection = " ... $module / $testtype ...\n";
       
   128         print($subsection);
       
   129         my $addedsubsection = 0;
   128         my $fname = readdir(TESTDIR);
   130         my $fname = readdir(TESTDIR);
   129         while (defined $fname) {
   131         while (defined $fname) {
   130             my $isfail = 0;
   132             my $isfail = 0;
   131             my $origfname = $fname;
   133             my $origfname = $fname;
   132             $fname = readdir(TESTDIR);  # set for next iteration.
   134             $fname = readdir(TESTDIR);  # set for next iteration.
   151             } else {
   153             } else {
   152                 $reason = '';
   154                 $reason = '';
   153             }
   155             }
   154             my $output = "$result ${origfname}${reason}\n";
   156             my $output = "$result ${origfname}${reason}\n";
   155             print($output);
   157             print($output);
   156             push(@fails, $output) if $isfail;
   158 
       
   159             if ($isfail) {
       
   160                 if (!$addedsubsection) {
       
   161                     $addedsubsection = 1;
       
   162                     push(@fails, $subsection);
       
   163                 }
       
   164                 push(@fails, $output);
       
   165             }
   157 
   166 
   158             $totaltests++;
   167             $totaltests++;
   159         }
   168         }
   160         closedir(TESTDIR);
   169         closedir(TESTDIR);
   161     }
   170     }