Save error log to the dir given and formats html outputs for test reports

Signed-off-by: Junjie Mao <eternal.n08@gmail.com>