Bug 1547996 - Fix mochitest-browser-chrome with mach addtest;r=ahal

Differential Revision: https://phabricator.services.mozilla.com/D29364

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Brian Grinstead 2019-04-30 15:20:51 +00:00
Родитель 6487cabf8b
Коммит 8ca66379e9
2 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -56,7 +56,7 @@ add_task(async function test_TODO() {
class MochitestCreator(Creator):
templates = {
"mochitest-browser": "browser.template.txt",
"mochitest-browser-chrome": "browser.template.txt",
"mochitest-plain": "plain%(doc)s.template.txt",
"mochitest-chrome": "chrome%(doc)s.template.txt",
}
@ -86,7 +86,7 @@ class MochitestCreator(Creator):
guessed_ini = {
"mochitest-plain": "mochitest.ini",
"mochitest-chrome": "chrome.ini",
"mochitest-browser": "browser.ini"
"mochitest-browser-chrome": "browser.ini"
}[self.suite]
manifest_file = os.path.join(os.path.dirname(self.test), guessed_ini)
filename = os.path.basename(self.test)
@ -308,5 +308,8 @@ TEST_CREATORS = {"mochitest": MochitestCreator,
def creator_for_suite(suite):
if suite.split("-")[0] == "mochitest":
base_suite = "mochitest"
else:
base_suite = suite.rsplit("-", 1)[0]
return TEST_CREATORS.get(base_suite)

Просмотреть файл

@ -83,7 +83,7 @@ def get_test_parser():
return parser
ADD_TEST_SUPPORTED_SUITES = ['mochitest-chrome', 'mochitest-plain', 'mochitest-browser',
ADD_TEST_SUPPORTED_SUITES = ['mochitest-chrome', 'mochitest-plain', 'mochitest-browser-chrome',
'web-platform-tests-testharness', 'web-platform-tests-reftest',
'xpcshell']
ADD_TEST_SUPPORTED_DOCS = ['js', 'html', 'xhtml', 'xul']
@ -267,7 +267,7 @@ class AddTest(MachCommandBase):
guessed_suite = "xpcshell"
else:
if filename.startswith("browser_") and has_browser_ini:
guessed_suite = "mochitest-browser"
guessed_suite = "mochitest-browser-chrome"
elif filename.startswith("test_"):
if has_chrome_ini and has_plain_ini:
err = ("Error: directory contains both a chrome.ini and mochitest.ini. "