Add "check" framework support. Fixes bug #505622 (Guillaume Desmottes).