tests for client programs

https://commitfest.postgresql.org/action/patch_view?id=1394
http://archives.postgresql.org/message-id/1391915261.920.1.camel@vanquo.pezone.net