* job.c (child_error): Modify error message string.

Ensure Emacs compile-mode's next-error doesn't match target failure
messages.  Syntax errors in makefiles are still matched.
This commit is contained in:
Paul Smith 2017-10-28 18:45:30 -04:00
parent b9c25de370
commit 6264deece3
12 changed files with 24 additions and 21 deletions

7
job.c
View File

@ -553,8 +553,11 @@ child_error (struct child *child,
nm = _("<builtin>");
else
{
char *a = alloca (strlen (flocp->filenm) + 1 + 11 + 1);
sprintf (a, "%s:%lu", flocp->filenm, flocp->lineno + flocp->offset);
/* We can't use the standard <FILE>:<LINENO> syntax here because
Emacs misinterprets it and matches a bogus filename in the compile
buffer. */
char *a = alloca (strlen (flocp->filenm) + 6 + INTSTR_LENGTH + 1);
sprintf (a, "%s;%lu", flocp->filenm, flocp->lineno + flocp->offset);
nm = a;
}

View File

@ -50,7 +50,7 @@ $delete_error_code = $? >> 8;
$answer = "$rm_command cleanit
$cleanit_error
$make_name: [$makefile:2: clean] Error $delete_error_code (ignored)
$make_name: [$makefile;2: clean] Error $delete_error_code (ignored)
$rm_command foo\n";
&run_make_with_options($makefile,"",&get_logfile);
@ -77,7 +77,7 @@ if (!$vos)
$answer = "$rm_command cleanit
$cleanit_error
$make_name: [$makefile:5: clean2] Error $delete_error_code (ignored)
$make_name: [$makefile;5: clean2] Error $delete_error_code (ignored)
$rm_command foo\n";
&run_make_with_options($makefile,"clean2 -i",&get_logfile);
@ -98,7 +98,7 @@ all:
@echo there
@exit 1
!,
'', "hi\nthere\n#MAKE#: *** [#MAKEFILE#:5: all] Error 1", 512);
'', "hi\nthere\n#MAKE#: *** [#MAKEFILE#;5: all] Error 1", 512);
1;

View File

@ -221,7 +221,7 @@ include inc1
inc1: foo; echo > $@
foo:; exit 1
!,
'', "exit 1\n#MAKEFILE#:3: inc1: $ERR_no_such_file\n#MAKE#: *** [#MAKEFILE#:5: foo] Error 1\n", 512);
'', "exit 1\n#MAKEFILE#:3: inc1: $ERR_no_such_file\n#MAKE#: *** [#MAKEFILE#;5: foo] Error 1\n", 512);
rmfiles('inc1');

View File

@ -206,9 +206,9 @@ bar: end
#MAKE#[1]: Entering directory '#PWD#/foo'
foo-fail: start
foo-fail: end
#MAKE#[1]: *** [Makefile:23: foo-fail] Error 1
#MAKE#[1]: *** [Makefile;23: foo-fail] Error 1
#MAKE#[1]: Leaving directory '#PWD#/foo'
#MAKE#: *** [#MAKEFILE#:4: make-foo-fail] Error 2\n",
#MAKE#: *** [#MAKEFILE#;4: make-foo-fail] Error 2\n",
512);
# Test the per-job synchronization.
@ -326,7 +326,7 @@ run_make_test(qq!
all: t1
t1: ; -\@\$(MAKE) -f $m1
!,
"-j -Oline", "#MAKE#[1]: Entering directory '#PWD#'\nd1 stderr\nd1 stdout\n$m1:3: *** d1 failed. Stop.\n#MAKE#[1]: Leaving directory '#PWD#'\n#MAKE#: [#MAKEFILE#:3: t1] Error 2 (ignored)\n");
"-j -Oline", "#MAKE#[1]: Entering directory '#PWD#'\nd1 stderr\nd1 stdout\n$m1:3: *** d1 failed. Stop.\n#MAKE#[1]: Leaving directory '#PWD#'\n#MAKE#: [#MAKEFILE#;3: t1] Error 2 (ignored)\n");
rmfiles($m1);
@ -343,7 +343,7 @@ if ($port_type ne 'W32') {
run_make_test(q!
all:: ; @./foo bar baz
!,
'-O', "#MAKE#: ./foo: Command not found\n#MAKE#: *** [#MAKEFILE#:2: all] Error 127\n", 512);
'-O', "#MAKE#: ./foo: Command not found\n#MAKE#: *** [#MAKEFILE#;2: all] Error 127\n", 512);
}
# This tells the test driver that the perl test script executed properly.

