]> Sergey Matveev's repositories - public-inbox.git/blobdiff - Makefile.PL
t/run.perl: to avoid repeated process spawning for *.t
[public-inbox.git] / Makefile.PL
index 0daa6107483214e3169fbfe05f5f0cc1bb74d363..0f50a65852ac6b083a3ca3a8a2f4472372433877 100644 (file)
@@ -84,12 +84,12 @@ my $TGTS = join("\n", map {;
        my $tgt_prereq = $_;
        my $cmds = $t->{$_};
        "$tgt_prereq\n".join('', map { "\t$_\n" } @$cmds);
-} keys %$t);
+} sort keys %$t);
 
 my $VARS = join("\n", map {;
        my $varname = $_;
-       join('', map { "$varname += $_\n" } @{$v->{$varname}});
-} grep(!/^-/, keys %$v));
+       join('', map { "$varname += $_\n" } sort @{$v->{$varname}});
+} grep(!/^-/, sort keys %$v));
 
 # Don't waste user's disk space by installing some pods from
 # imported code or internal use only
@@ -146,6 +146,7 @@ WriteMakefile(
 
 sub MY::postamble {
   <<EOF;
+PROVE = prove
 # support using eatmydata to speed up tests (apt-get install eatmydata):
 # https://www.flamingspork.com/projects/libeatmydata/
 EATMYDATA =
@@ -167,8 +168,16 @@ dsyn :: \$(addsuffix .syntax, \$(filter \$(changed), \$(syn_files)))
 check-manifest :: MANIFEST
        if git ls-files >\$?.gen 2>&1; then diff -u \$? \$?.gen; fi
 
-check:: pure_all check-manifest
-       \$(EATMYDATA) prove -bvw -j\$(N)
+# the traditional way running per-*.t processes:
+check-each :: pure_all check-manifest
+       \$(EATMYDATA) \$(PROVE) --state=save -bvw -j\$(N)
+
+# lightly-tested way to runn tests, relies "--state=save" in check-each
+# for best performance
+check-run :: pure_all check-manifest
+       \$(EATMYDATA) \$(PROVE) -bvw t/run.perl :: -j\$(N)
+
+check :: check-each
 
 lib/PublicInbox/UserContent.pm :: contrib/css/216dark.css
        \$(PERL) -I lib \$@ \$?