GetEmitOutput And Testfiles

Why do you need shouldEmitDeclaration now?  You should get rid of it and using hasSemanticErrors + .declaration flag instead to determine if declaration generation is needed