Test for cfg building.

This actually took quite a bit of infrastructure to setup. However, now
tests can visualize themselves (by placing pictures in the resources
directory).

Signed-off-by: Tim Henderson <tim.tadh@gmail.com>