summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2023-07-06 07:33:36 +0000
committerrillig <rillig@NetBSD.org>2023-07-06 07:33:36 +0000
commit96de2b0706056804ef3f627e5b6e1026793cd27d (patch)
tree11403c3350312b6fe561d2af5cd84b799c2ebb81 /tests
parent1c4367d24fe65f2533c4eb646a3dda991ce83aed (diff)
tests/lint: ensure consistent preprocessor filenames in tests
The deviations often happen when copying or renaming tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/usr.bin/xlint/lint1/check-expect.lua8
-rw-r--r--tests/usr.bin/xlint/lint1/msg_247_lp64_ldbl128.c4
2 files changed, 8 insertions, 4 deletions
diff --git a/tests/usr.bin/xlint/lint1/check-expect.lua b/tests/usr.bin/xlint/lint1/check-expect.lua
index 8e507203b86..3ece1989542 100644
--- a/tests/usr.bin/xlint/lint1/check-expect.lua
+++ b/tests/usr.bin/xlint/lint1/check-expect.lua
@@ -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 --git a/tests/usr.bin/xlint/lint1/msg_247_lp64_ldbl128.c b/tests/usr.bin/xlint/lint1/msg_247_lp64_ldbl128.c
index 2c3bf3fb2bb..5de0113f6da 100644
--- a/tests/usr.bin/xlint/lint1/msg_247_lp64_ldbl128.c
+++ b/tests/usr.bin/xlint/lint1/msg_247_lp64_ldbl128.c
@@ -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]