Commit 20610f18 authored by Kai Ninomiya's avatar Kai Ninomiya Committed by Commit Bot

[Partial reland] Fix extract_expectation_names.py for recent refactor

Previously reviewed on:
https://chromium-review.googlesource.com/c/chromium/src/+/2050036

Change-Id: I4dac360647610047b04024ef8cb6c2a12d8f164e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2097297Reviewed-by: default avatarRobert Ma <robertma@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748938}
parent 2d4dfc85
...@@ -7,7 +7,11 @@ ...@@ -7,7 +7,11 @@
# Given an expectations file (e.g. web_tests/WebGPUExpectations), extracts only # Given an expectations file (e.g. web_tests/WebGPUExpectations), extracts only
# the test name from each expectation (e.g. wpt_internal/webgpu/cts.html?...). # the test name from each expectation (e.g. wpt_internal/webgpu/cts.html?...).
from blinkpy.web_tests.models.test_expectations import TestExpectationLine from blinkpy.common import path_finder
path_finder.add_typ_dir_to_sys_path()
from typ.expectations_parser import TaggedTestListParser
import sys import sys
...@@ -19,9 +23,7 @@ class StubPort(object): ...@@ -19,9 +23,7 @@ class StubPort(object):
filename = sys.argv[1] filename = sys.argv[1]
with open(filename) as f: with open(filename) as f:
port = StubPort() port = StubPort()
line_number = 1 parser = TaggedTestListParser(f.read())
for line in f: for test_expectation in parser.expectations:
test_expectation = TestExpectationLine.tokenize_line(filename, line, line_number, port) if test_expectation.test:
if test_expectation.name: print test_expectation.test
print test_expectation.name
line_number += 1
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment