Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/usr.bin/xlint/lint1 lint: allow tests to specify addit...
details: https://anonhg.NetBSD.org/src/rev/ddf35bf63e6e
branches: trunk
changeset: 979740:ddf35bf63e6e
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Jan 09 14:33:53 2021 +0000
description:
lint: allow tests to specify additional flags
Several of the tests only need to add the -p flag. Mentioning the
(current) default flags in each of these tests is redundant. Therefore,
allow them to specify "lint1-extra-flags: -p" instead of the current
"lint1-flags: -g -S -w -p".
diffstat:
tests/usr.bin/xlint/lint1/t_integration.sh | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)
diffs (37 lines):
diff -r 8cc040245f3d -r ddf35bf63e6e tests/usr.bin/xlint/lint1/t_integration.sh
--- a/tests/usr.bin/xlint/lint1/t_integration.sh Sat Jan 09 14:10:12 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/t_integration.sh Sat Jan 09 14:33:53 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_integration.sh,v 1.20 2021/01/02 19:22:42 rillig Exp $
+# $NetBSD: t_integration.sh,v 1.21 2021/01/09 14:33:53 rillig Exp $
#
# Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -152,10 +152,25 @@
srcdir="$(atf_get_srcdir)"
ok="true"
+ # shellcheck disable=SC2016
+ extract_flags_awk='
+ BEGIN {
+ flags = "-g -S -w"
+ }
+ /^\/\* (lint1-flags|lint1-extra-flags): .*\*\/$/ {
+ if ($2 == "lint1-flags:")
+ flags = ""
+ for (i = 3; i < NF; i++)
+ flags = flags " " $i
+ }
+ END {
+ print flags
+ }
+ '
+
for msg in $(seq 0 329); do
base="$(printf '%s/msg_%03d' "${srcdir}" "${msg}")"
- flags="$(sed -n 's,^/\* lint1-flags: \(.*\) \*/$,\1,p' "${base}.c")"
- flags="${flags:--g -S -w}"
+ flags="$(awk "$extract_flags_awk" "${base}.c")"
# shellcheck disable=SC2154 disable=SC2086
${Atf_Check} -s not-exit:0 -o "file:${base}.exp" -e empty \
Home |
Main Index |
Thread Index |
Old Index