quattor / maven-tools

Maven-based Build Tools
www.quattor.org
Apache License 2.0
3 stars 12 forks source link

ouput validation in tests #73

Open wdpypere opened 8 years ago

wdpypere commented 8 years ago

It would be very nice to be able to do extra validation on generated files in the tests. For instance if you are generating an XML file with metaconfig that you can actually get the output and run it through an XML parser to see if it's valid. Something for example like:

use Test::More;
use Test::Quattor::TextRender::Metaconfig;
use XML::Parser;

my $u = Test::Quattor::TextRender::Metaconfig->new(
        service => 'some-service',
        )->test();

my $p = XML::Parser->new(Style => 'Tree');
my $t;
eval { $t = $p->parse($u->output); };
ok(! @$, "No XML parsing errors");

done_testing;