Add support for any git repository to compile extension from source

Add support for extensions in a subdirectory to compile from source
This commit is contained in:
Shivam Mathur
2021-03-17 04:48:19 +05:30
parent 6db6ddbab2
commit b3152daa8d
6 changed files with 91 additions and 51 deletions

View File

@ -154,7 +154,7 @@ describe('Extension tests', () => {
'linux'
);
expect(linux).toContain(
'add_extension_from_github mongodb mongodb mongo-php-driver master'
'add_extension_from_source mongodb https://github.com mongodb mongo-php-driver . master extension'
);
});
@ -254,7 +254,7 @@ describe('Extension tests', () => {
'darwin'
);
expect(darwin).toContain(
'add_extension_from_github mongodb mongodb mongo-php-driver master'
'add_extension_from_source mongodb https://github.com mongodb mongo-php-driver . master extension'
);
});
});

View File

@ -259,4 +259,31 @@ describe('Utils tests', () => {
await utils.customPackage('pkg8', 'ext', '1.2.3', 'linux')
).toContain(script_path + '\nadd_pkg 1.2.3');
});
it('checking parseExtensionSource', async () => {
expect(
await utils.parseExtensionSource(
'ext-org-name/repo-name@release',
'extension'
)
).toContain(
'\nadd_extension_from_source ext https://github.com org-name repo-name . release extension'
);
expect(
await utils.parseExtensionSource(
'ext-https://sub.domain.tld/org/repo@release',
'extension'
)
).toContain(
'\nadd_extension_from_source ext https://sub.domain.tld org repo . release extension'
);
expect(
await utils.parseExtensionSource(
'ext-https://sub.domain.XN--tld/org/repo/sub/dir@release',
'extension'
)
).toContain(
'\nadd_extension_from_source ext https://sub.domain.XN--tld org repo sub/dir release extension'
);
});
});