VirtualBox

Ignore:
Timestamp:
Jun 17, 2012 8:45:31 PM (12 years ago)
Author:
bird
Message:

kmk: Merged in changes from GNU make 3.82. Previous GNU make base version was gnumake-2008-10-28-CVS.

Location:
trunk/src/kmk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk

    • Property svn:ignore
      •  

        old new  
        1313stamp-*
        1414makebook*
         15
        1516.*gdbinit
         17.gdb_history
         18
        1619*.dep
        1720*.dvi
         
        3134*.pg
        3235*.pgs
         36
        3337README
        3438README.DOS
        3539README.W32
         40README.OS2
        3641aclocal.m4
        3742autom4te.cache
         
        5257config.h.W32
        5358config.h-vms
         59
        5460loadavg
        5561loadavg.c
        5662make
         63
        5764.deps
        5865.dep_segment
         66ID
         67TAGS
         68
        5969_*
        6070sun4
         
        7282sol2
        7383i486-linux
         84
        7485customs
         86
        7587install-sh
        7688mkinstalldirs
         89
         90.directive.asc
  • trunk/src/kmk/tests

    • Property svn:ignore
      --- 
      +++ 
      
  • trunk/src/kmk/tests/run_make_tests.pl

    r1993 r2591  
    1313
    1414# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
    15 # 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
     15# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
     16# Foundation, Inc.
    1617# This file is part of GNU Make.
    1718#
     
    2930# this program.  If not, see <http://www.gnu.org/licenses/>.
    3031
     32
    3133$valgrind = 0;              # invoke make with valgrind
    32 $valgrind_args = '--num-callers=15 --tool=memcheck --leak-check=full';
     34$valgrind_args = '';
     35$memcheck_args = '--num-callers=15 --tool=memcheck --leak-check=full';
     36$massif_args = '--num-callers=15 --tool=massif --alloc-fn=xmalloc --alloc-fn=xcalloc --alloc-fn=xrealloc --alloc-fn=xstrdup --alloc-fn=xstrndup';
    3337$pure_log = undef;
     38
     39$command_string = '';
     40
     41$all_tests = 0;
    3442
    3543require "test_driver.pl";
     
    4452   local($option) = @_;
    4553
    46    if ($option =~ /^-make([-_]?path)?$/)
    47    {
    48       $make_path = shift @argv;
    49       if (!-f $make_path)
    50       {
    51          print "$option $make_path: Not found.\n";
    52          exit 0;
    53       }
    54       return 1;
    55    }
    56 
    57    if ($option =~ /^-valgrind$/i) {
    58      $valgrind = 1;
    59      return 1;
     54   if ($option =~ /^-make([-_]?path)?$/i) {
     55       $make_path = shift @argv;
     56       if (!-f $make_path) {
     57           print "$option $make_path: Not found.\n";
     58           exit 0;
     59       }
     60       return 1;
     61   }
     62
     63   if ($option =~ /^-all([-_]?tests)?$/i) {
     64       $all_tests = 1;
     65       return 1;
     66   }
     67
     68   if ($option =~ /^-(valgrind|memcheck)$/i) {
     69       $valgrind = 1;
     70       $valgrind_args = $memcheck_args;
     71       return 1;
     72   }
     73
     74   if ($option =~ /^-massif$/i) {
     75       $valgrind = 1;
     76       $valgrind_args = $massif_args;
     77       return 1;
    6078   }
    6179
     
    106124    $makestring =~ s/#MAKEPATH#/$mkpath/g;
    107125    $makestring =~ s/#MAKE#/$make_name/g;
     126    $makestring =~ s/#PERL#/$perl_name/g;
    108127    $makestring =~ s/#PWD#/$pwd/g;
    109128
     
    120139  $answer =~ s/#MAKEPATH#/$mkpath/g;
    121140  $answer =~ s/#MAKE#/$make_name/g;
     141  $answer =~ s/#PERL#/$perl_name/g;
    122142  $answer =~ s/#PWD#/$pwd/g;
    123143
     
    149169  }
    150170
     171  $command_string = "$command\n";
     172
    151173  if ($valgrind) {
    152174    print VALGRIND "\n\nExecuting: $command\n";
     
    156178  {
    157179      my $old_timeout = $test_timeout;
    158       $test_timeout = $timeout if $timeout;
     180      $timeout and $test_timeout = $timeout;
     181
     182      # If valgrind is enabled, turn off the timeout check
     183      $valgrind and $test_timeout = 0;
    159184
    160185      $code = &run_command_with_output($logname,$command);
     
    184209    print "Error running $make_path (expected $expected_code; got $code): $command\n";
    185210    $test_passed = 0;
     211    $runf = &get_runfile;
     212    &create_file (&get_runfile, $command_string);
    186213    # If it's a SIGINT, stop here
    187214    if ($code & 127) {
    188215      print STDERR "\nCaught signal ".($code & 127)."!\n";
    189       exit($code);
     216      ($code & 127) == 2 and exit($code);
    190217    }
    191218    return 0;
     
    196223  }
    197224
    198   1;
     225  return 1;
    199226}
    200227
     
    202229{
    203230   &print_standard_usage ("run_make_tests",
    204                           "[-make_path make_pathname] [-valgrind]",);
     231                          "[-make_path make_pathname] [-memcheck] [-massif]",);
    205232}
    206233
    207234sub print_help
    208235{
    209    &print_standard_help ("-make_path",
    210           "\tYou may specify the pathname of the copy of make to run.");
     236   &print_standard_help (
     237        "-make_path",
     238        "\tYou may specify the pathname of the copy of make to run.",
     239        "-valgrind",
     240        "-memcheck",
     241        "\tRun the test suite under valgrind's memcheck tool.",
     242        "\tChange the default valgrind args with the VALGRIND_ARGS env var.",
     243        "-massif",
     244        "\tRun the test suite under valgrind's massif toool.",
     245        "\tChange the default valgrind args with the VALGRIND_ARGS env var."
     246       );
    211247}
    212248
     
    336372
    337373   if ($valgrind) {
     374     my $args = $valgrind_args;
    338375     open(VALGRIND, "> valgrind.out")
    339376       || die "Cannot open valgrind.out: $!\n";
    340377     #  -q --leak-check=yes
    341      exists $ENV{VALGRIND_ARGS} and $valgrind_args = $ENV{VALGRIND_ARGS};
    342      $make_path = "valgrind --log-fd=".fileno(VALGRIND)." $valgrind_args $make_path";
     378     exists $ENV{VALGRIND_ARGS} and $args = $ENV{VALGRIND_ARGS};
     379     $make_path = "valgrind --log-fd=".fileno(VALGRIND)." $args $make_path";
    343380     # F_SETFD is 2
    344381     fcntl(VALGRIND, 2, 0) or die "fcntl(setfd) failed: $!\n";
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette