Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src tests/lint: add test skeletons for messages from lint2



details:   https://anonhg.NetBSD.org/src/rev/48f48b0bb514
branches:  trunk
changeset: 985044:48f48b0bb514
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Aug 05 22:36:07 2021 +0000

description:
tests/lint: add test skeletons for messages from lint2

diffstat:

 distrib/sets/lists/tests/mi           |  44 +++++++++++++++++++++++++++-
 etc/mtree/NetBSD.dist.tests           |   3 +-
 tests/usr.bin/xlint/Makefile          |   4 +-
 tests/usr.bin/xlint/lint2/Makefile    |  33 +++++++++++++++++++++
 tests/usr.bin/xlint/lint2/msg_000.exp |   2 +
 tests/usr.bin/xlint/lint2/msg_000.ln  |  42 +++++++++++++++++++++++++++
 tests/usr.bin/xlint/lint2/msg_001.ln  |   6 +++
 tests/usr.bin/xlint/lint2/msg_002.ln  |   6 +++
 tests/usr.bin/xlint/lint2/msg_003.ln  |   6 +++
 tests/usr.bin/xlint/lint2/msg_004.ln  |   6 +++
 tests/usr.bin/xlint/lint2/msg_005.ln  |   6 +++
 tests/usr.bin/xlint/lint2/msg_006.ln  |   6 +++
 tests/usr.bin/xlint/lint2/msg_007.ln  |   6 +++
 tests/usr.bin/xlint/lint2/msg_008.ln  |   6 +++
 tests/usr.bin/xlint/lint2/msg_009.ln  |   6 +++
 tests/usr.bin/xlint/lint2/msg_010.ln  |   6 +++
 tests/usr.bin/xlint/lint2/msg_011.ln  |   6 +++
 tests/usr.bin/xlint/lint2/msg_012.ln  |   6 +++
 tests/usr.bin/xlint/lint2/msg_013.ln  |   6 +++
 tests/usr.bin/xlint/lint2/msg_014.ln  |   6 +++
 tests/usr.bin/xlint/lint2/msg_015.ln  |   6 +++
 tests/usr.bin/xlint/lint2/msg_016.ln  |   6 +++
 tests/usr.bin/xlint/lint2/msg_017.ln  |   6 +++
 tests/usr.bin/xlint/lint2/msg_018.ln  |   6 +++
 tests/usr.bin/xlint/lint2/t_lint2.sh  |  54 +++++++++++++++++++++++++++++++++++
 25 files changed, 286 insertions(+), 4 deletions(-)

diffs (truncated from 417 to 300 lines):

diff -r e9e9b8bd0f16 -r 48f48b0bb514 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Thu Aug 05 22:31:20 2021 +0000
+++ b/distrib/sets/lists/tests/mi       Thu Aug 05 22:36:07 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1103 2021/08/05 06:34:42 rillig Exp $
+# $NetBSD: mi,v 1.1104 2021/08/05 22:36:07 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -7023,6 +7023,48 @@
 ./usr/tests/usr.bin/xlint/lint1/stmt_if.c                      tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/stmt_if.exp                    tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/t_integration                  tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2                                        tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/Atffile                                tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/Kyuafile                       tests-usr.bin-tests     compattestfile,atf,kyua
+./usr/tests/usr.bin/xlint/lint2/msg_000.exp                    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_000.ln                     tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_001.exp                    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_001.ln                     tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_002.exp                    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_002.ln                     tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_003.exp                    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_003.ln                     tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_004.exp                    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_004.ln                     tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_005.exp                    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_005.ln                     tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_006.exp                    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_006.ln                     tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_007.exp                    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_007.ln                     tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_008.exp                    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_008.ln                     tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_009.exp                    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_009.ln                     tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_010.exp                    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_010.ln                     tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_011.exp                    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_011.ln                     tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_012.exp                    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_012.ln                     tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_013.exp                    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_013.ln                     tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_014.exp                    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_014.ln                     tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_015.exp                    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_015.ln                     tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_016.exp                    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_016.ln                     tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_017.exp                    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_017.ln                     tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_018.exp                    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/msg_018.ln                     tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/t_lint2                                tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/ztest                              tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/ztest/Atffile                      tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/ztest/Kyuafile                     tests-usr.bin-tests     compattestfile,atf,kyua
diff -r e9e9b8bd0f16 -r 48f48b0bb514 etc/mtree/NetBSD.dist.tests
--- a/etc/mtree/NetBSD.dist.tests       Thu Aug 05 22:31:20 2021 +0000
+++ b/etc/mtree/NetBSD.dist.tests       Thu Aug 05 22:36:07 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: NetBSD.dist.tests,v 1.185 2021/07/14 03:22:33 ozaki-r Exp $
+#      $NetBSD: NetBSD.dist.tests,v 1.186 2021/08/05 22:36:07 rillig Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -462,6 +462,7 @@
 ./usr/tests/usr.bin/vmstat
 ./usr/tests/usr.bin/xlint
 ./usr/tests/usr.bin/xlint/lint1
