mirror of
https://github.com/mirror/make.git
synced 2025-02-07 10:10:23 +08:00
* job.c (child_error): Combine file info with error message.
* tests/scripts/...: Update error message matches.
This commit is contained in:
parent
09202bc880
commit
b4682cb479
7
job.c
7
job.c
@ -506,19 +506,16 @@ child_error (struct child *child,
|
|||||||
|
|
||||||
OUTPUT_SET (&child->output);
|
OUTPUT_SET (&child->output);
|
||||||
|
|
||||||
message (0, l + strlen (nm),
|
|
||||||
_("%s: recipe for target '%s' failed"), nm, f->name);
|
|
||||||
|
|
||||||
l += strlen (pre) + strlen (post);
|
l += strlen (pre) + strlen (post);
|
||||||
|
|
||||||
if (exit_sig == 0)
|
if (exit_sig == 0)
|
||||||
error (NILF, l + INTSTR_LENGTH,
|
error (NILF, l + INTSTR_LENGTH,
|
||||||
_("%s[%s] Error %d%s"), pre, f->name, exit_code, post);
|
_("%s[%s: %s] Error %d%s"), pre, nm, f->name, exit_code, post);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const char *s = strsignal (exit_sig);
|
const char *s = strsignal (exit_sig);
|
||||||
error (NILF, l + strlen (s) + strlen (dump),
|
error (NILF, l + strlen (s) + strlen (dump),
|
||||||
_("%s[%s] %s%s%s"), pre, f->name, s, dump, post);
|
"%s[%s: %s] %s%s%s", pre, nm, f->name, s, dump, post);
|
||||||
}
|
}
|
||||||
|
|
||||||
OUTPUT_UNSET ();
|
OUTPUT_UNSET ();
|
||||||
|
@ -30,7 +30,7 @@ open(MAKEFILE,"> $makefile");
|
|||||||
print MAKEFILE "clean:\n"
|
print MAKEFILE "clean:\n"
|
||||||
."\t-$rm_command cleanit\n"
|
."\t-$rm_command cleanit\n"
|
||||||
."\t$rm_command foo\n"
|
."\t$rm_command foo\n"
|
||||||
."clean2: \n"
|
."clean2: \n"
|
||||||
."\t$rm_command cleanit\n"
|
."\t$rm_command cleanit\n"
|
||||||
."\t$rm_command foo\n";
|
."\t$rm_command foo\n";
|
||||||
|
|
||||||
@ -50,8 +50,7 @@ $delete_error_code = $? >> 8;
|
|||||||
|
|
||||||
$answer = "$rm_command cleanit
|
$answer = "$rm_command cleanit
|
||||||
$cleanit_error
|
$cleanit_error
|
||||||
$makefile:2: recipe for target 'clean' failed
|
$make_name: [$makefile:2: clean] Error $delete_error_code (ignored)
|
||||||
$make_name: [clean] Error $delete_error_code (ignored)
|
|
||||||
$rm_command foo\n";
|
$rm_command foo\n";
|
||||||
|
|
||||||
&run_make_with_options($makefile,"",&get_logfile);
|
&run_make_with_options($makefile,"",&get_logfile);
|
||||||
@ -78,8 +77,7 @@ if (!$vos)
|
|||||||
|
|
||||||
$answer = "$rm_command cleanit
|
$answer = "$rm_command cleanit
|
||||||
$cleanit_error
|
$cleanit_error
|
||||||
$makefile:5: recipe for target 'clean2' failed
|
$make_name: [$makefile:5: clean2] Error $delete_error_code (ignored)
|
||||||
$make_name: [clean2] Error $delete_error_code (ignored)
|
|
||||||
$rm_command foo\n";
|
$rm_command foo\n";
|
||||||
|
|
||||||
&run_make_with_options($makefile,"clean2 -i",&get_logfile);
|
&run_make_with_options($makefile,"clean2 -i",&get_logfile);
|
||||||
|
@ -204,11 +204,9 @@ bar: end
|
|||||||
#MAKE#[1]: Entering directory '#PWD#/foo'
|
#MAKE#[1]: Entering directory '#PWD#/foo'
|
||||||
foo-fail: start
|
foo-fail: start
|
||||||
foo-fail: end
|
foo-fail: end
|
||||||
Makefile:20: recipe for target 'foo-fail' failed
|
#MAKE#[1]: *** [Makefile:20: foo-fail] Error 1
|
||||||
#MAKE#[1]: *** [foo-fail] Error 1
|
|
||||||
#MAKE#[1]: Leaving directory '#PWD#/foo'
|
#MAKE#[1]: Leaving directory '#PWD#/foo'
|
||||||
#MAKEFILE#:4: recipe for target 'make-foo-fail' failed
|
#MAKE#: *** [#MAKEFILE#:4: make-foo-fail] Error 2\n",
|
||||||
#MAKE#: *** [make-foo-fail] Error 2\n",
|
|
||||||
512);
|
512);
|
||||||
|
|
||||||
# Test the per-job synchronization.
|
# Test the per-job synchronization.
|
||||||
@ -326,7 +324,7 @@ run_make_test(qq!
|
|||||||
all: t1
|
all: t1
|
||||||
t1: ; -\@\$(MAKE) -f $m1
|
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#MAKEFILE#:3: recipe for target 't1' failed\n#MAKE#: [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);
|
rmfiles($m1);
|
||||||
|
|
||||||
@ -343,7 +341,7 @@ foo: $(OBJS) ; echo $(or $(filter %.o,$^),$(error fail))
|
|||||||
run_make_test(q!
|
run_make_test(q!
|
||||||
all:: ; @./foo bar baz
|
all:: ; @./foo bar baz
|
||||||
!,
|
!,
|
||||||
'-O', "#MAKE#: ./foo: Command not found\n#MAKEFILE#:2: recipe for target 'all' failed\n#MAKE#: *** [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.
|
# This tells the test driver that the perl test script executed properly.
|
||||||
1;
|
1;
|
||||||
|
@ -99,15 +99,12 @@ ok:
|
|||||||
\@$sleep_command 4
|
\@$sleep_command 4
|
||||||
\@echo Ok done",
|
\@echo Ok done",
|
||||||
'-rR -j5', "Fail
|
'-rR -j5', "Fail
|
||||||
#MAKEFILE#:6: recipe for target 'fail.1' failed
|
#MAKE#: *** [#MAKEFILE#:6: fail.1] Error 1
|
||||||
#MAKE#: *** [fail.1] Error 1
|
|
||||||
#MAKE#: *** Waiting for unfinished jobs....
|
#MAKE#: *** Waiting for unfinished jobs....
|
||||||
Fail
|
Fail
|
||||||
#MAKEFILE#:6: recipe for target 'fail.2' failed
|
#MAKE#: *** [#MAKEFILE#:6: fail.2] Error 1
|
||||||
#MAKE#: *** [fail.2] Error 1
|
|
||||||
Fail
|
Fail
|
||||||
#MAKEFILE#:6: recipe for target 'fail.3' failed
|
#MAKE#: *** [#MAKEFILE#:6: fail.3] Error 1
|
||||||
#MAKE#: *** [fail.3] Error 1
|
|
||||||
Ok done",
|
Ok done",
|
||||||
512);
|
512);
|
||||||
|
|
||||||
@ -214,3 +211,7 @@ rmfiles('file1', 'file2', 'file3', 'file4');
|
|||||||
# rmfiles(qw(dependfile output));
|
# rmfiles(qw(dependfile output));
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
|
### Local Variables:
|
||||||
|
### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
|
||||||
|
### End:
|
||||||
|
@ -110,8 +110,7 @@ $(dir)/foo.bar:
|
|||||||
|
|
||||||
',
|
',
|
||||||
"dir=$dir",
|
"dir=$dir",
|
||||||
"#MAKEFILE#:6: recipe for target '$dir/foo.bar' failed
|
"#MAKE#: *** [#MAKEFILE#:6: $dir/foo.bar] Error 1",
|
||||||
#MAKE#: *** [$dir/foo.bar] Error 1",
|
|
||||||
512);
|
512);
|
||||||
|
|
||||||
unlink("$dir/foo.bar");
|
unlink("$dir/foo.bar");
|
||||||
@ -223,3 +222,7 @@ all: foo.x foo-mt.x
|
|||||||
|
|
||||||
# This tells the test driver that the perl test script executed properly.
|
# This tells the test driver that the perl test script executed properly.
|
||||||
1;
|
1;
|
||||||
|
|
||||||
|
### Local Variables:
|
||||||
|
### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
|
||||||
|
### End:
|
||||||
|
@ -86,8 +86,7 @@ cat ${VP}foo.c bar.c > foo.b 2>/dev/null || exit 1
|
|||||||
|
|
||||||
$answer = "not creating notarget.c from notarget.d
|
$answer = "not creating notarget.c from notarget.d
|
||||||
cat notarget.c > notarget.b 2>/dev/null || exit 1
|
cat notarget.c > notarget.b 2>/dev/null || exit 1
|
||||||
$makefile:16: recipe for target 'notarget.b' failed
|
$make_name: *** [$makefile:16: notarget.b] Error 1
|
||||||
$make_name: *** [notarget.b] Error 1
|
|
||||||
";
|
";
|
||||||
|
|
||||||
&compare_output($answer,&get_logfile(1));
|
&compare_output($answer,&get_logfile(1));
|
||||||
@ -127,3 +126,7 @@ rm inter.c
|
|||||||
unlink @touchedfiles unless $keep;
|
unlink @touchedfiles unless $keep;
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
|
### Local Variables:
|
||||||
|
### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
|
||||||
|
### End:
|
||||||
|
@ -310,4 +310,6 @@ foo bar
|
|||||||
hi
|
hi
|
||||||
foo bar');
|
foo bar');
|
||||||
|
|
||||||
|
run_make_test('x:;@-exit 1', '', "#MAKE#: [#MAKEFILE#:1: x] Error 1 (ignored)\n");
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -42,7 +42,7 @@ close(MAKEFILE);
|
|||||||
"$workdir${pathsep}command.h",
|
"$workdir${pathsep}command.h",
|
||||||
"$workdir${pathsep}commands.c","$workdir${pathsep}display.c",
|
"$workdir${pathsep}commands.c","$workdir${pathsep}display.c",
|
||||||
"$workdir${pathsep}buffer.h",
|
"$workdir${pathsep}buffer.h",
|
||||||
"$workdir${pathsep}command.c");
|
"$workdir${pathsep}command.c");
|
||||||
|
|
||||||
&touch(@files_to_touch);
|
&touch(@files_to_touch);
|
||||||
|
|
||||||
@ -92,8 +92,7 @@ close(MAKEFILE);
|
|||||||
&run_make_with_options($makefile2, "-k", &get_logfile, $error_code);
|
&run_make_with_options($makefile2, "-k", &get_logfile, $error_code);
|
||||||
|
|
||||||
$answer = "exit 1
|
$answer = "exit 1
|
||||||
$makefile2:9: recipe for target 'foo.o' failed
|
$make_name: *** [$makefile2:9: foo.o] Error 1
|
||||||
$make_name: *** [foo.o] Error 1
|
|
||||||
$make_name: Target 'all' not remade because of errors.\n";
|
$make_name: Target 'all' not remade because of errors.\n";
|
||||||
|
|
||||||
&compare_output($answer, &get_logfile(1));
|
&compare_output($answer, &get_logfile(1));
|
||||||
|
@ -8,7 +8,7 @@ run_make_test('
|
|||||||
.DELETE_ON_ERROR:
|
.DELETE_ON_ERROR:
|
||||||
all: ; false > $@
|
all: ; false > $@
|
||||||
',
|
',
|
||||||
'', "false > all\n#MAKEFILE#:3: recipe for target 'all' failed\n#MAKE#: *** [all] Error 1\n#MAKE#: *** Deleting file 'all'", 512);
|
'', "false > all\n#MAKE#: *** [#MAKEFILE#:3: all] Error 1\n#MAKE#: *** Deleting file 'all'", 512);
|
||||||
|
|
||||||
run_make_test('
|
run_make_test('
|
||||||
.DELETE_ON_ERROR:
|
.DELETE_ON_ERROR:
|
||||||
@ -16,7 +16,7 @@ all: foo.x ;
|
|||||||
%.x : %.q ; echo > $@
|
%.x : %.q ; echo > $@
|
||||||
%.q : ; false > $@
|
%.q : ; false > $@
|
||||||
',
|
',
|
||||||
'', "false > foo.q\n#MAKEFILE#:5: recipe for target 'foo.q' failed\n#MAKE#: *** [foo.q] Error 1\n#MAKE#: *** Deleting file 'foo.q'", 512);
|
'', "false > 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.
|
# This tells the test driver that the perl test script executed properly.
|
||||||
1;
|
1;
|
||||||
|
@ -17,8 +17,7 @@ run_make_test(qq!
|
|||||||
.POSIX:
|
.POSIX:
|
||||||
all: ; \@$script
|
all: ; \@$script
|
||||||
!,
|
!,
|
||||||
'', "#MAKEFILE#:3: recipe for target 'all' failed
|
'', "#MAKE#: *** [#MAKEFILE#:3: all] Error $err\n", 512);
|
||||||
#MAKE#: *** [all] Error $err\n", 512);
|
|
||||||
|
|
||||||
# User settings must override .POSIX
|
# User settings must override .POSIX
|
||||||
$flags = '-xc';
|
$flags = '-xc';
|
||||||
|
@ -97,7 +97,6 @@ run_make_test(qq!
|
|||||||
.SHELLFLAGS = $flags
|
.SHELLFLAGS = $flags
|
||||||
all: ; \@$script
|
all: ; \@$script
|
||||||
!,
|
!,
|
||||||
'', "$out#MAKEFILE#:3: recipe for target 'all' failed
|
'', "$out#MAKE#: *** [#MAKEFILE#:3: all] Error $err\n", 512);
|
||||||
#MAKE#: *** [all] Error $err\n", 512);
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -39,9 +39,9 @@ all:;@:
|
|||||||
# X1 := $(sort $(.TARGETS))
|
# X1 := $(sort $(.TARGETS))
|
||||||
|
|
||||||
# all: foo
|
# all: foo
|
||||||
# @echo X1 = $(X1)
|
# @echo X1 = $(X1)
|
||||||
# @echo X2 = $(X2)
|
# @echo X2 = $(X2)
|
||||||
# @echo LAST = $(sort $(.TARGETS))
|
# @echo LAST = $(sort $(.TARGETS))
|
||||||
|
|
||||||
# X2 := $(sort $(.TARGETS))
|
# X2 := $(sort $(.TARGETS))
|
||||||
|
|
||||||
@ -64,16 +64,16 @@ define foo
|
|||||||
: foo-one\
|
: foo-one\
|
||||||
foo-two
|
foo-two
|
||||||
: foo-three
|
: foo-three
|
||||||
: foo-four
|
: foo-four
|
||||||
endef
|
endef
|
||||||
|
|
||||||
orig: ; : orig-one
|
orig: ; : orig-one
|
||||||
: orig-two \
|
: orig-two \
|
||||||
orig-three \
|
orig-three \
|
||||||
orig-four \
|
orig-four \
|
||||||
orig-five \\\\
|
orig-five \\\\
|
||||||
: orig-six
|
: orig-six
|
||||||
$(foo)
|
$(foo)
|
||||||
|
|
||||||
.RECIPEPREFIX = >
|
.RECIPEPREFIX = >
|
||||||
test: ; : test-one
|
test: ; : test-one
|
||||||
@ -86,19 +86,19 @@ test-three \
|
|||||||
|
|
||||||
.RECIPEPREFIX =
|
.RECIPEPREFIX =
|
||||||
reset: ; : reset-one
|
reset: ; : reset-one
|
||||||
: reset-two \
|
: reset-two \
|
||||||
reset-three \
|
reset-three \
|
||||||
reset-four \
|
reset-four \
|
||||||
reset-five \\\\
|
reset-five \\\\
|
||||||
: reset-six
|
: reset-six
|
||||||
$(foo)
|
$(foo)
|
||||||
',
|
',
|
||||||
'orig test reset',
|
'orig test reset',
|
||||||
': orig-one
|
': orig-one
|
||||||
: orig-two \
|
: orig-two \
|
||||||
orig-three \
|
orig-three \
|
||||||
orig-four \
|
orig-four \
|
||||||
orig-five \\\\
|
orig-five \\\\
|
||||||
: orig-six
|
: orig-six
|
||||||
: foo-one foo-two
|
: foo-one foo-two
|
||||||
: foo-three
|
: foo-three
|
||||||
@ -107,7 +107,7 @@ orig-four \
|
|||||||
: test-two \
|
: test-two \
|
||||||
test-three \
|
test-three \
|
||||||
test-four \
|
test-four \
|
||||||
test-five \\\\
|
test-five \\\\
|
||||||
: test-six
|
: test-six
|
||||||
: foo-one foo-two
|
: foo-one foo-two
|
||||||
: foo-three
|
: foo-three
|
||||||
@ -116,7 +116,7 @@ test-four \
|
|||||||
: reset-two \
|
: reset-two \
|
||||||
reset-three \
|
reset-three \
|
||||||
reset-four \
|
reset-four \
|
||||||
reset-five \\\\
|
reset-five \\\\
|
||||||
: reset-six
|
: reset-six
|
||||||
: foo-one foo-two
|
: foo-one foo-two
|
||||||
: foo-three
|
: foo-three
|
||||||
|
Loading…
Reference in New Issue
Block a user