Run the test program for a while and then terminate it.