Improve test script for travis ci