GetEmitOutput function and testfiles

We need to change the emitFiles result to give you an indication on whether the declaration file was emitted or not. you should only check on syntactic/global errors, and emitFiles should take care of the rest.