Skip to content

Commit 5580801

Browse files
committed
Revert "track tests skipped by ext separately"
This reverts commit 24cb772.
1 parent 24cb772 commit 5580801

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
@@ -1850,18 +1850,6 @@ function skip_test(string $tested, string $tested_file, string $shortname, strin
18501850
return 'SKIPPED';
18511851
}
18521852

1853-
function skip_ext_test(string $tested, string $tested_file, string $shortname, array $missing_exts) {
1854-
global $junit;
1855-
1856-
$reason = 'Required extension' . (count($missing_exts) > 1 ? 's' : '')
1857-
. ' missing: ' . implode(', ', $missing_exts);
1858-
1859-
show_result('SKIP_EXT', $tested, $tested_file, "reason: $reason");
1860-
$junit->initSuite($junit->getSuiteName($shortname));
1861-
$junit->markTestAs('SKIP_EXT', $shortname, $tested, 0, $reason);
1862-
return 'SKIPPED_EXT';
1863-
}
1864-
18651853
//
18661854
// Run an individual test case.
18671855
//
@@ -2127,7 +2115,9 @@ function run_test(string $php, $file, array $env): string
21272115
}
21282116
}
21292117
if ($missing) {
2130-
return skip_ext_test($tested, $tested_file, $shortname, $missing);
2118+
$message = 'Required extension' . (count($missing) > 1 ? 's' : '')
2119+
. ' missing: ' . implode(', ', $missing);
2120+
return skip_test($tested, $tested_file, $shortname, $message);
21312121
}
21322122
}
21332123

