{"thread":{"id":"2837","subject":"[PATCH] Do not ignore errors during make check","startedAt":"2005-12-14T21:09:32Z","lastAt":"2005-12-14T23:38:00Z","messageCount":4,"participants":["Amos Waterland","Junio C Hamano","Linus Torvalds"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"13630","messageId":"20051214210932.GA2642@kvasir.watson.ibm.com","threadId":"2837","inReplyTo":null,"subject":"[PATCH] Do not ignore errors during make check","fromName":"Amos Waterland","fromEmail":"apw@us.ibm.com","sentAt":"2005-12-14T21:09:32Z","receivedAt":"2005-12-14T21:09:32Z","isPatch":true,"sender":{"key":"apw@debian.org","avatar":null},"body":"Do not let errors pass by unnoticed when running `make check'.\n\nSigned-off-by: Amos Waterland <apw@us.ibm.com>\n\n---\n\n Makefile |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\n20898ba8a3c6f78bb136626fddc34221df427116\ndiff --git a/Makefile b/Makefile\nindex 01b6643..3f62bcb 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -449,7 +449,7 @@ test-delta$X: test-delta.c diff-delta.o \n \t$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $^\n \n check:\n-\tfor i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i; done\n+\tfor i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || break; done\n \n \n \n-- \n0.99.9.GIT\n"},{"id":"13634","messageId":"7v1x0fxt7b.fsf@assigned-by-dhcp.cox.net","threadId":"2837","inReplyTo":"20051214210932.GA2642@kvasir.watson.ibm.com","subject":"Re: [PATCH] Do not ignore errors during make check","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-12-14T21:30:16Z","receivedAt":"2005-12-14T21:30:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Amos Waterland <apw@us.ibm.com> writes:\n\n> Do not let errors pass by unnoticed when running `make check'.\n> ...\n>  check:\n> -\tfor i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i; done\n> +\tfor i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || break; done\n\nGood point but \"|| exit\" would be more appropriate.  With the\nabove patch, I suspect \"make check\" merely stops at the first\nerror but resulting return code would still be zero, wouldn't\nit?\n\n$ cat Makefile\ncheck1:\n\tfor i in 1 2 3 4; do echo testing $$i; test $$i -le 2 || break; done\n\ncheck2:\n\tfor i in 1 2 3 4; do echo testing $$i; test $$i -le 2 || exit; done\n$ make check1\nfor i in 1 2 3 4; do echo testing $i; test $i -le 2 || break; done\ntesting 1\ntesting 2\ntesting 3\n$ make check2\nfor i in 1 2 3 4; do echo testing $i; test $i -le 2 || exit; done\ntesting 1\ntesting 2\ntesting 3\nmake: *** [check2] Error 1\n$ exit\n"},{"id":"13636","messageId":"20051214214424.GA3730@kvasir.watson.ibm.com","threadId":"2837","inReplyTo":"7v1x0fxt7b.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Do not ignore errors during make check","fromName":"Amos Waterland","fromEmail":"apw@us.ibm.com","sentAt":"2005-12-14T21:44:24Z","receivedAt":"2005-12-14T21:44:24Z","isPatch":true,"sender":{"key":"apw@debian.org","avatar":null},"body":"On Wed, Dec 14, 2005 at 01:30:16PM -0800, Junio C Hamano wrote:\n> Good point but \"|| exit\" would be more appropriate.  With the\n> above patch, I suspect \"make check\" merely stops at the first\n> error but resulting return code would still be zero, wouldn't\n> it?\n\nYes, here is a patch that uses exit instead of break.\n\n---\n\nDo not let errors pass by unnoticed when running `make check'.\n\nSigned-off-by: Amos Waterland <apw@us.ibm.com>\n\n---\n\n Makefile |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\nbc721e2d99487c0240514a848ac1cb84c086e008\ndiff --git a/Makefile b/Makefile\nindex 01b6643..d494ad4 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -449,7 +449,7 @@ test-delta$X: test-delta.c diff-delta.o \n \t$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $^\n \n check:\n-\tfor i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i; done\n+\tfor i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; done\n \n \n \n-- \n0.99.9.GIT\n"},{"id":"13647","messageId":"Pine.LNX.4.64.0512141535130.3292@g5.osdl.org","threadId":"2837","inReplyTo":"20051214210932.GA2642@kvasir.watson.ibm.com","subject":"Re: [PATCH] Do not ignore errors during make check","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-12-14T23:38:00Z","receivedAt":"2005-12-14T23:38:00Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 14 Dec 2005, Amos Waterland wrote:\n>\n>  check:\n> -\tfor i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i; done\n> +\tfor i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || break; done\n\nActually, you might be better off with just\n\n\tsparse $(ALL_CFLAGS) $(SPARSE_FLAGS) *.c\n\nthese days. It will cause some interesting warnings (it actually \ncross-checks things, and is unhappy about multiple \"main()\" declarations \nwith different types ;), but especially with eventual libification it \nmight even be a good idea to try to avoid global functions with the same \nnames in different programs (\"main\", of course, is special, sparse is \njust too stupid to know).\n\n\t\tLinus\n"}]}