Fix build and update testmain for test results.