Skip to content

Commit 61077de

Browse files
committed
Revert "track tests skipped by ext separately"
This reverts commit 24cb772.
1 parent 2b908c4 commit 61077de

File tree

1 file changed

+17
-36
lines changed

1 file changed

+17
-36
lines changed

run-tests.php

Lines changed: 17 additions & 36 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
@@ -1768,18 +1768,6 @@ function skip_test(string $tested, string $tested_file, string $shortname, strin
17681768
return 'SKIPPED';
17691769
}
17701770

1771-
function skip_ext_test(string $tested, string $tested_file, string $shortname, array $missing_exts) {
1772-
global $junit;
1773-
1774-
$reason = 'Required extension' . (count($missing_exts) > 1 ? 's' : '')
1775-
. ' missing: ' . implode(', ', $missing_exts);
1776-
1777-
show_result('SKIP_EXT', $tested, $tested_file, "reason: $reason");
1778-
$junit->initSuite($junit->getSuiteName($shortname));
1779-
$junit->markTestAs('SKIP_EXT', $shortname, $tested, 0, $reason);
1780-
return 'SKIPPED_EXT';
1781-
}
1782-
17831771
//
17841772
// Run an individual test case.
17851773
//
@@ -2049,7 +2037,9 @@ function run_test(string $php, $file, array $env): string
20492037
}
20502038
}
20512039
if ($missing) {
2052-
return skip_ext_test($tested, $tested_file, $shortname, $missing);
2040+
$message = 'Required extension' . (count($missing) > 1 ? 's' : '')
2041+
. ' missing: ' . implode(', ', $missing);
2042+
return skip_test($tested, $tested_file, $shortname, $message);
20532043
}
20542044
}
20552045

