author Gregory Szorc <>
Tue, 17 Jun 2014 17:37:09 -0700
changeset 210618 ab997ac497a0bb14d6d91cddce91085a13275431
parent 123455 febc983734f78e05d0fe287cbe22ed7396f2e0cc
permissions -rw-r--r--
Bug 1027215 - Rewrite to use new manifest parser; r=roc Now that we've established a slightly better Python reftest manifest parser, switch the existing manifest parsing code in to use it.

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at

import os
import sys
from reftest import ReftestManifest

def printTestDirs(topsrcdir, topmanifests):
    """Parse |topmanifests| and print a list of directories containing the tests
    within (and the manifests including those tests), relative to |topsrcdir|.
    topsrcdir = os.path.abspath(topsrcdir)
    dirs = set()
    for path in topmanifests:
        m = ReftestManifest()
        dirs |= m.dirs

    for d in sorted(dirs):
        d = d[len(topsrcdir):].replace('\\', '/').lstrip('/')

if __name__ == '__main__':
    if len(sys.argv) < 3:
      print >>sys.stderr, "Usage: %s topsrcdir reftest.list [reftest.list]*" % sys.argv[0]
    printTestDirs(sys.argv[1], sys.argv[2:])