Module Name: src Committed By: rillig Date: Sat Aug 21 11:50:57 UTC 2021
Modified Files: src/tests/usr.bin/xlint/lint1: lex_char_uchar.c lex_integer.c lex_integer_ilp32.c msg_142.c msg_230.c msg_230_uchar.c msg_259.c msg_259_ilp32.c op_shl_lp64.c t_integration.sh Log Message: tests/lint: guard against typos in test environment configuration Some tests had "lint1-only-if" without a trailing colon, others included the trailing colon. The tests that included the trailing colon were run even though they were supposed to be skipped, and they failed, as could be expected. To prevent further typos, always require the trailing colon, just as in "lint1-flags" and fail fast on unknown "lint1" comments. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/lex_char_uchar.c cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/lex_integer.c cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c \ src/tests/usr.bin/xlint/lint1/msg_259_ilp32.c \ src/tests/usr.bin/xlint/lint1/op_shl_lp64.c cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_142.c cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_230.c cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_230_uchar.c cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/xlint/lint1/msg_259.c cvs rdiff -u -r1.68 -r1.69 src/tests/usr.bin/xlint/lint1/t_integration.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/usr.bin/xlint/lint1/lex_char_uchar.c diff -u src/tests/usr.bin/xlint/lint1/lex_char_uchar.c:1.3 src/tests/usr.bin/xlint/lint1/lex_char_uchar.c:1.4 --- src/tests/usr.bin/xlint/lint1/lex_char_uchar.c:1.3 Tue Jun 29 21:33:09 2021 +++ src/tests/usr.bin/xlint/lint1/lex_char_uchar.c Sat Aug 21 11:50:57 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lex_char_uchar.c,v 1.3 2021/06/29 21:33:09 rillig Exp $ */ +/* $NetBSD: lex_char_uchar.c,v 1.4 2021/08/21 11:50:57 rillig Exp $ */ # 3 "lex_char_uchar.c" /* @@ -6,7 +6,7 @@ * char has the same representation as unsigned char. */ -/* lint1-only-if uchar */ +/* lint1-only-if: uchar */ /* * Before inittyp.c 1.23 from 2021-06-29, the following initialization Index: src/tests/usr.bin/xlint/lint1/lex_integer.c diff -u src/tests/usr.bin/xlint/lint1/lex_integer.c:1.6 src/tests/usr.bin/xlint/lint1/lex_integer.c:1.7 --- src/tests/usr.bin/xlint/lint1/lex_integer.c:1.6 Tue Jul 13 19:38:10 2021 +++ src/tests/usr.bin/xlint/lint1/lex_integer.c Sat Aug 21 11:50:57 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lex_integer.c,v 1.6 2021/07/13 19:38:10 rillig Exp $ */ +/* $NetBSD: lex_integer.c,v 1.7 2021/08/21 11:50:57 rillig Exp $ */ # 3 "lex_integer.c" /* @@ -7,7 +7,7 @@ * C99 6.4.4.1 "Integer constants" */ -/* lint1-only-if lp64 */ +/* lint1-only-if: lp64 */ void sinki(int); void sinku(unsigned int); Index: src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c diff -u src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c:1.2 src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c:1.3 --- src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c:1.2 Tue Jun 29 13:58:13 2021 +++ src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c Sat Aug 21 11:50:57 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lex_integer_ilp32.c,v 1.2 2021/06/29 13:58:13 rillig Exp $ */ +/* $NetBSD: lex_integer_ilp32.c,v 1.3 2021/08/21 11:50:57 rillig Exp $ */ # 3 "lex_integer_ilp32.c" /* @@ -7,7 +7,7 @@ * C99 6.4.4.1 "Integer constants" */ -/* lint1-only-if ilp32 */ +/* lint1-only-if: ilp32 */ void sinki(int); void sinku(unsigned int); Index: src/tests/usr.bin/xlint/lint1/msg_259_ilp32.c diff -u src/tests/usr.bin/xlint/lint1/msg_259_ilp32.c:1.2 src/tests/usr.bin/xlint/lint1/msg_259_ilp32.c:1.3 --- src/tests/usr.bin/xlint/lint1/msg_259_ilp32.c:1.2 Tue Jun 29 13:58:13 2021 +++ src/tests/usr.bin/xlint/lint1/msg_259_ilp32.c Sat Aug 21 11:50:57 2021 @@ -1,9 +1,9 @@ -/* $NetBSD: msg_259_ilp32.c,v 1.2 2021/06/29 13:58:13 rillig Exp $ */ +/* $NetBSD: msg_259_ilp32.c,v 1.3 2021/08/21 11:50:57 rillig Exp $ */ # 3 "msg_259_ilp32.c" // Test for message: argument #%d is converted from '%s' to '%s' due to prototype [259] -/* lint1-only-if ilp32 */ +/* lint1-only-if: ilp32 */ /* lint1-extra-flags: -h */ void farg_char(char); Index: src/tests/usr.bin/xlint/lint1/op_shl_lp64.c diff -u src/tests/usr.bin/xlint/lint1/op_shl_lp64.c:1.2 src/tests/usr.bin/xlint/lint1/op_shl_lp64.c:1.3 --- src/tests/usr.bin/xlint/lint1/op_shl_lp64.c:1.2 Sat Jul 31 19:52:44 2021 +++ src/tests/usr.bin/xlint/lint1/op_shl_lp64.c Sat Aug 21 11:50:57 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: op_shl_lp64.c,v 1.2 2021/07/31 19:52:44 rillig Exp $ */ +/* $NetBSD: op_shl_lp64.c,v 1.3 2021/08/21 11:50:57 rillig Exp $ */ # 3 "op_shl_lp64.c" /* @@ -11,7 +11,7 @@ * These warnings had been discovered in ecp_nistp256.c(296). */ -/* lint1-only-if lp64 */ +/* lint1-only-if: lp64 */ const __uint128_t zero105 = (((__uint128_t)1) << 105) Index: src/tests/usr.bin/xlint/lint1/msg_142.c diff -u src/tests/usr.bin/xlint/lint1/msg_142.c:1.5 src/tests/usr.bin/xlint/lint1/msg_142.c:1.6 --- src/tests/usr.bin/xlint/lint1/msg_142.c:1.5 Tue Jul 13 19:11:35 2021 +++ src/tests/usr.bin/xlint/lint1/msg_142.c Sat Aug 21 11:50:57 2021 @@ -1,9 +1,9 @@ -/* $NetBSD: msg_142.c,v 1.5 2021/07/13 19:11:35 rillig Exp $ */ +/* $NetBSD: msg_142.c,v 1.6 2021/08/21 11:50:57 rillig Exp $ */ # 3 "msg_142.c" // Test for message: floating point overflow detected, op %s [142] -/* lint1-only-if ldbl-64 */ +/* lint1-only-if: ldbl-64 */ /* * For 96-bit and 128-bit floating point numbers, a different number of * multipliers is needed to produce an overflow. Index: src/tests/usr.bin/xlint/lint1/msg_230.c diff -u src/tests/usr.bin/xlint/lint1/msg_230.c:1.4 src/tests/usr.bin/xlint/lint1/msg_230.c:1.5 --- src/tests/usr.bin/xlint/lint1/msg_230.c:1.4 Sat Jul 3 19:31:22 2021 +++ src/tests/usr.bin/xlint/lint1/msg_230.c Sat Aug 21 11:50:57 2021 @@ -1,10 +1,10 @@ -/* $NetBSD: msg_230.c,v 1.4 2021/07/03 19:31:22 rillig Exp $ */ +/* $NetBSD: msg_230.c,v 1.5 2021/08/21 11:50:57 rillig Exp $ */ # 3 "msg_230.c" // Test for message: nonportable character comparison, op %s [230] /* lint1-flags: -S -g -p -w */ -/* lint1-only-if schar */ +/* lint1-only-if: schar */ void example(char c, unsigned char uc, signed char sc) { Index: src/tests/usr.bin/xlint/lint1/msg_230_uchar.c diff -u src/tests/usr.bin/xlint/lint1/msg_230_uchar.c:1.1 src/tests/usr.bin/xlint/lint1/msg_230_uchar.c:1.2 --- src/tests/usr.bin/xlint/lint1/msg_230_uchar.c:1.1 Sat Jul 3 19:31:22 2021 +++ src/tests/usr.bin/xlint/lint1/msg_230_uchar.c Sat Aug 21 11:50:57 2021 @@ -1,10 +1,10 @@ -/* $NetBSD: msg_230_uchar.c,v 1.1 2021/07/03 19:31:22 rillig Exp $ */ +/* $NetBSD: msg_230_uchar.c,v 1.2 2021/08/21 11:50:57 rillig Exp $ */ # 3 "msg_230_uchar.c" // Test for message: nonportable character comparison, op %s [230] /* lint1-flags: -S -g -p -w */ -/* lint1-only-if uchar */ +/* lint1-only-if: uchar */ void example(char c, unsigned char uc, signed char sc) { Index: src/tests/usr.bin/xlint/lint1/msg_259.c diff -u src/tests/usr.bin/xlint/lint1/msg_259.c:1.10 src/tests/usr.bin/xlint/lint1/msg_259.c:1.11 --- src/tests/usr.bin/xlint/lint1/msg_259.c:1.10 Sat Aug 21 11:19:38 2021 +++ src/tests/usr.bin/xlint/lint1/msg_259.c Sat Aug 21 11:50:57 2021 @@ -1,9 +1,9 @@ -/* $NetBSD: msg_259.c,v 1.10 2021/08/21 11:19:38 rillig Exp $ */ +/* $NetBSD: msg_259.c,v 1.11 2021/08/21 11:50:57 rillig Exp $ */ # 3 "msg_259.c" // Test for message: argument #%d is converted from '%s' to '%s' due to prototype [259] -/* lint1-only-if lp64 */ +/* lint1-only-if: lp64 */ /* lint1-extra-flags: -h */ void farg_char(char); Index: src/tests/usr.bin/xlint/lint1/t_integration.sh diff -u src/tests/usr.bin/xlint/lint1/t_integration.sh:1.68 src/tests/usr.bin/xlint/lint1/t_integration.sh:1.69 --- src/tests/usr.bin/xlint/lint1/t_integration.sh:1.68 Tue Jul 13 18:50:16 2021 +++ src/tests/usr.bin/xlint/lint1/t_integration.sh Sat Aug 21 11:50:57 2021 @@ -1,4 +1,4 @@ -# $NetBSD: t_integration.sh,v 1.68 2021/07/13 18:50:16 rillig Exp $ +# $NetBSD: t_integration.sh,v 1.69 2021/08/21 11:50:57 rillig Exp $ # # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. # All rights reserved. @@ -85,11 +85,16 @@ configure_test_case() flags = "" for (i = 3; i < NF; i++) flags = flags " " $i + } else if ($2 == "lint1-only-if:") { + if (!platform_has($3)) + skip = "yes" + } else if ($2 == "lint1-skip-if:") { + if (platform_has($3)) + skip = "yes" + } else { + printf("bad lint1 comment '\''%s'\''\n", $2) > "/dev/stderr" + exit(1) } - if ($2 == "lint1-only-if" && !platform_has($3)) - skip = "yes" - if ($2 == "lint1-skip-if" && platform_has($3)) - skip = "yes" } END {