@@ -3041,7 +3031,6 @@ function compute_summary(): void
30413031
'PASSED' => 0,
30423032
'WARNED' => 0,
30433033
'SKIPPED' => 0,
3044-
'SKIPPED_EXT' => 0,
30453034
'FAILED' => 0,
30463035
'BORKED' => 0,
30473036
'LEAKED' => 0,
@@ -3064,7 +3053,7 @@ function get_summary(bool $show_ext_summary): string
30643053
{
30653054
global $n_total, $sum_results, $percent_results, $end_time, $start_time, $failed_test_summary, $PHP_FAILED_TESTS, $valgrind;
30663055

3067-
$x_total = $n_total - $sum_results['SKIPPED'] - $sum_results['SKIPPED_EXT'] - $sum_results['BORKED'];
3056+
$x_total = $n_total - $sum_results['SKIPPED'] - $sum_results['BORKED'];
30683057

30693058
if ($x_total) {
30703059
$x_warned = (100.0 * $sum_results['WARNED']) / $x_total;
@@ -3088,37 +3077,36 @@ function get_summary(bool $show_ext_summary): string
30883077
}
30893078

30903079
$summary .=
3091-
'Number of tests : ' . sprintf('%4d', $n_total) . ' ' . sprintf('%8d', $x_total);
3080+
'Number of tests : ' . sprintf('%4d', $n_total) . ' ' . sprintf('%8d', $x_total);
30923081

30933082
if ($sum_results['BORKED']) {
30943083
$summary .= '
3095-
Tests borked : ' . sprintf('%4d (%5.1f%%)', $sum_results['BORKED'], $percent_results['BORKED']) . ' --------';
3084+
Tests borked : ' . sprintf('%4d (%5.1f%%)', $sum_results['BORKED'], $percent_results['BORKED']) . ' --------';
30963085
}
30973086

30983087
$summary .= '
3099-
Tests skipped by ext: ' . sprintf('%4d (%5.1f%%)', $sum_results['SKIPPED_EXT'], $percent_results['SKIPPED_EXT']) . ' --------
3100-
Tests skipped other : ' . sprintf('%4d (%5.1f%%)', $sum_results['SKIPPED'], $percent_results['SKIPPED']) . ' --------
3101-
Tests warned : ' . sprintf('%4d (%5.1f%%)', $sum_results['WARNED'], $percent_results['WARNED']) . ' ' . sprintf('(%5.1f%%)', $x_warned) . '
3102-
Tests failed : ' . sprintf('%4d (%5.1f%%)', $sum_results['FAILED'], $percent_results['FAILED']) . ' ' . sprintf('(%5.1f%%)', $x_failed);
3088+
Tests skipped : ' . sprintf('%4d (%5.1f%%)', $sum_results['SKIPPED'], $percent_results['SKIPPED']) . ' --------
3089+
Tests warned : ' . sprintf('%4d (%5.1f%%)', $sum_results['WARNED'], $percent_results['WARNED']) . ' ' . sprintf('(%5.1f%%)', $x_warned) . '
3090+
Tests failed : ' . sprintf('%4d (%5.1f%%)', $sum_results['FAILED'], $percent_results['FAILED']) . ' ' . sprintf('(%5.1f%%)', $x_failed);
31033091

31043092
if ($sum_results['XFAILED']) {
31053093
$summary .= '
3106-
Expected fail : ' . sprintf('%4d (%5.1f%%)', $sum_results['XFAILED'], $percent_results['XFAILED']) . ' ' . sprintf('(%5.1f%%)', $x_xfailed);
3094+
Expected fail : ' . sprintf('%4d (%5.1f%%)', $sum_results['XFAILED'], $percent_results['XFAILED']) . ' ' . sprintf('(%5.1f%%)', $x_xfailed);
31073095
}
31083096

31093097
if ($valgrind) {
31103098
$summary .= '
3111-
Tests leaked : ' . sprintf('%4d (%5.1f%%)', $sum_results['LEAKED'], $percent_results['LEAKED']) . ' ' . sprintf('(%5.1f%%)', $x_leaked);
3099+
Tests leaked : ' . sprintf('%4d (%5.1f%%)', $sum_results['LEAKED'], $percent_results['LEAKED']) . ' ' . sprintf('(%5.1f%%)', $x_leaked);
31123100
if ($sum_results['XLEAKED']) {
31133101
$summary .= '
3114-
Expected leak : ' . sprintf('%4d (%5.1f%%)', $sum_results['XLEAKED'], $percent_results['XLEAKED']) . ' ' . sprintf('(%5.1f%%)', $x_xleaked);
3102+
Expected leak : ' . sprintf('%4d (%5.1f%%)', $sum_results['XLEAKED'], $percent_results['XLEAKED']) . ' ' . sprintf('(%5.1f%%)', $x_xleaked);
31153103
}
31163104
}
31173105

31183106
$summary .= '
3119-
Tests passed : ' . sprintf('%4d (%5.1f%%)', $sum_results['PASSED'], $percent_results['PASSED']) . ' ' . sprintf('(%5.1f%%)', $x_passed) . '
3107+
Tests passed : ' . sprintf('%4d (%5.1f%%)', $sum_results['PASSED'], $percent_results['PASSED']) . ' ' . sprintf('(%5.1f%%)', $x_passed) . '
31203108
---------------------------------------------------------------------
3121-
Time taken : ' . sprintf('%4d seconds', $end_time - $start_time) . '
3109+
Time taken : ' . sprintf('%4d seconds', $end_time - $start_time) . '
31223110
=====================================================================
31233111
';
31243112
$failed_test_summary = '';
@@ -3339,7 +3327,6 @@ class JUnit
33393327
'test_fail' => 0,
33403328
'test_error' => 0,
33413329
'test_skip' => 0,
3342-
'test_skip_ext' => 0,
33433330
'test_warn' => 0,
33443331
'files' => [],
33453332
'execution_time' => 0,
@@ -3380,13 +3367,12 @@ public function saveXML(): void
33803367

33813368
$xml = '<' . '?' . 'xml version="1.0" encoding="UTF-8"' . '?' . '>' . PHP_EOL;
33823369
$xml .= sprintf(
3383-
'<testsuites name="%s" tests="%s" failures="%d" errors="%d" skip="%d" skip_ext="%d" time="%s">' . PHP_EOL,
3370+
'<testsuites name="%s" tests="%s" failures="%d" errors="%d" skip="%d" time="%s">' . PHP_EOL,
33843371
$this->rootSuite['name'],
33853372
$this->rootSuite['test_total'],
33863373
$this->rootSuite['test_fail'],
33873374
$this->rootSuite['test_error'],
33883375
$this->rootSuite['test_skip'],
3389-
$this->rootSuite['test_skip_ext'],
33903376
$this->rootSuite['execution_time']
33913377
);
33923378
$xml .= $this->getSuitesXML();
@@ -3401,13 +3387,12 @@ private function getSuitesXML(string $suite_name = '')
34013387

34023388
foreach ($this->suites as $suite_name => $suite) {
34033389
$result .= sprintf(
3404-
'<testsuite name="%s" tests="%s" failures="%d" errors="%d" skip="%d" skip_ext="%d" time="%s">' . PHP_EOL,
3390+
'<testsuite name="%s" tests="%s" failures="%d" errors="%d" skip="%d" time="%s">' . PHP_EOL,
34053391
$suite['name'],
34063392
$suite['test_total'],
34073393
$suite['test_fail'],
34083394
$suite['test_error'],
34093395
$suite['test_skip'],
3410-
$suite['test_skip_ext'],
34113396
$suite['execution_time']
34123397
);
34133398

@@ -3467,9 +3452,6 @@ public function markTestAs(
34673452
} elseif ('SKIP' == $type) {
34683453
$this->record($suite, 'test_skip');
34693454
$this->rootSuite['files'][$file_name]['xml'] .= "<skipped>$escaped_message</skipped>\n";
3470-
} elseif ('SKIP_EXP' == $type) {
3471-
$this->record($suite, 'test_skip_ext');
3472-
$this->rootSuite['files'][$file_name]['xml'] .= "<skipped_ext>$escaped_message</skipped_ext>\n";
34733455
} elseif ('WARN' == $type) {
34743456
$this->record($suite, 'test_warn');
34753457
$this->rootSuite['files'][$file_name]['xml'] .= "<warning>$escaped_message</warning>\n";
@@ -3616,7 +3598,6 @@ private function mergeSuites(array &$dest, array $source): void
36163598
$dest['test_fail'] += $source['test_fail'];
36173599
$dest['test_error'] += $source['test_error'];
36183600
$dest['test_skip'] += $source['test_skip'];
3619-
$dest['test_skip_ext'] += $source['test_skip_ext'];
36203601
$dest['test_warn'] += $source['test_warn'];
36213602
$dest['execution_time'] += $source['execution_time'];
36223603
$dest['files'] += $source['files'];

0 commit comments

Comments
 (0)