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 tests/lint: ensure consistent prep...



details:   https://anonhg.NetBSD.org/src/rev/d966d6b8894b
branches:  trunk
changeset: 377303:d966d6b8894b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Jul 06 07:33:36 2023 +0000

description:
tests/lint: ensure consistent preprocessor filenames in tests

The deviations often happen when copying or renaming tests.

diffstat:

 tests/usr.bin/xlint/lint1/check-expect.lua       |  8 ++++++--
 tests/usr.bin/xlint/lint1/msg_247_lp64_ldbl128.c |  4 ++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diffs (41 lines):

diff -r 3b2f7465eb3d -r d966d6b8894b tests/usr.bin/xlint/lint1/check-expect.lua
--- a/tests/usr.bin/xlint/lint1/check-expect.lua        Thu Jul 06 02:43:44 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/check-expect.lua        Thu Jul 06 07:33:36 2023 +0000
@@ -1,5 +1,5 @@
 #!  /usr/bin/lua
--- $NetBSD: check-expect.lua,v 1.4 2023/07/01 09:21:31 rillig Exp $
+-- $NetBSD: check-expect.lua,v 1.5 2023/07/06 07:33:36 rillig Exp $
 
 --[[
 
@@ -91,6 +91,10 @@ local function load_c(fname)
         print_error("error: %s:%d: preprocessor line number must be %d",
           fname, phys_lineno, phys_lineno + 1)
       end
+      if ppl_fname:match("%.c$") and ppl_fname ~= basename then
+        print_error("error: %s:%d: preprocessor filename must be '%s'",
+          fname, phys_lineno, basename)
+      end
       pp_fname = ppl_fname
       pp_lineno = ppl_lineno
     end
@@ -104,7 +108,7 @@ end
 --
 -- example return value: {
 --   {
---     exp_lineno = "18",
+--     exp_lineno = 18,
 --     location = "file.c(18)",
 --     message = "not a constant expression [123]",
 --   }
diff -r 3b2f7465eb3d -r d966d6b8894b tests/usr.bin/xlint/lint1/msg_247_lp64_ldbl128.c
--- a/tests/usr.bin/xlint/lint1/msg_247_lp64_ldbl128.c  Thu Jul 06 02:43:44 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_247_lp64_ldbl128.c  Thu Jul 06 07:33:36 2023 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: msg_247_lp64_ldbl128.c,v 1.2 2023/07/05 11:42:14 rillig Exp $  */
-# 3 "msg_247_lp64.c"
+/*     $NetBSD: msg_247_lp64_ldbl128.c,v 1.3 2023/07/06 07:33:36 rillig Exp $  */
+# 3 "msg_247_lp64_ldbl128.c"
 
 // Test for message: pointer cast from '%s' to '%s' may be troublesome [247]
 



Home | Main Index | Thread Index | Old Index