Changeset 2596 in kBuild for vendor/gnumake/current/tests/test_driver.pl
- Timestamp:
- Jun 19, 2012 10:44:52 PM (12 years ago)
- Location:
- vendor/gnumake/current
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/gnumake/current
- Property svn:ignore deleted
-
vendor/gnumake/current/tests
- Property svn:ignore deleted
-
vendor/gnumake/current/tests/test_driver.pl
r1989 r2596 7 7 # 8 8 # Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 9 # 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. 9 # 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software 10 # Foundation, Inc. 10 11 # This file is part of GNU Make. 11 12 # … … 30 31 # variables and then calls &toplevel, which does all the real work. 31 32 32 # $Id: test_driver.pl,v 1. 24 2007/11/04 21:54:02psmith Exp $33 # $Id: test_driver.pl,v 1.30 2010/07/28 05:39:50 psmith Exp $ 33 34 34 35 … … 54 55 $test_timeout = 5; 55 56 57 # Path to Perl 58 $perl_name = $^X; 56 59 57 60 # %makeENV is the cleaned-out environment. … … 236 239 { 237 240 # Set up an initial value. In perl5 we can do it the easy way. 238 #239 241 $osname = defined($^O) ? $^O : ''; 242 243 # Find a path to Perl 240 244 241 245 # See if the filesystem supports long file names with multiple … … 273 277 if ($osname =~ /not found/i) 274 278 { 275 $osname = "(something unixy with no uname)";279 $osname = "(something posixy with no uname)"; 276 280 } 277 281 elsif ($@ ne "" || $?) … … 280 284 if ($@ ne "" || $?) 281 285 { 282 $osname = "(something unixy)";286 $osname = "(something posixy)"; 283 287 } 284 288 } … … 436 440 $diffext = 'd'; 437 441 $baseext = 'b'; 442 $runext = 'r'; 438 443 $extext = ''; 439 444 } else { … … 441 446 $diffext = 'diff'; 442 447 $baseext = 'base'; 448 $runext = 'run'; 443 449 $extext = '.'; 444 450 } … … 446 452 $diff_filename = "$testpath.$diffext"; 447 453 $base_filename = "$testpath.$baseext"; 454 $run_filename = "$testpath.$runext"; 448 455 $tmp_filename = "$testpath.$tmpfilesuffix"; 449 456 … … 459 466 $tests_run = 0; 460 467 $tests_passed = 0; 468 461 469 $code = do $perl_testname; 462 470 … … 692 700 693 701 &create_file (&get_basefile, $answer); 702 &create_file (&get_runfile, $command_string); 694 703 695 704 print "\nCreating Difference File ...\n" if $debug; … … 699 708 local($command) = "diff -c " . &get_basefile . " " . $logfile; 700 709 &run_command_with_output(&get_difffile,$command); 710 } else { 711 &rmfiles (); 701 712 } 702 713 … … 792 803 local $SIG{ALRM} = sub { die "timeout\n"; }; 793 804 alarm $test_timeout; 794 $code = system @_;805 $code = system(@_); 795 806 alarm 0; 796 807 }; … … 829 840 my $filename = shift; 830 841 831 print "\nrun_command_with_output($filename ): @_\n" if $debug;842 print "\nrun_command_with_output($filename,$runname): @_\n" if $debug; 832 843 &attach_default_output ($filename); 833 844 my $code = _run_command(@_); … … 1202 1213 } 1203 1214 1215 # This subroutine returns a command filename with a number appended 1216 # to the end corresponding to how many logfiles (and thus command files) 1217 # have been created in the current running test. 1218 1219 sub get_runfile 1220 { 1221 return ($run_filename . &num_suffix ($num_of_logfiles)); 1222 } 1223 1204 1224 # just like logfile, only a generic tmp filename for use by the test. 1205 1225 # they are automatically cleaned up unless -keep was used, or the test fails.
Note:
See TracChangeset
for help on using the changeset viewer.

