automatically generate test source files when possible