1N/A# This is written in a peculiar style, since we're trying to avoid 1N/A# most of the constructs we'll be testing for. 1N/A# Let tests know they're running in the perl core. Useful for modules 1N/A# which live dual lives on CPAN. 1N/A# remove empty elements due to insertion of empty symbols via "''p1'" syntax 1N/A# Cheesy version of Getopt::Std. Maybe we should replace it with that. 1N/Adie "You need to run \"make test\" first to set things up.\n" 1N/A# check leakage for embedders 1N/A# Roll your own File::Find! 1N/A # In VMS protect with doublequotes because otherwise 1N/A # DCL will lowercase -- unless already doublequoted. 1N/A if (m!^(ext/\S+/?(?:[^/\s]+\.t|test\.pl)|lib/\S+?(?:\.t|test\.pl))\s!) { 1N/A# Tests known to cause infinite loops for the perlcc tests. 1N/A------------------------------------------------------------------------------ 1N/A------------------------------------------------------------------------------ 1N/A------------------------------------------------------------------------------ 1N/A------------------------------------------------------------------------------ 1N/A print <<EOT if ($type eq 'bytecompile'); 1N/A------------------------------------------------------------------------------ 1N/ATESTING BYTECODE COMPILER 1N/A------------------------------------------------------------------------------ 1N/A # + 3 : we want three dots between the test name and the "ok" 1N/A # Redefinition happens at compile time 1N/A # B::Deparse doesn't support source filtering 1N/A if ($^O ne 'VMS') { # defer printing on VMS due to piping bug 1N/A if (/#!.*\bperl.*\s-\w*([tT])/) { 1N/A # not all tests are expected to pass with this option 1N/A # Look for #line directives which change the filename 1N/A if /^#\s*line\s+(\d+)\s+((\w+)|"([^"]+)")/; 1N/A . "--leak-resolution=high --show-reachable=yes " 1N/A . "--num-callers=50 --logfile-fd=3 $perl"; 1N/A # -O9 for good measure, -fcog is broken ATM 1N/A # hopefully unused name... 1N/Aopen HACK, '.\\perl $pl2c $test_executable |'; 1N/A# cl.exe prints the name of the .c file on stdout (\%^\$^#) 1N/Awhile(<HACK>) {m/^\\w+\\.[cC]\$/ && next;print} 1N/Aopen HACK, '$test_executable |'; 1N/Awhile(<HACK>) {print} 1N/A next if /^\s*$/; # skip blank lines 1N/A if (/^1\.\.([0-9]+)( todo ([\d ]+))?/) { 1N/A if (/^(not )?ok (\d+)[^\#]*(\s*\#.*)?/) { 1N/A die "FAILED--Further testing stopped" . ($1 ? ": $1\n" : ".\n"); 1N/A $errors += $1; # there may be multiple error summaries 1N/A # test if the compiler compiled something 1N/A print "Test did not compile\n"; 1N/A print "${te}skipping test on this platform\n"; 1N/A die "Failed a basic test--cannot continue.\n"; 1N/A print "All tests successful.\n"; 1N/A # XXX add mention of 'perlbug -ok' ? 1N/A die "FAILED--no tests were run for some reason.\n"; 1N/A### Since not all tests were successful, you may want to run some of 1N/A### them individually and examine any diagnostic messages they produce. 1N/A### See the INSTALL document's section on "make test". 1N/A### You have a good chance to get more information by running 1N/A### in the 't' directory since most (>=80%) of the tests succeeded. 1N/A### You may have to set your dynamic library search path, 1N/A### $p, to point to the build directory: 1N/A### setenv $p `pwd`:\$$p; cd t; ./perl harness 1N/A### $p=`pwd`:\$$p; export $p; cd t; ./perl harness 1N/A### export $p=`pwd`:\$$p; cd t; ./perl harness 1N/A### setenv $p `pwd`; cd t; ./perl harness 1N/A### $p=`pwd`; export $p; cd t; ./perl harness 1N/A### export $p=`pwd`; cd t; ./perl harness 1N/A### for csh-style shells, like tcsh; or for traditional/modern 1N/A### Bourne-style shells, like bash, ksh, and zsh, respectively. 1N/A print sprintf("u=%g s=%g cu=%g cs=%g scripts=%d tests=%d\n",