benchmarks: refactor to allow early exit if tests do not validate