added switch functionality to testall