Add checker.ConstraintSuite.

- A ConstraintSuite is subclassed to define constraints,
similar to how unittest.TestCase is subclassed to define
test methods.
- Right now just checks the instance for methods named
"check..." and runs them. A check method should raise
an exception if a constraint is violated. Check methods
are passed a program and project ConfigBundle.
- Will improve error reporting in the future (e.g. run all
checks instead of failing on the first one, return names
of failing checks, etc.)

BUG=chromium:1051187
TEST=python3 -m unittest discover -p *test.py

Change-Id: Ic155c9f1a2b7b442c025fde460c503f3ce9c6c50
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/config/+/2054750
Commit-Queue: Andrew Lamb <andrewlamb@chromium.org>
Tested-by: Andrew Lamb <andrewlamb@chromium.org>
Reviewed-by: David Burger <dburger@chromium.org>
2 files changed