There is no infrastructure for writing block chain unit tests unfortunately. Last time I tried to fix this I ended up going down a rabbit hole - Bitcoin wasn't written to be a testable codebase and as a result reinitialising it from scratch is rather difficult (there are lots of global variables that have to be reset to particular states and no real list of where they are).
Instead what I ended up doing is extending the pull tester. This is a bitcoinj based app (BitcoindComparisonTool in the codebase) which builds a regtest chain and submits it to a local regtest node. It tests things like reorgs and various rules. It speaks to the node only via P2P so how easy it is to verify your BIP works will depend on that. Also the code needs cleaning up, there's a lot of copy/paste coding going on in there.