mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Merge list_properties.py into build_properties_rs.py
This commit is contained in:
parent
eda711307c
commit
b7eb720c74
5 changed files with 84 additions and 84 deletions
|
@ -141,20 +141,7 @@ class MachCommands(CommandBase):
|
|||
@CommandArgument('test_name', nargs=argparse.REMAINDER,
|
||||
help="Only run tests that match this pattern or file path")
|
||||
def test_unit(self, test_name=None, package=None):
|
||||
subprocess.check_output([
|
||||
sys.executable,
|
||||
path.join(self.context.topdir, "components", "style", "list_properties.py")
|
||||
])
|
||||
|
||||
this_file = os.path.dirname(__file__)
|
||||
servo_doc_path = os.path.abspath(os.path.join(this_file, '../', '../', 'target', 'doc', 'servo'))
|
||||
|
||||
with open(os.path.join(servo_doc_path, 'css-properties.json'), 'r') as property_file:
|
||||
properties = json.loads(property_file.read())
|
||||
|
||||
assert len(properties) >= 100
|
||||
assert "margin-top" in properties
|
||||
assert "margin" in properties
|
||||
check_css_properties_json(self.context.topdir)
|
||||
|
||||
if test_name is None:
|
||||
test_name = []
|
||||
|
@ -670,3 +657,21 @@ testing/web-platform/mozilla/tests for Servo-only tests""" % reference_path)
|
|||
|
||||
if editor:
|
||||
proc.wait()
|
||||
|
||||
|
||||
def check_css_properties_json(topdir):
|
||||
filename = path.join(topdir, "target", "doc", "servo", "css-properties.json")
|
||||
|
||||
if path.exists(filename):
|
||||
os.remove(filename)
|
||||
subprocess.check_call([
|
||||
sys.executable,
|
||||
path.join(topdir, "components", "style", "build_properties_rs.py"),
|
||||
"servo",
|
||||
"html",
|
||||
])
|
||||
properties = json.load(open(filename))
|
||||
|
||||
assert len(properties) >= 100
|
||||
assert "margin-top" in properties
|
||||
assert "margin" in properties
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue