From b4682cb4797b25b7f5d3e05feb95ed4d01dfb393 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sat, 19 Mar 2016 17:24:00 -0400 Subject: [PATCH] * job.c (child_error): Combine file info with error message. * tests/scripts/...: Update error message matches. --- job.c | 7 ++---- tests/scripts/features/errors | 8 +++---- tests/scripts/features/output-sync | 10 ++++---- tests/scripts/features/parallelism | 13 +++++----- tests/scripts/features/patternrules | 7 ++++-- tests/scripts/features/vpathplus | 7 ++++-- tests/scripts/misc/general3 | 2 ++ tests/scripts/options/dash-k | 5 ++-- tests/scripts/targets/DELETE_ON_ERROR | 4 ++-- tests/scripts/targets/POSIX | 3 +-- tests/scripts/variables/SHELL | 3 +-- tests/scripts/variables/special | 34 +++++++++++++-------------- 12 files changed, 51 insertions(+), 52 deletions(-) diff --git a/job.c b/job.c index e6a71c0c..6fa9e8a8 100644 --- a/job.c +++ b/job.c @@ -506,19 +506,16 @@ child_error (struct child *child, OUTPUT_SET (&child->output); - message (0, l + strlen (nm), - _("%s: recipe for target '%s' failed"), nm, f->name); - l += strlen (pre) + strlen (post); if (exit_sig == 0) 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 { const char *s = strsignal (exit_sig); 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 (); diff --git a/tests/scripts/features/errors b/tests/scripts/features/errors index c0339cb6..43b81d4d 100644 --- a/tests/scripts/features/errors +++ b/tests/scripts/features/errors @@ -30,7 +30,7 @@ open(MAKEFILE,"> $makefile"); print MAKEFILE "clean:\n" ."\t-$rm_command cleanit\n" ."\t$rm_command foo\n" - ."clean2: \n" + ."clean2: \n" ."\t$rm_command cleanit\n" ."\t$rm_command foo\n"; @@ -50,8 +50,7 @@ $delete_error_code = $? >> 8; $answer = "$rm_command cleanit $cleanit_error -$makefile:2: recipe for target 'clean' failed -$make_name: [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); @@ -78,8 +77,7 @@ if (!$vos) $answer = "$rm_command cleanit $cleanit_error -$makefile:5: recipe for target 'clean2' failed -$make_name: [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); diff --git a/tests/scripts/features/output-sync b/tests/scripts/features/output-sync index ff3aff1d..ee3e5ad8 100644 --- a/tests/scripts/features/output-sync +++ b/tests/scripts/features/output-sync @@ -204,11 +204,9 @@ bar: end #MAKE#[1]: Entering directory '#PWD#/foo' foo-fail: start foo-fail: end -Makefile:20: recipe for target 'foo-fail' failed -#MAKE#[1]: *** [foo-fail] Error 1 +#MAKE#[1]: *** [Makefile:20: foo-fail] Error 1 #MAKE#[1]: Leaving directory '#PWD#/foo' -#MAKEFILE#:4: recipe for target 'make-foo-fail' failed -#MAKE#: *** [make-foo-fail] Error 2\n", +#MAKE#: *** [#MAKEFILE#:4: make-foo-fail] Error 2\n", 512); # Test the per-job synchronization. @@ -326,7 +324,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#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); @@ -343,7 +341,7 @@ foo: $(OBJS) ; echo $(or $(filter %.o,$^),$(error fail)) run_make_test(q! 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. 1; diff --git a/tests/scripts/features/parallelism b/tests/scripts/features/parallelism index c702c268..6b9efe1b 100644 --- a/tests/scripts/features/parallelism +++ b/tests/scripts/features/parallelism @@ -99,15 +99,12 @@ ok: \@$sleep_command 4 \@echo Ok done", '-rR -j5', "Fail -#MAKEFILE#:6: recipe for target 'fail.1' failed -#MAKE#: *** [fail.1] Error 1 +#MAKE#: *** [#MAKEFILE#:6: fail.1] Error 1 #MAKE#: *** Waiting for unfinished jobs.... Fail -#MAKEFILE#:6: recipe for target 'fail.2' failed -#MAKE#: *** [fail.2] Error 1 +#MAKE#: *** [#MAKEFILE#:6: fail.2] Error 1 Fail -#MAKEFILE#:6: recipe for target 'fail.3' failed -#MAKE#: *** [fail.3] Error 1 +#MAKE#: *** [#MAKEFILE#:6: fail.3] Error 1 Ok done", 512); @@ -214,3 +211,7 @@ rmfiles('file1', 'file2', 'file3', 'file4'); # rmfiles(qw(dependfile output)); 1; + +### Local Variables: +### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) +### End: diff --git a/tests/scripts/features/patternrules b/tests/scripts/features/patternrules index 0ff49a75..c7ae7cff 100644 --- a/tests/scripts/features/patternrules +++ b/tests/scripts/features/patternrules @@ -110,8 +110,7 @@ $(dir)/foo.bar: ', "dir=$dir", -"#MAKEFILE#:6: recipe for target '$dir/foo.bar' failed -#MAKE#: *** [$dir/foo.bar] Error 1", +"#MAKE#: *** [#MAKEFILE#:6: $dir/foo.bar] Error 1", 512); 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. 1; + +### Local Variables: +### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) +### End: diff --git a/tests/scripts/features/vpathplus b/tests/scripts/features/vpathplus index 361788c7..9ade3f0c 100644 --- a/tests/scripts/features/vpathplus +++ b/tests/scripts/features/vpathplus @@ -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 cat notarget.c > notarget.b 2>/dev/null || exit 1 -$makefile:16: recipe for target 'notarget.b' failed -$make_name: *** [notarget.b] Error 1 +$make_name: *** [$makefile:16: notarget.b] Error 1 "; &compare_output($answer,&get_logfile(1)); @@ -127,3 +126,7 @@ rm inter.c unlink @touchedfiles unless $keep; 1; + +### Local Variables: +### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) +### End: diff --git a/tests/scripts/misc/general3 b/tests/scripts/misc/general3 index 8ad0f8e2..7bbff1c2 100644 --- a/tests/scripts/misc/general3 +++ b/tests/scripts/misc/general3 @@ -310,4 +310,6 @@ foo bar hi foo bar'); +run_make_test('x:;@-exit 1', '', "#MAKE#: [#MAKEFILE#:1: x] Error 1 (ignored)\n"); + 1; diff --git a/tests/scripts/options/dash-k b/tests/scripts/options/dash-k index e784e0db..85dd0b0a 100644 --- a/tests/scripts/options/dash-k +++ b/tests/scripts/options/dash-k @@ -42,7 +42,7 @@ close(MAKEFILE); "$workdir${pathsep}command.h", "$workdir${pathsep}commands.c","$workdir${pathsep}display.c", "$workdir${pathsep}buffer.h", - "$workdir${pathsep}command.c"); + "$workdir${pathsep}command.c"); &touch(@files_to_touch); @@ -92,8 +92,7 @@ close(MAKEFILE); &run_make_with_options($makefile2, "-k", &get_logfile, $error_code); $answer = "exit 1 -$makefile2:9: recipe for target 'foo.o' failed -$make_name: *** [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)); diff --git a/tests/scripts/targets/DELETE_ON_ERROR b/tests/scripts/targets/DELETE_ON_ERROR index 08f009fa..db970932 100644 --- a/tests/scripts/targets/DELETE_ON_ERROR +++ b/tests/scripts/targets/DELETE_ON_ERROR @@ -8,7 +8,7 @@ run_make_test(' .DELETE_ON_ERROR: 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(' .DELETE_ON_ERROR: @@ -16,7 +16,7 @@ all: foo.x ; %.x : %.q ; echo > $@ %.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. 1; diff --git a/tests/scripts/targets/POSIX b/tests/scripts/targets/POSIX index a24e3bcf..5c3c7f89 100644 --- a/tests/scripts/targets/POSIX +++ b/tests/scripts/targets/POSIX @@ -17,8 +17,7 @@ run_make_test(qq! .POSIX: all: ; \@$script !, - '', "#MAKEFILE#:3: recipe for target 'all' failed -#MAKE#: *** [all] Error $err\n", 512); + '', "#MAKE#: *** [#MAKEFILE#:3: all] Error $err\n", 512); # User settings must override .POSIX $flags = '-xc'; diff --git a/tests/scripts/variables/SHELL b/tests/scripts/variables/SHELL index 1d01ba3f..edba7b67 100644 --- a/tests/scripts/variables/SHELL +++ b/tests/scripts/variables/SHELL @@ -97,7 +97,6 @@ run_make_test(qq! .SHELLFLAGS = $flags all: ; \@$script !, - '', "$out#MAKEFILE#:3: recipe for target 'all' failed -#MAKE#: *** [all] Error $err\n", 512); + '', "$out#MAKE#: *** [#MAKEFILE#:3: all] Error $err\n", 512); 1; diff --git a/tests/scripts/variables/special b/tests/scripts/variables/special index 2c0b42ca..68f3128c 100644 --- a/tests/scripts/variables/special +++ b/tests/scripts/variables/special @@ -39,9 +39,9 @@ all:;@: # X1 := $(sort $(.TARGETS)) # all: foo -# @echo X1 = $(X1) -# @echo X2 = $(X2) -# @echo LAST = $(sort $(.TARGETS)) +# @echo X1 = $(X1) +# @echo X2 = $(X2) +# @echo LAST = $(sort $(.TARGETS)) # X2 := $(sort $(.TARGETS)) @@ -64,16 +64,16 @@ define foo : foo-one\ foo-two : foo-three - : foo-four + : foo-four endef orig: ; : orig-one - : orig-two \ + : orig-two \ orig-three \ - orig-four \ - orig-five \\\\ - : orig-six - $(foo) + orig-four \ + orig-five \\\\ + : orig-six + $(foo) .RECIPEPREFIX = > test: ; : test-one @@ -86,19 +86,19 @@ test-three \ .RECIPEPREFIX = reset: ; : reset-one - : reset-two \ + : reset-two \ reset-three \ - reset-four \ - reset-five \\\\ - : reset-six - $(foo) + reset-four \ + reset-five \\\\ + : reset-six + $(foo) ', 'orig test reset', ': orig-one : orig-two \ orig-three \ orig-four \ - orig-five \\\\ + orig-five \\\\ : orig-six : foo-one foo-two : foo-three @@ -107,7 +107,7 @@ orig-four \ : test-two \ test-three \ test-four \ - test-five \\\\ + test-five \\\\ : test-six : foo-one foo-two : foo-three @@ -116,7 +116,7 @@ test-four \ : reset-two \ reset-three \ reset-four \ - reset-five \\\\ + reset-five \\\\ : reset-six : foo-one foo-two : foo-three