Port the following changes from Bitcoin Core
```
commit 232b6665bc3e5b134821dc7584968fb439fd5f44
Author: John Newbery <john@johnnewbery.com>
Date: Wed Mar 22 10:26:02 2017 -0400
Allow test cases to be skipped
Currently, functional test cases can either pass or fail. There are
occasions when it is helpful to skip tests, for example if the
system they are running on does not meet the requirements for the test.
The rest of the test suite can run without being marked as a failure.
This commit adds framework for tests to skip if their requirements
aren't met.
```