@@ -3108,7 +3098,6 @@ function compute_summary(): void
31083098
'PASSED' => 0,
31093099
'WARNED' => 0,
31103100
'SKIPPED' => 0,
3111-
'SKIPPED_EXT' => 0,
31123101
'FAILED' => 0,
31133102
'BORKED' => 0,
31143103
'LEAKED' => 0,
@@ -3131,7 +3120,7 @@ function get_summary(bool $show_ext_summary): string
31313120
{
31323121
global $n_total, $sum_results, $percent_results, $end_time, $start_time, $failed_test_summary, $PHP_FAILED_TESTS, $valgrind;
31333122

3134-
$x_total = $n_total - $sum_results['SKIPPED'] - $sum_results['SKIPPED_EXT'] - $sum_results['BORKED'];
3123+
$x_total = $n_total - $sum_results['SKIPPED'] - $sum_results['BORKED'];
31353124

31363125
if ($x_total) {
31373126
$x_warned = (100.0 * $sum_results['WARNED']) / $x_total;
@@ -3155,37 +3144,36 @@ function get_summary(bool $show_ext_summary): string
31553144
}
31563145

31573146
$summary .=
3158-
'Number of tests : ' . sprintf('%4d', $n_total) . ' ' . sprintf('%8d', $x_total);
3147+
'Number of tests : ' . sprintf('%4d', $n_total) . ' ' . sprintf('%8d', $x_total);
31593148

31603149
if ($sum_results['BORKED']) {
31613150
$summary .= '
3162-
Tests borked : ' . sprintf('%4d (%5.1f%%)', $sum_results['BORKED'], $percent_results['BORKED']) . ' --------';
3151+
Tests borked : ' . sprintf('%4d (%5.1f%%)', $sum_results['BORKED'], $percent_results['BORKED']) . ' --------';
31633152
}
31643153

31653154
$summary .= '
3166-
Tests skipped by ext: ' . sprintf('%4d (%5.1f%%)', $sum_results['SKIPPED_EXT'], $percent_results['SKIPPED_EXT']) . ' --------
3167-
Tests skipped other : ' . sprintf('%4d (%5.1f%%)', $sum_results['SKIPPED'], $percent_results['SKIPPED']) . ' --------
3168-
Tests warned : ' . sprintf('%4d (%5.1f%%)', $sum_results['WARNED'], $percent_results['WARNED']) . ' ' . sprintf('(%5.1f%%)', $x_warned) . '
3169-
Tests failed : ' . sprintf('%4d (%5.1f%%)', $sum_results['FAILED'], $percent_results['FAILED']) . ' ' . sprintf('(%5.1f%%)', $x_failed);
3155+
Tests skipped : ' . sprintf('%4d (%5.1f%%)', $sum_results['SKIPPED'], $percent_results['SKIPPED']) . ' --------
3156+
Tests warned : ' . sprintf('%4d (%5.1f%%)', $sum_results['WARNED'], $percent_results['WARNED']) . ' ' . sprintf('(%5.1f%%)', $x_warned) . '
3157+
Tests failed : ' . sprintf('%4d (%5.1f%%)', $sum_results['FAILED'], $percent_results['FAILED']) . ' ' . sprintf('(%5.1f%%)', $x_failed);
31703158

31713159
if ($sum_results['XFAILED']) {
31723160
$summary .= '
3173-
Expected fail : ' . sprintf('%4d (%5.1f%%)', $sum_results['XFAILED'], $percent_results['XFAILED']) . ' ' . sprintf('(%5.1f%%)', $x_xfailed);
3161+
Expected fail : ' . sprintf('%4d (%5.1f%%)', $sum_results['XFAILED'], $percent_results['XFAILED']) . ' ' . sprintf('(%5.1f%%)', $x_xfailed);
31743162
}
31753163

31763164
if ($valgrind) {
31773165
$summary .= '
3178-
Tests leaked : ' . sprintf('%4d (%5.1f%%)', $sum_results['LEAKED'], $percent_results['LEAKED']) . ' ' . sprintf('(%5.1f%%)', $x_leaked);
3166+
Tests leaked : ' . sprintf('%4d (%5.1f%%)', $sum_results['LEAKED'], $percent_results['LEAKED']) . ' ' . sprintf('(%5.1f%%)', $x_leaked);
31793167
if ($sum_results['XLEAKED']) {
31803168
$summary .= '
3181-
Expected leak : ' . sprintf('%4d (%5.1f%%)', $sum_results['XLEAKED'], $percent_results['XLEAKED']) . ' ' . sprintf('(%5.1f%%)', $x_xleaked);
3169+
Expected leak : ' . sprintf('%4d (%5.1f%%)', $sum_results['XLEAKED'], $percent_results['XLEAKED']) . ' ' . sprintf('(%5.1f%%)', $x_xleaked);
31823170
}
31833171
}
31843172

31853173
$summary .= '
3186-
Tests passed : ' . sprintf('%4d (%5.1f%%)', $sum_results['PASSED'], $percent_results['PASSED']) . ' ' . sprintf('(%5.1f%%)', $x_passed) . '
3174+
Tests passed : ' . sprintf('%4d (%5.1f%%)', $sum_results['PASSED'], $percent_results['PASSED']) . ' ' . sprintf('(%5.1f%%)', $x_passed) . '
31873175
---------------------------------------------------------------------
3188-
Time taken : ' . sprintf('%4d seconds', $end_time - $start_time) . '
3176+
Time taken : ' . sprintf('%4d seconds', $end_time - $start_time) . '
31893177
=====================================================================
31903178
';
31913179
$failed_test_summary = '';
@@ -3407,7 +3395,6 @@ class JUnit
34073395
'test_fail' => 0,
34083396
'test_error' => 0,
34093397
'test_skip' => 0,
3410-
'test_skip_ext' => 0,
34113398
'test_warn' => 0,
34123399
'files' => [],
34133400
'execution_time' => 0,
@@ -3445,13 +3432,12 @@ public function saveXML(): void
34453432

34463433
$xml = '<' . '?' . 'xml version="1.0" encoding="UTF-8"' . '?' . '>' . PHP_EOL;
34473434
$xml .= sprintf(
3448-
'<testsuites name="%s" tests="%s" failures="%d" errors="%d" skip="%d" skip_ext="%d" time="%s">' . PHP_EOL,
3435+
'<testsuites name="%s" tests="%s" failures="%d" errors="%d" skip="%d" time="%s">' . PHP_EOL,
34493436
$this->rootSuite['name'],
34503437
$this->rootSuite['test_total'],
34513438
$this->rootSuite['test_fail'],
34523439
$this->rootSuite['test_error'],
34533440
$this->rootSuite['test_skip'],
3454-
$this->rootSuite['test_skip_ext'],
34553441
$this->rootSuite['execution_time']
34563442
);
34573443
$xml .= $this->getSuitesXML();
@@ -3466,13 +3452,12 @@ private function getSuitesXML(string $suite_name = '')
34663452

34673453
foreach ($this->suites as $suite_name => $suite) {
34683454
$result .= sprintf(
3469-
'<testsuite name="%s" tests="%s" failures="%d" errors="%d" skip="%d" skip_ext="%d" time="%s">' . PHP_EOL,
3455+
'<testsuite name="%s" tests="%s" failures="%d" errors="%d" skip="%d" time="%s">' . PHP_EOL,
34703456
$suite['name'],
34713457
$suite['test_total'],
34723458
$suite['test_fail'],
34733459
$suite['test_error'],
34743460
$suite['test_skip'],
3475-
$suite['test_skip_ext'],
34763461
$suite['execution_time']
34773462
);
34783463

@@ -3532,9 +3517,6 @@ public function markTestAs(
35323517
} elseif ('SKIP' == $type) {
35333518
$this->record($suite, 'test_skip');
35343519
$this->rootSuite['files'][$file_name]['xml'] .= "<skipped>$escaped_message</skipped>\n";
3535-
} elseif ('SKIP_EXP' == $type) {
3536-
$this->record($suite, 'test_skip_ext');
3537-
$this->rootSuite['files'][$file_name]['xml'] .= "<skipped_ext>$escaped_message</skipped_ext>\n";
35383520
} elseif ('WARN' == $type) {
35393521
$this->record($suite, 'test_warn');
35403522
$this->rootSuite['files'][$file_name]['xml'] .= "<warning>$escaped_message</warning>\n";
@@ -3678,7 +3660,6 @@ private function mergeSuites(array &$dest, array $source): void
36783660
$dest['test_fail'] += $source['test_fail'];
36793661
$dest['test_error'] += $source['test_error'];
36803662
$dest['test_skip'] += $source['test_skip'];
3681-
$dest['test_skip_ext'] += $source['test_skip_ext'];
36823663
$dest['test_warn'] += $source['test_warn'];
36833664
$dest['execution_time'] += $source['execution_time'];
36843665
$dest['files'] += $source['files'];

0 commit comments

Comments
 (0)