瀏覽代碼

Meta: Disallow importing ref tests with multiple match or mismatch links

Our internal test runner does not currently support this, so let's
explicitly disallow it for now to avoid potential confusion.
Tim Ledbetter 7 月之前
父節點
當前提交
9c63785d0f
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      Meta/import-wpt-test.py

+ 4 - 0
Meta/import-wpt-test.py

@@ -79,13 +79,17 @@ class TestTypeIdentifier(HTMLParser):
         self.url = url
         self.url = url
         self.test_type = TestType.TEXT
         self.test_type = TestType.TEXT
         self.reference_path = None
         self.reference_path = None
+        self.ref_test_link_found = False
 
 
     def handle_starttag(self, tag, attrs):
     def handle_starttag(self, tag, attrs):
         if tag == "link":
         if tag == "link":
             attr_dict = dict(attrs)
             attr_dict = dict(attrs)
             if attr_dict["rel"] == "match" or attr_dict["rel"] == "mismatch":
             if attr_dict["rel"] == "match" or attr_dict["rel"] == "mismatch":
+                if self.ref_test_link_found:
+                    raise RuntimeError("Ref tests with multiple match or mismatch links are not currently supported")
                 self.test_type = TestType.REF
                 self.test_type = TestType.REF
                 self.reference_path = attr_dict["href"]
                 self.reference_path = attr_dict["href"]
+                self.ref_test_link_found = True
 
 
 
 
 def map_to_path(sources, is_resource=True, resource_path=None):
 def map_to_path(sources, is_resource=True, resource_path=None):