GetEmitOutput function and testfiles

`directory`