servo: Merge #10749 - Prepare related files to make it easier to split up the Mako template (from servo:split-mako); r=nox

https://github.com/servo/servo/pull/10586#issuecomment-211490049

r? @nox

Source-Repo: https://github.com/servo/servo
Source-Revision: 3bfa4cc7414fea760ce5c503bfbcf25262acb9d7
This commit is contained in:
Simon Sapin
2016-04-21 10:08:09 +05:00
parent 740ca759d9
commit c2199fe815
12 changed files with 414 additions and 381 deletions

View File

@@ -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,23 @@ 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")