Added support for generating test sources. Added an integration test for
it.