Net::REPL::Client: Allow read/print portions to be overridden separately.
[thrasher.git] / perl / all_tests.pl
blob426d99cf668b9bc23c5bcedebc0147d47dcd1ca2
1 #!/usr/bin/perl
3 # This file runs all the test suites. From experience I have learned
4 # that you want to make sure all files in the test directory are
5 # accounted for, or you end up forgetting to add tests here.
6 # Thus, this makes you state a USE or IGNORE flag for every file.
7 # It is not an error to IGNORE a file that doesn't exist, to
8 # keep things clean for committing changes to this file before
9 # committing the test script itself.
11 use Test::Harness;
12 use Data::Dumper;
14 my @files = glob('tests/*.pl');
16 sub USE { 1 }
17 sub IGNORE { 0 }
19 # This is borrowed from another source, if it seems a bit overblown.
20 # This makes it mandatory to specify whether you are running a test,
21 # so you can't forget to add it to the suite, while still making it
22 # easy to switch tests in and out.
23 my %FILES =
25 component => USE,
26 xmpp_stream_in => USE,
27 xmpp_stream_out => USE,
28 entity_capabilities => USE,
29 pep_avatar => USE,
30 vcard => USE,
31 test_roster => USE,
32 connection_manager => USE,
33 debug => USE,
34 dbi_backend_mysql_innodb => USE,
35 migrate => USE,
36 xhtml_normalize => USE
39 my @no_entries;
41 @files = map {
42 my $filename = $_;
43 $filename =~ s/tests\///;
44 $filename =~ s/\.pl$//;
45 if (!exists($FILES{$filename})) {
46 push @no_entries, $filename;
48 $FILES{$filename} ? ($_) : ()
49 } @files;
51 if (@no_entries) {
52 die "No \%FILES entries found for: " . join(", ", @no_entries);
55 runtests(@files);