]> Sergey Matveev's repositories - public-inbox.git/commitdiff
tests: document run_mode=1 as not implemented
authorEric Wong <e@yhbt.net>
Tue, 7 Apr 2020 21:55:53 +0000 (21:55 +0000)
committerEric Wong <e@yhbt.net>
Thu, 9 Apr 2020 05:41:55 +0000 (05:41 +0000)
It was implemented at some point, but it was more things to
support and the worst of both worlds: both unrealistic compared
to real-world use and slower than run_mode=2.

Noticed while looking for speling erorrs.

lib/PublicInbox/TestCommon.pm
t/nntpd.t
t/run.perl

index 386610ff5cbf6551eb5eda949ee3d8d1536f1776..6e3e9d8c8f506a92b195f15c4cd558a60b8ef31a 100644 (file)
@@ -119,11 +119,11 @@ sub _undo_redirects ($) {
        }
 }
 
-# $opt->{run_mode} (or $ENV{TEST_RUN_MODE}) allows chosing between
+# $opt->{run_mode} (or $ENV{TEST_RUN_MODE}) allows choosing between
 # three ways to spawn our own short-lived Perl scripts for testing:
 #
 # 0 - (fork|vfork) + execve, the most realistic but slowest
-# 1 - preloading and running in a forked subprocess (fast)
+# 1 - (not currently implemented)
 # 2 - preloading and running in current process (slightly faster than 1)
 #
 # 2 is not compatible with scripts which use "exit" (which we'll try to
@@ -247,7 +247,7 @@ sub wait_for_tail () { sleep(2) }
 sub start_script {
        my ($cmd, $env, $opt) = @_;
        my ($key, @argv) = @$cmd;
-       my $run_mode = $ENV{TEST_RUN_MODE} // $opt->{run_mode} // 1;
+       my $run_mode = $ENV{TEST_RUN_MODE} // $opt->{run_mode} // 2;
        my $sub = $run_mode == 0 ? undef : key2sub($key);
        my $tail_pid;
        if (my $tail_cmd = $ENV{TAIL}) {
index 890850491fac47cf637ea49ee49a61a8b02b9287..43b14d66389ab6544a38b22d453f33e7295f00f7 100644 (file)
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -301,7 +301,7 @@ Date: Fri, 02 Oct 1993 00:00:00 +0000
                is($? >> 8, 0, 'no errors');
        }
        SKIP: {
-               if ($INC{'Search/Xapian.pm'} && ($ENV{TEST_RUN_MODE}//1)) {
+               if ($INC{'Search/Xapian.pm'} && ($ENV{TEST_RUN_MODE}//2)) {
                        skip 'Search/Xapian.pm pre-loaded (by t/run.perl?)', 1;
                }
                my @of = `lsof -p $td->{pid} 2>/dev/null`;
index 3e6801f2b21a6c738eebb54a29fa9f93365328d4..017ca3e82c72be9f2e0665be26121129b3f9ac75 100755 (executable)
@@ -26,7 +26,7 @@ GetOptions('j|jobs=i' => \$jobs,
        'log=s' => \$log_suffix,
        's|shuffle' => \$shuffle,
 ) or die "Usage: $0 [-j JOBS] [--log=SUFFIX] [--repeat RUNS]";
-if (($ENV{TEST_RUN_MODE} // 1) == 0) {
+if (($ENV{TEST_RUN_MODE} // 2) == 0) {
        die "$0 is not compatible with TEST_RUN_MODE=0\n";
 }
 my @tests = scalar(@ARGV) ? @ARGV : glob('t/*.t');