ninja: add support for build-time tests

Also: how long do these take? I wonder if we want to just run by default.