[PATCH 05/22] buildman: Split out testOutput() into separate functions