Skip to content

Commit 2244bca

Browse files
committed
Revert "track tests skipped by ext separately"
This reverts commit bb51c4b.
1 parent bb51c4b commit 2244bca

File tree

1 file changed

+18
-37
lines changed

1 file changed

+18
-37
lines changed

run-tests.php

Lines changed: 18 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function show_usage(): void
6969
with value 'bar').
7070
7171
-g Comma separated list of groups to show during test run
72-
(possible values: PASS, FAIL, XFAIL, XLEAK, SKIP, SKIP_EXT, BORK, WARN, LEAK, REDIRECT).
72+
(possible values: PASS, FAIL, XFAIL, XLEAK, SKIP, BORK, WARN, LEAK, REDIRECT).
7373
7474
-m Test for memory leaks with Valgrind (equivalent to -M memcheck).
7575
@@ -1773,18 +1773,6 @@ function skip_test(string $tested, string $tested_file, string $shortname, strin
17731773
return 'SKIPPED';
17741774
}
17751775

1776-
function skip_ext_test(string $tested, string $tested_file, string $shortname, array $missing_exts) {
1777-
global $junit;
1778-
1779-
$reason = 'Required extension' . (count($missing_exts) > 1 ? 's' : '')
1780-
. ' missing: ' . implode(', ', $missing_exts);
1781-
1782-
show_result('SKIP_EXT', $tested, $tested_file, "reason: $reason");
1783-
$junit->initSuite($junit->getSuiteName($shortname));
1784-
$junit->markTestAs('SKIP_EXT', $shortname, $tested, 0, $reason);
1785-
return 'SKIPPED_EXT';
1786-
}
1787-
17881776
//
17891777
// Run an individual test case.
17901778
//
@@ -2054,7 +2042,9 @@ function run_test(string $php, $file, array $env): string
20542042
}
20552043
}
20562044
if ($missing) {
2057-
return skip_ext_test($tested, $tested_file, $shortname, $missing);
2045+
$message = 'Required extension' . (count($missing) > 1 ? 's' : '')
2046+
. ' missing: ' . implode(', ', $missing);
2047+
return skip_test($tested, $tested_file, $shortname, $message);
20582048
}
20592049
}
20602050

