diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2016-01-15 15:50:32 +0100 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2016-01-15 15:50:32 +0100 |
commit | 9d29c3d2f52946e02c92ce7c31ac74433c2c6f8e (patch) | |
tree | f59489e7402e93cf83d611c690d88ff1a5409922 | |
parent | 679d1280dd0581621ed55cafc3a863d39ecd6934 (diff) | |
download | servo-9d29c3d2f52946e02c92ce7c31ac74433c2c6f8e.tar.gz servo-9d29c3d2f52946e02c92ce7c31ac74433c2c6f8e.zip |
Add a script to list all CSS properties parsed by Servo.
-rwxr-xr-x | components/style/list_properties.py | 14 | ||||
-rw-r--r-- | python/servo/testing_commands.py | 8 |
2 files changed, 22 insertions, 0 deletions
diff --git a/components/style/list_properties.py b/components/style/list_properties.py new file mode 100755 index 00000000000..a787cbb8706 --- /dev/null +++ b/components/style/list_properties.py @@ -0,0 +1,14 @@ +#!/bin/env python2.7 + +import os.path +import sys + +style = os.path.dirname(__file__) +sys.path.insert(0, os.path.join(style, "Mako-0.9.1.zip")) + +from mako.template import Template +template = Template(filename=os.path.join(style, "properties.mako.rs"), input_encoding='utf8') +template.render() +properties = template.module.LONGHANDS + template.module.SHORTHANDS +for name in sorted(p.name for p in properties): + print(name) diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index 9892a0e6669..80d4515c8e4 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -158,6 +158,14 @@ 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): + properties = subprocess.check_output([ + sys.executable, + path.join(self.context.topdir, "components", "style", "list_properties.py") + ]).splitlines() + assert len(properties) >= 100 + assert "margin-top" in properties + assert "margin" in properties + if test_name is None: test_name = [] |