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.)

TEST=python3 -m unittest discover -p *

Change-Id: Ic155c9f1a2b7b442c025fde460c503f3ce9c6c50
Commit-Queue: Andrew Lamb <>
Tested-by: Andrew Lamb <>
Reviewed-by: David Burger <>
2 files changed