content/canvas/test/webgl-conformance/writemanifest.py

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 #!/usr/bin/env python
michael@0 2 #
michael@0 3 # This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 # License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 6 #
michael@0 7 # Write a Mochitest manifest for WebGL conformance test files.
michael@0 8
michael@0 9 import os
michael@0 10 from itertools import chain
michael@0 11
michael@0 12 CONFORMANCE_DIRS = [
michael@0 13 "conformance",
michael@0 14 "resources",
michael@0 15 ]
michael@0 16
michael@0 17 def listfiles(dir, rel):
michael@0 18 """List all files in dir recursively, yielding paths
michael@0 19 relative to rel.
michael@0 20 """
michael@0 21 for root, folders, files in os.walk(dir):
michael@0 22 for f in files:
michael@0 23 yield os.path.relpath(os.path.join(root, f), rel)
michael@0 24
michael@0 25 def writemanifest():
michael@0 26 script_dir = os.path.dirname(__file__)
michael@0 27 list_dirs = [os.path.join(script_dir, d) for d in CONFORMANCE_DIRS]
michael@0 28 with open(os.path.join(script_dir, 'mochitest-conformance-files.ini'), 'w') as f:
michael@0 29 f.write("""[DEFAULT]
michael@0 30 support-files =
michael@0 31 %s
michael@0 32 """ % "\n ".join(sorted(chain.from_iterable(listfiles(d, script_dir)
michael@0 33 for d in list_dirs))))
michael@0 34
michael@0 35 if __name__ == '__main__':
michael@0 36 writemanifest()
michael@0 37

mercurial