package TestDpkgParsechangelog; use base qw(DpkgTest::FunctionalTest); sub set_up { my $self = shift; $self->{program} = $self->dpkg_perl_script('dpkg-parsechangelog.pl'); } sub test_output_files { my $self = shift; my $path = 'dpkg-parsechangelog'; opendir TEST_DIR, $path; my $num_of_tests = 0; foreach my $input_file (readdir TEST_DIR) { next if $input_file =~ /^\./; next unless $input_file =~ /-input$/; $num_of_tests++; my $basename = "$path/$input_file"; $basename =~ s/-input$//o; my $expected_stdout = "$basename-output"; $self->assert_output("$self->{program} -l$path/$input_file", expected_stdout_file => $expected_stdout); } closedir TEST_DIR; $self->assert($num_of_tests > 0, "There were no tests in $path"); } 1;