+./usr/tests/usr.bin/xlint/lint2
 ./usr/tests/usr.bin/ztest
 ./usr/tests/usr.sbin
 ./usr/tests/usr.sbin/cpuctl
diff -r e9e9b8bd0f16 -r 48f48b0bb514 tests/usr.bin/xlint/Makefile
--- a/tests/usr.bin/xlint/Makefile      Thu Aug 05 22:31:20 2021 +0000
+++ b/tests/usr.bin/xlint/Makefile      Thu Aug 05 22:36:07 2021 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.1 2012/03/17 16:33:15 jruoho Exp $
+# $NetBSD: Makefile,v 1.2 2021/08/05 22:36:08 rillig Exp $
 
 .include <bsd.own.mk>
 
 TESTSDIR=      ${TESTSBASE}/usr.bin/xlint
 
-TESTS_SUBDIRS= lint1
+TESTS_SUBDIRS= lint1 lint2
 
 .include <bsd.test.mk>
diff -r e9e9b8bd0f16 -r 48f48b0bb514 tests/usr.bin/xlint/lint2/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint2/Makefile        Thu Aug 05 22:36:07 2021 +0000
@@ -0,0 +1,33 @@
+# $NetBSD: Makefile,v 1.1 2021/08/05 22:36:08 rillig Exp $
+
+NOMAN=         yes
+
+.include <bsd.own.mk>
+
+TESTSDIR=      ${TESTSBASE}/usr.bin/xlint/lint2
+
+TESTS_SH=              t_lint2
+
+FILESDIR=      ${TESTSDIR}
+
+.for msg in \
+    000 001 002 003 004 005 006 007 008 009 \
+    010 011 012 013 014 015 016 017 018
+FILES+=                msg_${msg}.exp msg_${msg}.ln
+.endfor
+
+# Note: only works for adding tests.
+# To remove a test, the $$mi file must be edited manually.
+sync-mi: .PHONY
+       @set -eu;                                                       \
+       cd "${MAKEFILE:tA:H}/../../../..";                              \
+       mi="distrib/sets/lists/tests/mi";                               \
+       cvs update "$$mi";                                              \
+       fmt="./usr/tests/usr.bin/xlint/lint2/%s\ttests-usr.bin-tests\tcompattestfile,atf\n"; \
+       cat "$$mi" > "$$mi.tmp";                                        \
+       printf "$$fmt" ${FILES} >> "$$mi.tmp";                          \
+       distrib/sets/fmt-list "$$mi.tmp";                               \
+       mv "$$mi.tmp" "$$mi";                                           \
+       cvs diff "$$mi" || true
+
+.include <bsd.test.mk>
diff -r e9e9b8bd0f16 -r 48f48b0bb514 tests/usr.bin/xlint/lint2/msg_000.exp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_000.exp     Thu Aug 05 22:36:07 2021 +0000
@@ -0,0 +1,2 @@
+defined_not_used defined( msg_000.c(2) ), but never used
+used_not_defined used( msg_000.c(3) ), but not defined
diff -r e9e9b8bd0f16 -r 48f48b0bb514 tests/usr.bin/xlint/lint2/msg_000.ln
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_000.ln      Thu Aug 05 22:36:07 2021 +0000
@@ -0,0 +1,42 @@
+# $NetBSD: msg_000.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
+#
+# Test data for message 0 of lint2:
+#      %s used( %s ), but not defined
+#
+
+# Define file number 0.
+0smsg_000.c
+
+# Define the main file of the translation unit.
+Smsg_000.c
+
+# Have a function that is used but not defined, and a function that is defined
+# but not used, generated by this code:
+#      1:      # 2 "msg_000.c"
+#      2:      defined_not_used() {
+#      3:              used_not_defined(1, 0.0);
+#      4:      }
+#
+# The function call in line 3 generates this entry:
+#      '3'     logical line 3 in the main .c source
+#      'c'     function call
+#      '0.3'   file 0, logical line 3 in the currently included file
+#      'p1'    the first argument is a positive constant
+#      'i'     the return value of the function call is ignored
+#      '16...' the name of the called function
+#      'f2'    it's a function with 2 arguments
+#      'I'     the first argument has type 'int'
+#      'D'     the first argument has type 'double'
+#      'I'     the return type of the function is (implicitly) 'int'
+3c0.3p1i16used_not_definedf2IDI
+#
+# The function definition in line 2 generates this entry:
+#      '2'     logical line 2 in the main .c source
+#      'd'     function definition
+#      '0.2'   file 0, logical line 2 in the currently included file
+#      'd'     function definition
+#      'o'     old-style function definition
+#      '16...' the name of the defined function
+#      'f0'    it's a function with 0 arguments
+#      'I'     the return type of the function is (implicitly) 'int'
+2d0.2do16defined_not_usedf0I
diff -r e9e9b8bd0f16 -r 48f48b0bb514 tests/usr.bin/xlint/lint2/msg_001.ln
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_001.ln      Thu Aug 05 22:36:07 2021 +0000
@@ -0,0 +1,6 @@
+# $NetBSD: msg_001.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
+#
+# Test data for message 1 of lint2:
+#      %s defined( %s ), but never used
+#
+# TODO: add actual test data
diff -r e9e9b8bd0f16 -r 48f48b0bb514 tests/usr.bin/xlint/lint2/msg_002.ln
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_002.ln      Thu Aug 05 22:36:07 2021 +0000
@@ -0,0 +1,6 @@
+# $NetBSD: msg_002.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
+#
+# Test data for message 2 of lint2:
+#      %s declared( %s ), but never used or defined
+#
+# TODO: add actual test data
diff -r e9e9b8bd0f16 -r 48f48b0bb514 tests/usr.bin/xlint/lint2/msg_003.ln
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_003.ln      Thu Aug 05 22:36:07 2021 +0000
@@ -0,0 +1,6 @@
+# $NetBSD: msg_003.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
+#
+# Test data for message 3 of lint2:
+#      %s multiply defined     %s  ::  %s
+#
+# TODO: add actual test data
diff -r e9e9b8bd0f16 -r 48f48b0bb514 tests/usr.bin/xlint/lint2/msg_004.ln
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_004.ln      Thu Aug 05 22:36:07 2021 +0000
@@ -0,0 +1,6 @@
+# $NetBSD: msg_004.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
+#
+# Test data for message 4 of lint2:
+#      %s value used inconsistently    %s  ::  %s
+#
+# TODO: add actual test data
diff -r e9e9b8bd0f16 -r 48f48b0bb514 tests/usr.bin/xlint/lint2/msg_005.ln
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_005.ln      Thu Aug 05 22:36:07 2021 +0000
@@ -0,0 +1,6 @@
+# $NetBSD: msg_005.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
+#
+# Test data for message 5 of lint2:
+#      %s value declared inconsistently (%s != %s)     %s  ::  %s
+#
+# TODO: add actual test data
diff -r e9e9b8bd0f16 -r 48f48b0bb514 tests/usr.bin/xlint/lint2/msg_006.ln
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_006.ln      Thu Aug 05 22:36:07 2021 +0000
@@ -0,0 +1,6 @@
+# $NetBSD: msg_006.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
+#
+# Test data for message 6 of lint2:
+#      %s, arg %d used inconsistently          %s[%s]  ::  %s[%s]
+#
+# TODO: add actual test data
diff -r e9e9b8bd0f16 -r 48f48b0bb514 tests/usr.bin/xlint/lint2/msg_007.ln
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_007.ln      Thu Aug 05 22:36:07 2021 +0000
@@ -0,0 +1,6 @@
+# $NetBSD: msg_007.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
+#
+# Test data for message 7 of lint2:
+#      %s: variable # of args          %s  ::  %s
+#
+# TODO: add actual test data
diff -r e9e9b8bd0f16 -r 48f48b0bb514 tests/usr.bin/xlint/lint2/msg_008.ln
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_008.ln      Thu Aug 05 22:36:07 2021 +0000
@@ -0,0 +1,6 @@
+# $NetBSD: msg_008.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
+#
+# Test data for message 8 of lint2:
+#      %s returns value which is always ignored
+#
+# TODO: add actual test data
diff -r e9e9b8bd0f16 -r 48f48b0bb514 tests/usr.bin/xlint/lint2/msg_009.ln
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_009.ln      Thu Aug 05 22:36:07 2021 +0000
@@ -0,0 +1,6 @@
+# $NetBSD: msg_009.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
+#
+# Test data for message 9 of lint2:
+#      %s returns value which is sometimes ignored
+#
+# TODO: add actual test data
diff -r e9e9b8bd0f16 -r 48f48b0bb514 tests/usr.bin/xlint/lint2/msg_010.ln
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_010.ln      Thu Aug 05 22:36:07 2021 +0000
@@ -0,0 +1,6 @@
+# $NetBSD: msg_010.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
+#
+# Test data for message 10 of lint2:
+#      %s value is used( %s ), but none returned
+#
+# TODO: add actual test data
diff -r e9e9b8bd0f16 -r 48f48b0bb514 tests/usr.bin/xlint/lint2/msg_011.ln
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_011.ln      Thu Aug 05 22:36:07 2021 +0000
@@ -0,0 +1,6 @@
+# $NetBSD: msg_011.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
+#
+# Test data for message 11 of lint2:
+#      %s, arg %d declared inconsistently (%s != %s)   %s :: %s
+#
+# TODO: add actual test data
diff -r e9e9b8bd0f16 -r 48f48b0bb514 tests/usr.bin/xlint/lint2/msg_012.ln
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_012.ln      Thu Aug 05 22:36:07 2021 +0000
@@ -0,0 +1,6 @@
+# $NetBSD: msg_012.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
+#
+# Test data for message 12 of lint2:
+#      %s: variable # of args declared         %s  ::  %s
+#
+# TODO: add actual test data
diff -r e9e9b8bd0f16 -r 48f48b0bb514 tests/usr.bin/xlint/lint2/msg_013.ln



Home | Main Index | Thread Index | Old Index