Wrapping a program and checking the output