backport testrunner from master branch