added autotest functionality
merge from master