add self-test and build automated testing process

add self-test and build automated testing process