mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Fix Xdebug coverage
This commit is contained in:
parent
fe504c5e23
commit
6b93e48d83
@ -48,7 +48,8 @@ describe('Config tests', () => {
|
||||
|
||||
it('checking addCoverage with Xdebug on linux', async () => {
|
||||
const linux: string = await coverage.addCoverage('xdebug', '8.0', 'linux');
|
||||
expect(linux).toContain('Xdebug currently only supports PHP 7.4 or lower');
|
||||
expect(linux).toContain('add_extension xdebug');
|
||||
expect(linux).toContain('echo "xdebug.mode=coverage"');
|
||||
});
|
||||
|
||||
it('checking addCoverage with Xdebug on darwin', async () => {
|
||||
|
17
dist/index.js
vendored
17
dist/index.js
vendored
@ -2106,16 +2106,15 @@ const config = __importStar(__webpack_require__(641));
|
||||
* @param pipe
|
||||
*/
|
||||
async function addCoverageXdebug(version, os_version, pipe) {
|
||||
switch (version) {
|
||||
case '8.0':
|
||||
return ('\n' +
|
||||
(await utils.addLog('$cross', 'xdebug', 'Xdebug currently only supports PHP 7.4 or lower', os_version)));
|
||||
case '7.4':
|
||||
const xdebug = (await extensions.addExtension('xdebug', version, os_version, true)) + pipe;
|
||||
const ini = await config.addINIValues('xdebug.mode=coverage', os_version, true);
|
||||
const log = await utils.addLog('$tick', 'xdebug', 'Xdebug enabled as coverage driver', os_version);
|
||||
switch (true) {
|
||||
case /8.[0-9]/.test(version):
|
||||
return xdebug + '\n' + ini + '\n' + log;
|
||||
case /5\.[3-6]|7.[0-4]/.test(version):
|
||||
default:
|
||||
return ((await extensions.addExtension('xdebug', version, os_version, true)) +
|
||||
pipe +
|
||||
'\n' +
|
||||
(await utils.addLog('$tick', 'xdebug', 'Xdebug enabled as coverage driver', os_version)));
|
||||
return xdebug + '\n' + log;
|
||||
}
|
||||
}
|
||||
exports.addCoverageXdebug = addCoverageXdebug;
|
||||
|
@ -14,30 +14,25 @@ export async function addCoverageXdebug(
|
||||
os_version: string,
|
||||
pipe: string
|
||||
): Promise<string> {
|
||||
switch (version) {
|
||||
case '8.0':
|
||||
return (
|
||||
'\n' +
|
||||
(await utils.addLog(
|
||||
'$cross',
|
||||
'xdebug',
|
||||
'Xdebug currently only supports PHP 7.4 or lower',
|
||||
os_version
|
||||
))
|
||||
);
|
||||
case '7.4':
|
||||
const xdebug =
|
||||
(await extensions.addExtension('xdebug', version, os_version, true)) + pipe;
|
||||
const ini = await config.addINIValues(
|
||||
'xdebug.mode=coverage',
|
||||
os_version,
|
||||
true
|
||||
);
|
||||
const log = await utils.addLog(
|
||||
'$tick',
|
||||
'xdebug',
|
||||
'Xdebug enabled as coverage driver',
|
||||
os_version
|
||||
);
|
||||
switch (true) {
|
||||
case /8.[0-9]/.test(version):
|
||||
return xdebug + '\n' + ini + '\n' + log;
|
||||
case /5\.[3-6]|7.[0-4]/.test(version):
|
||||
default:
|
||||
return (
|
||||
(await extensions.addExtension('xdebug', version, os_version, true)) +
|
||||
pipe +
|
||||
'\n' +
|
||||
(await utils.addLog(
|
||||
'$tick',
|
||||
'xdebug',
|
||||
'Xdebug enabled as coverage driver',
|
||||
os_version
|
||||
))
|
||||
);
|
||||
return xdebug + '\n' + log;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user