From: Paul Smith Date: Mon, 4 Apr 2016 05:16:13 +0000 (-0400) Subject: * tests/run_make_tests.pl: Add file/lineno info to .run file. X-Git-Tag: 4.1.90~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65115e7095e1232e590c8920e7f828706a67fa4a;p=thirdparty%2Fmake.git * tests/run_make_tests.pl: Add file/lineno info to .run file. --- diff --git a/tests/run_make_tests.pl b/tests/run_make_tests.pl index 7005f10b..916f3467 100644 --- a/tests/run_make_tests.pl +++ b/tests/run_make_tests.pl @@ -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";