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