add testing and build R file