mirror of
https://github.com/servo/servo.git
synced 2025-06-16 04:14:29 +00:00
Make css-properties.json checking a proper unit test.
This commit is contained in:
parent
cb42be9827
commit
a3b271266c
5 changed files with 57 additions and 24 deletions
|
@ -14,8 +14,6 @@ import re
|
|||
import sys
|
||||
import os
|
||||
import os.path as path
|
||||
import subprocess
|
||||
import json
|
||||
from collections import OrderedDict
|
||||
from time import time
|
||||
|
||||
|
@ -141,8 +139,6 @@ 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):
|
||||
check_css_properties_json(self.context.topdir)
|
||||
|
||||
if test_name is None:
|
||||
test_name = []
|
||||
|
||||
|
@ -657,23 +653,3 @@ testing/web-platform/mozilla/tests for Servo-only tests""" % reference_path)
|
|||
|
||||
if editor:
|
||||
proc.wait()
|
||||
|
||||
|
||||
def check_css_properties_json(topdir):
|
||||
print("Testing generation of css-properties.json...")
|
||||
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", "properties", "build.py"),
|
||||
"servo",
|
||||
"html",
|
||||
])
|
||||
properties = json.load(open(filename))
|
||||
|
||||
assert len(properties) >= 100
|
||||
assert "margin-top" in properties
|
||||
assert "margin" in properties
|
||||
print("OK")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue