[autotest] make Suite constructor accept list of predicates

This CL refactors some of the test-hunting predicate logic, to make it
easier (in a future CL) for test_that kicked off at a user's desk to
schedule ad-hoc suites, either in the lab or at their desk.

Prior to this CL, the `predicate` argument to Suite's constructor was a
single callable that mapped ControlData objects to Booleans (True =
include in suite, False = exclude from suite). After this CL, Suite's
constructor will also accept a list of callables for the `predicate`
argument. If a list is supplied the predicates in the list will be
logically ANDed to create the predicate used to hunt for tests.

This CL also adds a new predicate factory, for predicates that matche
Control Files based on test name.

BUG=chromium:246750
TEST=relevant unit tests pass; kicked off a suite in local autotest and
it ran

Change-Id: Idb48669f9da44cff9efdbe57ac08537a27747433
Reviewed-on: https://gerrit.chromium.org/gerrit/57552
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Alex Miller <milleral@chromium.org>
Commit-Queue: Aviv Keshet <akeshet@chromium.org>
1 file changed