implement stdout/stderr capturing for code-*, gencode-* and manifest

move the relevant tests into their own test case

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>