add tests to samples

This PR integrates the work of @PK1A and adds minimal testing for all samples.