@@ -3047,7 +3037,6 @@ function compute_summary(): void
30473037
'PASSED' => 0,
30483038
'WARNED' => 0,
30493039
'SKIPPED' => 0,
3050-
'SKIPPED_EXT' => 0,
30513040
'FAILED' => 0,
30523041
'BORKED' => 0,
30533042
'LEAKED' => 0,
@@ -3071,7 +3060,7 @@ function get_summary(bool $show_ext_summary): string
30713060
{
30723061
global $n_total, $sum_results, $percent_results, $end_time, $start_time, $failed_test_summary, $PHP_FAILED_TESTS, $valgrind;
30733062

3074-
$x_total = $n_total - $sum_results['SKIPPED'] - $sum_results['SKIPPED_EXT'] - $sum_results['BORKED'];
3063+
$x_total = $n_total - $sum_results['SKIPPED'] - $sum_results['BORKED'];
30753064

30763065
if ($x_total) {
30773066
$x_warned = (100.0 * $sum_results['WARNED']) / $x_total;
@@ -3094,38 +3083,37 @@ function get_summary(bool $show_ext_summary): string
30943083
';
30953084
}
30963085

3097-
$summary .=
3098-
'Number of tests : ' . sprintf('%4d', $n_total) . ' ' . sprintf('%8d', $x_total);
3086+
$summary .= '
3087+
Number of tests : ' . sprintf('%4d', $n_total) . ' ' . sprintf('%8d', $x_total);
30993088

31003089
if ($sum_results['BORKED']) {
31013090
$summary .= '
3102-
Tests borked : ' . sprintf('%4d (%5.1f%%)', $sum_results['BORKED'], $percent_results['BORKED']) . ' --------';
3091+
Tests borked : ' . sprintf('%4d (%5.1f%%)', $sum_results['BORKED'], $percent_results['BORKED']) . ' --------';
31033092
}
31043093

31053094
$summary .= '
3106-
Tests skipped by ext: ' . sprintf('%4d (%5.1f%%)', $sum_results['SKIPPED_EXT'], $percent_results['SKIPPED_EXT']) . ' --------
3107-
Tests skipped other : ' . sprintf('%4d (%5.1f%%)', $sum_results['SKIPPED'], $percent_results['SKIPPED']) . ' --------
3108-
Tests warned : ' . sprintf('%4d (%5.1f%%)', $sum_results['WARNED'], $percent_results['WARNED']) . ' ' . sprintf('(%5.1f%%)', $x_warned) . '
3109-
Tests failed : ' . sprintf('%4d (%5.1f%%)', $sum_results['FAILED'], $percent_results['FAILED']) . ' ' . sprintf('(%5.1f%%)', $x_failed);
3095+
Tests skipped : ' . sprintf('%4d (%5.1f%%)', $sum_results['SKIPPED'], $percent_results['SKIPPED']) . ' --------
3096+
Tests warned : ' . sprintf('%4d (%5.1f%%)', $sum_results['WARNED'], $percent_results['WARNED']) . ' ' . sprintf('(%5.1f%%)', $x_warned) . '
3097+
Tests failed : ' . sprintf('%4d (%5.1f%%)', $sum_results['FAILED'], $percent_results['FAILED']) . ' ' . sprintf('(%5.1f%%)', $x_failed);
31103098

31113099
if ($sum_results['XFAILED']) {
31123100
$summary .= '
3113-
Expected fail : ' . sprintf('%4d (%5.1f%%)', $sum_results['XFAILED'], $percent_results['XFAILED']) . ' ' . sprintf('(%5.1f%%)', $x_xfailed);
3101+
Expected fail : ' . sprintf('%4d (%5.1f%%)', $sum_results['XFAILED'], $percent_results['XFAILED']) . ' ' . sprintf('(%5.1f%%)', $x_xfailed);
31143102
}
31153103

31163104
if ($valgrind) {
31173105
$summary .= '
3118-
Tests leaked : ' . sprintf('%4d (%5.1f%%)', $sum_results['LEAKED'], $percent_results['LEAKED']) . ' ' . sprintf('(%5.1f%%)', $x_leaked);
3106+
Tests leaked : ' . sprintf('%4d (%5.1f%%)', $sum_results['LEAKED'], $percent_results['LEAKED']) . ' ' . sprintf('(%5.1f%%)', $x_leaked);
31193107
if ($sum_results['XLEAKED']) {
31203108
$summary .= '
3121-
Expected leak : ' . sprintf('%4d (%5.1f%%)', $sum_results['XLEAKED'], $percent_results['XLEAKED']) . ' ' . sprintf('(%5.1f%%)', $x_xleaked);
3109+
Expected leak : ' . sprintf('%4d (%5.1f%%)', $sum_results['XLEAKED'], $percent_results['XLEAKED']) . ' ' . sprintf('(%5.1f%%)', $x_xleaked);
31223110
}
31233111
}
31243112

31253113
$summary .= '
3126-
Tests passed : ' . sprintf('%4d (%5.1f%%)', $sum_results['PASSED'], $percent_results['PASSED']) . ' ' . sprintf('(%5.1f%%)', $x_passed) . '
3114+
Tests passed : ' . sprintf('%4d (%5.1f%%)', $sum_results['PASSED'], $percent_results['PASSED']) . ' ' . sprintf('(%5.1f%%)', $x_passed) . '
31273115
---------------------------------------------------------------------
3128-
Time taken : ' . sprintf('%4d seconds', $end_time - $start_time) . '
3116+
Time taken : ' . sprintf('%4d seconds', $end_time - $start_time) . '
31293117
=====================================================================
31303118
';
31313119
$failed_test_summary = '';
@@ -3346,7 +3334,6 @@ class JUnit
33463334
'test_fail' => 0,
33473335
'test_error' => 0,
33483336
'test_skip' => 0,
3349-
'test_skip_ext' => 0,
33503337
'test_warn' => 0,
33513338
'files' => [],
33523339
'execution_time' => 0,
@@ -3387,13 +3374,12 @@ public function saveXML(): void
33873374

33883375
$xml = '<' . '?' . 'xml version="1.0" encoding="UTF-8"' . '?' . '>' . PHP_EOL;
33893376
$xml .= sprintf(
3390-
'<testsuites name="%s" tests="%s" failures="%d" errors="%d" skip="%d" skip_ext="%d" time="%s">' . PHP_EOL,
3377+
'<testsuites name="%s" tests="%s" failures="%d" errors="%d" skip="%d" time="%s">' . PHP_EOL,
33913378
$this->rootSuite['name'],
33923379
$this->rootSuite['test_total'],
33933380
$this->rootSuite['test_fail'],
33943381
$this->rootSuite['test_error'],
33953382
$this->rootSuite['test_skip'],
3396-
$this->rootSuite['test_skip_ext'],
33973383
$this->rootSuite['execution_time']
33983384
);
33993385
$xml .= $this->getSuitesXML();
@@ -3408,13 +3394,12 @@ private function getSuitesXML(string $suite_name = '')
34083394

34093395
foreach ($this->suites as $suite_name => $suite) {
34103396
$result .= sprintf(
3411-
'<testsuite name="%s" tests="%s" failures="%d" errors="%d" skip="%d" skip_ext="%d" time="%s">' . PHP_EOL,
3397+
'<testsuite name="%s" tests="%s" failures="%d" errors="%d" skip="%d" time="%s">' . PHP_EOL,
34123398
$suite['name'],
34133399
$suite['test_total'],
34143400
$suite['test_fail'],
34153401
$suite['test_error'],
34163402
$suite['test_skip'],
3417-
$suite['test_skip_ext'],
34183403
$suite['execution_time']
34193404
);
34203405

@@ -3474,9 +3459,6 @@ public function markTestAs(
34743459
} elseif ('SKIP' == $type) {
34753460
$this->record($suite, 'test_skip');
34763461
$this->rootSuite['files'][$file_name]['xml'] .= "<skipped>$escaped_message</skipped>\n";
3477-
} elseif ('SKIP_EXP' == $type) {
3478-
$this->record($suite, 'test_skip_ext');
3479-
$this->rootSuite['files'][$file_name]['xml'] .= "<skipped_ext>$escaped_message</skipped_ext>\n";
34803462
} elseif ('WARN' == $type) {
34813463
$this->record($suite, 'test_warn');
34823464
$this->rootSuite['files'][$file_name]['xml'] .= "<warning>$escaped_message</warning>\n";
@@ -3623,7 +3605,6 @@ private function mergeSuites(array &$dest, array $source): void
36233605
$dest['test_fail'] += $source['test_fail'];
36243606
$dest['test_error'] += $source['test_error'];
36253607
$dest['test_skip'] += $source['test_skip'];
3626-
$dest['test_skip_ext'] += $source['test_skip_ext'];
36273608
$dest['test_warn'] += $source['test_warn'];
36283609
$dest['execution_time'] += $source['execution_time'];
36293610
$dest['files'] += $source['files'];

0 commit comments

Comments
 (0)