]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* tests/run_make_tests.pl: Add file/lineno info to .run file.
authorPaul Smith <psmith@gnu.org>
Mon, 4 Apr 2016 05:16:13 +0000 (01:16 -0400)
committerPaul Smith <psmith@gnu.org>
Mon, 4 Apr 2016 05:38:37 +0000 (01:38 -0400)
tests/run_make_tests.pl

index 7005f10b19cffc60ce3039213f7132f34c6c03b7..916f3467309bf50bd0a8def8db7d13754b94b2c2 100644 (file)
@@ -140,6 +140,7 @@ sub subst_make_string
 sub run_make_test
 {
   local ($makestring, $options, $answer, $err_code, $timeout) = @_;
+  my @call = caller;
 
   # If the user specified a makefile string, create a new makefile to contain
   # it.  If the first value is not defined, use the last one (if there is
@@ -171,7 +172,7 @@ sub run_make_test
   }
 
   run_make_with_options($makefile, $options, &get_logfile(0),
-                        $err_code, $timeout);
+                        $err_code, $timeout, @call);
   &compare_output($answer, &get_logfile(1));
 
   $old_makefile = $makefile;
@@ -180,7 +181,8 @@ sub run_make_test
 
 # The old-fashioned way...
 sub run_make_with_options {
-  local ($filename,$options,$logname,$expected_code,$timeout) = @_;
+  my ($filename,$options,$logname,$expected_code,$timeout,@call) = @_;
+  @call = caller unless @call;
   local($code);
   local($command) = $make_path;
 
@@ -231,7 +233,11 @@ sub run_make_with_options {
     $command .= " $options";
   }
 
-  $command_string = "$command\n";
+  $command_string = "";
+  if (@call) {
+      $command_string = "#$call[1]:$call[2]\n";
+  }
+  $command_string .= "$command\n";
 
   if ($valgrind) {
     print VALGRIND "\n\nExecuting: $command\n";