#!/usr/bin/perl

use warnings;
use strict;
use File::stat;
use XML::LibXML;

my $hs_name = 'test.hs';
my $xml_name = 'test.xml';

my $hs_stat = stat($hs_name) or die "$hs_name not found";
my $xml_stat = stat($xml_name);
if (!$xml_stat or $xml_stat->mtime < $hs_stat->mtime) {
  system 'stack', 'test.hs', '--xml', $xml_name;
}

my $dom = XML::LibXML->load_xml(location => $xml_name);

$, = "\n---\n";
$\ = "\n";
print $dom->findnodes('/testsuites/testsuite/testsuite');