View File

@ -99,12 +99,12 @@ ok:
\@$sleep_command 4
\@echo Ok done",
'-rR -j5', "Fail
#MAKE#: *** [#MAKEFILE#:8: fail.1] Error 1
#MAKE#: *** [#MAKEFILE#;8: fail.1] Error 1
#MAKE#: *** Waiting for unfinished jobs....
Fail
#MAKE#: *** [#MAKEFILE#:8: fail.2] Error 1
#MAKE#: *** [#MAKEFILE#;8: fail.2] Error 1
Fail
#MAKE#: *** [#MAKEFILE#:8: fail.3] Error 1
#MAKE#: *** [#MAKEFILE#;8: fail.3] Error 1
Ok done",
512);

View File

@ -110,7 +110,7 @@ $(dir)/foo.bar:
',
"dir=$dir",
"#MAKE#: *** [#MAKEFILE#:6: $dir/foo.bar] Error 1",
"#MAKE#: *** [#MAKEFILE#;6: $dir/foo.bar] Error 1",
512);
unlink("$dir/foo.bar");

View File

@ -83,7 +83,7 @@ cat ${VP}foo.c bar.c > foo.b 2>/dev/null || exit 1
$answer = "not creating notarget.c from notarget.d
cat notarget.c > notarget.b 2>/dev/null || exit 1
$make_name: *** [$makefile:13: notarget.b] Error 1
$make_name: *** [$makefile;13: notarget.b] Error 1
";
&compare_output($answer,&get_logfile(1));

View File

@ -310,6 +310,6 @@ foo bar
hi
foo bar');
run_make_test('x:;@-exit 1', '', "#MAKE#: [#MAKEFILE#:1: x] Error 1 (ignored)\n");
run_make_test('x:;@-exit 1', '', "#MAKE#: [#MAKEFILE#;1: x] Error 1 (ignored)\n");
1;

View File

@ -92,7 +92,7 @@ close(MAKEFILE);
&run_make_with_options($makefile2, "-k", &get_logfile, $error_code);
$answer = "exit 1
$make_name: *** [$makefile2:9: foo.o] Error 1
$make_name: *** [$makefile2;9: foo.o] Error 1
$make_name: Target 'all' not remade because of errors.\n";
&compare_output($answer, &get_logfile(1));

View File

@ -8,7 +8,7 @@ run_make_test('
.DELETE_ON_ERROR:
all: ; exit 1 > $@
',
'', "exit 1 > all\n#MAKE#: *** [#MAKEFILE#:3: all] Error 1\n#MAKE#: *** Deleting file 'all'", 512);
'', "exit 1 > all\n#MAKE#: *** [#MAKEFILE#;3: all] Error 1\n#MAKE#: *** Deleting file 'all'", 512);
run_make_test('
.DELETE_ON_ERROR:
@ -16,7 +16,7 @@ all: foo.x ;
%.x : %.q ; echo > $@
%.q : ; exit 1 > $@
',
'', "exit 1 > foo.q\n#MAKE#: *** [#MAKEFILE#:5: foo.q] Error 1\n#MAKE#: *** Deleting file 'foo.q'", 512);
'', "exit 1 > foo.q\n#MAKE#: *** [#MAKEFILE#;5: foo.q] Error 1\n#MAKE#: *** Deleting file 'foo.q'", 512);
# This tells the test driver that the perl test script executed properly.
1;

View File

@ -17,7 +17,7 @@ run_make_test(qq!
.POSIX:
all: ; \@$script
!,
'', "#MAKE#: *** [#MAKEFILE#:3: all] Error $err\n", 512);
'', "#MAKE#: *** [#MAKEFILE#;3: all] Error $err\n", 512);
# User settings must override .POSIX
$flags = '-xc';

View File

@ -102,6 +102,6 @@ run_make_test(qq!
.SHELLFLAGS = $flags
all: ; \@$script
!,
'', "$out#MAKE#: *** [#MAKEFILE#:3: all] Error $err\n", 512);
'', "$out#MAKE#: *** [#MAKEFILE#;3: all] Error $err\n", 512);
1;