add -V/--variables option in the tests.py
and fixup the bug of TestEnd not flush out in exit error code