Runtest cleanup for different testing environments.