This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
re/re_tests: Add test
[perl5.git] / t / thread_it.pl
index aa5e18b..f38a580 100644 (file)
@@ -19,7 +19,7 @@ my $caller = (caller)[1];
 die "Can't figure out which test to run from filename '$caller'"
     unless $caller =~ m!((?:op|re)/[-_a-z0-9A-Z]+)_thr\.t\z!;
 
-my $file = "$1.t";
+my $file = "./$1.t";
 
 $::running_as_thread = "running tests in a new thread";
 require $file;
@@ -29,8 +29,14 @@ note('running tests in a new thread');
 # Currently 59*4096 is the minimum stack size to just get t/re/pat_thr.t to
 # pass on HP-UX 64bit PA-RISC. The test for capture buffers (eg \87)
 # recurses heavily, and busts the default stack size (65536 on PA-RISC)
+# On Mac OS X under gcc and g++, the default stack size is also too small.
+# Ditto on VMS, although threshold varies by platform and -Dusevmsdebug.
+# Same on AIX
 my $curr = threads->create({
-                            stack_size => 524288,
+                            stack_size => $^O eq 'hpux'   ? 524288 :
+                                          $^O eq 'darwin' ? 2000000:
+                                          $^O eq 'VMS'    ? 150000 :
+                                          $^O eq 'aix'    ? 1500000 : 0,
                            }, sub {
                               run_tests();
                               return defined &curr_test ? curr_test() : ()