@@ -298,7 +298,7 @@ function test_sort($a, $b) {
298
298
$ n_total = count ($ test_results );
299
299
$ n_total += $ ignored_by_ext ;
300
300
301
- $ sum_results = array ('PASSED ' =>0 , 'SKIPPED ' =>0 , 'FAILED ' =>0 );
301
+ $ sum_results = array ('PASSED ' =>0 , 'WARNED ' => 0 , ' SKIPPED ' =>0 , 'FAILED ' =>0 );
302
302
foreach ($ test_results as $ v ) {
303
303
$ sum_results [$ v ]++;
304
304
}
@@ -321,6 +321,7 @@ function test_sort($a, $b) {
321
321
---------------------------------------------------------------------
322
322
Number of tests : " . sprintf ("%4d " ,$ n_total ) . "
323
323
Tests skipped : " . sprintf ("%4d (%2.1f%%) " ,$ sum_results ['SKIPPED ' ],$ percent_results ['SKIPPED ' ]) . "
324
+ Tests warned : " . sprintf ("%4d (%2.1f%%) " ,$ sum_results ['WARNED ' ],$ percent_results ['WARNED ' ]) . "
324
325
Tests failed : " . sprintf ("%4d (%2.1f%%) " ,$ sum_results ['FAILED ' ],$ percent_results ['FAILED ' ]) . "
325
326
Tests passed : " . sprintf ("%4d (%2.1f%%) " ,$ sum_results ['PASSED ' ],$ percent_results ['PASSED ' ]) . "
326
327
---------------------------------------------------------------------
@@ -593,6 +594,7 @@ function run_test($php,$file)
593
594
594
595
// Check if test should be skipped.
595
596
$ info = '' ;
597
+ $ warn = false ;
596
598
if (array_key_exists ('SKIPIF ' , $ section_text )) {
597
599
if (trim ($ section_text ['SKIPIF ' ])) {
598
600
save_text ($ tmp_skipif , $ section_text ['SKIPIF ' ]);
@@ -615,6 +617,14 @@ function run_test($php,$file)
615
617
$ tested .= $ info ;
616
618
}
617
619
}
620
+ if (eregi ("^warn " , trim ($ output ))) {
621
+ $ reason = (ereg ("^warn[[:space:]]*(.+) \$" , trim ($ output ))) ? ereg_replace ("^warn[[:space:]]*(.+) \$" , "\\1 " , trim ($ output )) : FALSE ;
622
+ if ($ reason ) {
623
+ $ warn = true ; /* only if there is a reason */
624
+ $ info = " (warn: $ reason) " ;
625
+ $ tested .= $ info ;
626
+ }
627
+ }
618
628
}
619
629
}
620
630
@@ -728,7 +738,11 @@ function run_test($php,$file)
728
738
}
729
739
730
740
// Test failed so we need to report details.
731
- echo "FAIL $ tested \n" ;
741
+ if ($ warn ) {
742
+ echo "WARN $ tested \n" ;
743
+ } else {
744
+ echo "FAIL $ tested \n" ;
745
+ }
732
746
733
747
$ GLOBALS ['__PHP_FAILED_TESTS__ ' ][] = array (
734
748
'name ' => $ file ,
@@ -777,7 +791,7 @@ function run_test($php,$file)
777
791
error_report ($ file ,$ logname ,$ tested );
778
792
}
779
793
780
- return 'FAILED ' ;
794
+ return $ warn ? ' WARNED ' : 'FAILED ' ;
781
795
}
782
796
783
797
function generate_diff ($ wanted ,$ output )
0 commit comments