[PATCH 22/30] test: Move test running into a separate function