Add lazy load of exclude_list in test262-harness (#4317)
This PR aims to avoid serializing the exclude_list before each test_case. test-262-esnext execution takes only ~2 mins (8-thread). JerryScript-DCO-1.0-Signed-off-by: Adam Kallai kadam@inf.u-szeged.hu
This commit is contained in:
@@ -695,16 +695,16 @@ class TestSuite(object):
|
|||||||
self.unmarked_default = unmarked_default
|
self.unmarked_default = unmarked_default
|
||||||
self.print_handle = print_handle
|
self.print_handle = print_handle
|
||||||
self.include_cache = {}
|
self.include_cache = {}
|
||||||
self.exclude_list = []
|
self.exclude_list_path = exclude_list_path
|
||||||
self.logf = None
|
self.logf = None
|
||||||
|
|
||||||
if exclude_list_path:
|
def _load_excludes(self):
|
||||||
if os.path.exists(exclude_list_path):
|
if self.exclude_list_path and os.path.exists(self.exclude_list_path):
|
||||||
self.exclude_list = xml.dom.minidom.parse(exclude_list_path)
|
xml_document = xml.dom.minidom.parse(self.exclude_list_path)
|
||||||
self.exclude_list = self.exclude_list.getElementsByTagName("test")
|
xml_tests = xml_document.getElementsByTagName("test")
|
||||||
self.exclude_list = [x.getAttribute("id") for x in self.exclude_list]
|
return {x.getAttribute("id") for x in xml_tests}
|
||||||
else:
|
|
||||||
report_error("Couldn't find excludelist '%s'" % exclude_list_path)
|
return set()
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
if not path.exists(self.test_root):
|
if not path.exists(self.test_root):
|
||||||
@@ -742,6 +742,8 @@ class TestSuite(object):
|
|||||||
return self.include_cache[name]
|
return self.include_cache[name]
|
||||||
|
|
||||||
def enumerate_tests(self, tests, command_template):
|
def enumerate_tests(self, tests, command_template):
|
||||||
|
exclude_list = self._load_excludes()
|
||||||
|
|
||||||
logging.info("Listing tests in %s", self.test_root)
|
logging.info("Listing tests in %s", self.test_root)
|
||||||
cases = []
|
cases = []
|
||||||
for root, dirs, files in os.walk(self.test_root):
|
for root, dirs, files in os.walk(self.test_root):
|
||||||
@@ -758,7 +760,7 @@ class TestSuite(object):
|
|||||||
if self.should_run(rel_path, tests):
|
if self.should_run(rel_path, tests):
|
||||||
basename = path.basename(full_path)[:-3]
|
basename = path.basename(full_path)[:-3]
|
||||||
name = rel_path.split(path.sep)[:-1] + [basename]
|
name = rel_path.split(path.sep)[:-1] + [basename]
|
||||||
if rel_path in self.exclude_list:
|
if rel_path in exclude_list:
|
||||||
print('Excluded: ' + rel_path)
|
print('Excluded: ' + rel_path)
|
||||||
else:
|
else:
|
||||||
if not self.non_strict_only:
|
if not self.non_strict_only:
|
||||||
|
|||||||
Reference in New Issue
Block a user