move pia_res_to_output to common test helpers