Extract coverage-specific code out of compiletest::runtest
#125719
Merged
compiletest::runtest
#125719