gecko/testing/mozbase/manifestparser
Andrew Halberstadt 0c069fd2ef Bug 1123763 - [manifestparser] Implement filter system for manifest.active_tests(), r=ted
A filter is a callable that accepts an iterable of tests and a dictionary of values (e.g mozinfo.info) and returns an iterable of tests. Note filtering can mean modifying tests in addition to removing them. For example, this implements a "timeout-if" tag in the manifest:

    from manifestparser import expression
    import mozinfo

    def timeout_if(tests, values):
        for test in tests:
            if 'timeout-if' in test:
                timeout, condition = test['timeout-if'].split(',', 1)
                if expression.parse(condition, **values):
                    test['timeout'] = timeout
        yield test

    tests = mp.active_tests(filters=[timeout_if], **mozinfo.info)
2015-02-10 09:38:29 -05:00
..
manifestparser Bug 1123763 - [manifestparser] Implement filter system for manifest.active_tests(), r=ted 2015-02-10 09:38:29 -05:00
tests Bug 1123763 - [manifestparser] Implement filter system for manifest.active_tests(), r=ted 2015-02-10 09:38:29 -05:00
setup.py Bug 1123763 - [manifestparser] Implement filter system for manifest.active_tests(), r=ted 2015-02-10 09:38:29 -05:00