make output print as tests run instead of waiting till end

@drevell can u review please.
We should check whether the last byte is a newline before removing it