diff options
author | Marcus Boerger <helly@php.net> | 2003-05-23 20:51:09 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2003-05-23 20:51:09 +0000 |
commit | 8cd4933d31ba0f468977b1658408596ecee5a030 (patch) | |
tree | 923687b12c20a48278dbdb07d41e1b9e764358d8 /run-tests.php | |
parent | b1b8ed64dc0a4be3e11e98c53a49f2a627a4b9c2 (diff) | |
download | php-git-8cd4933d31ba0f468977b1658408596ecee5a030.tar.gz |
Add warning level for tests.
# You set a test to warning by return "warn <description>" from
# the --SKIPIF-- section. But this only works when you supply
# a reason why it is only a warning.
# Warnings are not called for FAILed tests of corse and hence a
# test result with not FAIL but SKIP/PASS/WARN results is mailed
# as a PASS.
Diffstat (limited to 'run-tests.php')
-rwxr-xr-x | run-tests.php | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/run-tests.php b/run-tests.php index 1d93f9c2eb..bb4ede8c80 100755 --- a/run-tests.php +++ b/run-tests.php @@ -642,6 +642,14 @@ TEST $file $tested .= $info; } } + if (eregi("^warn", trim($output))) { + $reason = (ereg("^warn[[:space:]]*(.+)\$", trim($output))) ? ereg_replace("^warn[[:space:]]*(.+)\$", "\\1", trim($output)) : FALSE; + if ($reason) { + $warn = true; /* only if there is a reason */ + $info = " (warn: $reason)"; + $tested .= $info; + } + } } } @@ -756,7 +764,11 @@ COMMAND $cmd } // Test failed so we need to report details. - echo "FAIL $tested\n"; + if ($warn) { + echo "WARN $tested\n"; + } else { + echo "FAIL $tested\n"; + } $PHP_FAILED_TESTS[] = array( 'name' => $file, @@ -805,7 +817,7 @@ $output error_report($file,$logname,$tested); } - return 'FAILED'; + return $warn ? 'WARNED' : 'FAILED'; } function generate_diff($wanted,$output) @@ -862,7 +874,7 @@ function compute_summary() $n_total = count($test_results); $n_total += $ignored_by_ext; - $sum_results = array('PASSED'=>0, 'SKIPPED'=>0, 'FAILED'=>0); + $sum_results = array('PASSED'=>0, 'WARNED'=>0, 'SKIPPED'=>0, 'FAILED'=>0); foreach ($test_results as $v) { $sum_results[$v]++; } @@ -891,6 +903,7 @@ Exts tested : " . sprintf("%4d",$exts_tested) . " $summary .= " Number of tests : " . sprintf("%4d",$n_total) . " Tests skipped : " . sprintf("%4d (%2.1f%%)",$sum_results['SKIPPED'],$percent_results['SKIPPED']) . " +Tests warned : " . sprintf("%4d (%2.1f%%)",$sum_results['WARNED'],$percent_results['WARNED']) . " Tests failed : " . sprintf("%4d (%2.1f%%)",$sum_results['FAILED'],$percent_results['FAILED']) . " Tests passed : " . sprintf("%4d (%2.1f%%)",$sum_results['PASSED'],$percent_results['PASSED']) . " --------------------------------------------------------------------- |