Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/usr.bin/indent tests/indent: format stderr output as e...
details: https://anonhg.NetBSD.org/src/rev/057eecbbd2a0
branches: trunk
changeset: 376417:057eecbbd2a0
user: rillig <rillig%NetBSD.org@localhost>
date: Fri Jun 16 23:19:01 2023 +0000
description:
tests/indent: format stderr output as end-of-line comments
This generates fewer error markers in syntax-aware editors.
diffstat:
tests/usr.bin/indent/fmt_expr.c | 8 ++++----
tests/usr.bin/indent/lsym_lbrace.c | 8 ++++----
tests/usr.bin/indent/lsym_preprocessing.c | 12 ++++++------
tests/usr.bin/indent/lsym_semicolon.c | 10 +++++-----
tests/usr.bin/indent/psym_else.c | 6 +++---
tests/usr.bin/indent/psym_rbrace.c | 26 +++++++++++++-------------
tests/usr.bin/indent/t_options.lua | 6 +++---
7 files changed, 38 insertions(+), 38 deletions(-)
diffs (196 lines):
diff -r 0a680bb122f8 -r 057eecbbd2a0 tests/usr.bin/indent/fmt_expr.c
--- a/tests/usr.bin/indent/fmt_expr.c Fri Jun 16 23:17:22 2023 +0000
+++ b/tests/usr.bin/indent/fmt_expr.c Fri Jun 16 23:19:01 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fmt_expr.c,v 1.9 2023/06/16 12:55:57 rillig Exp $ */
+/* $NetBSD: fmt_expr.c,v 1.10 2023/06/16 23:19:01 rillig Exp $ */
/*
* Tests for all kinds of expressions that are not directly related to unary
@@ -53,7 +53,7 @@
stmt;
});
}
-exit 1
-error: Standard Input:7: Unbalanced parentheses
-warning: Standard Input:9: Extra ')'
+// exit 1
+// error: Standard Input:7: Unbalanced parentheses
+// warning: Standard Input:9: Extra ')'
//indent end
diff -r 0a680bb122f8 -r 057eecbbd2a0 tests/usr.bin/indent/lsym_lbrace.c
--- a/tests/usr.bin/indent/lsym_lbrace.c Fri Jun 16 23:17:22 2023 +0000
+++ b/tests/usr.bin/indent/lsym_lbrace.c Fri Jun 16 23:19:01 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_lbrace.c,v 1.9 2023/06/15 09:19:07 rillig Exp $ */
+/* $NetBSD: lsym_lbrace.c,v 1.10 2023/06/16 23:19:01 rillig Exp $ */
/*
* Tests for the token lsym_lbrace, which represents a '{' in these contexts:
@@ -99,9 +99,9 @@ origin(void)
switch (expr rparen {
}
}
-exit 1
-error: Standard Input:2: Unbalanced parentheses
-error: Standard Input:4: Unbalanced parentheses
+// exit 1
+// error: Standard Input:2: Unbalanced parentheses
+// error: Standard Input:4: Unbalanced parentheses
//indent end
diff -r 0a680bb122f8 -r 057eecbbd2a0 tests/usr.bin/indent/lsym_preprocessing.c
--- a/tests/usr.bin/indent/lsym_preprocessing.c Fri Jun 16 23:17:22 2023 +0000
+++ b/tests/usr.bin/indent/lsym_preprocessing.c Fri Jun 16 23:19:01 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_preprocessing.c,v 1.14 2023/06/14 20:46:08 rillig Exp $ */
+/* $NetBSD: lsym_preprocessing.c,v 1.15 2023/06/16 23:19:01 rillig Exp $ */
/*
* Tests for the token lsym_preprocessing, which represents a '#' that starts
@@ -301,11 +301,11 @@ int before;
#unknown
# 3 "file.c"
-exit 1
-error: Standard Input:1: Unmatched #else
-error: Standard Input:2: Unmatched #elif
-error: Standard Input:3: Unmatched #elifdef
-error: Standard Input:4: Unmatched #endif
+// exit 1
+// error: Standard Input:1: Unmatched #else
+// error: Standard Input:2: Unmatched #elif
+// error: Standard Input:3: Unmatched #elifdef
+// error: Standard Input:4: Unmatched #endif
//indent end
diff -r 0a680bb122f8 -r 057eecbbd2a0 tests/usr.bin/indent/lsym_semicolon.c
--- a/tests/usr.bin/indent/lsym_semicolon.c Fri Jun 16 23:17:22 2023 +0000
+++ b/tests/usr.bin/indent/lsym_semicolon.c Fri Jun 16 23:19:01 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_semicolon.c,v 1.5 2023/06/15 09:19:07 rillig Exp $ */
+/* $NetBSD: lsym_semicolon.c,v 1.6 2023/06/16 23:19:01 rillig Exp $ */
/*
* Tests for the token lsym_semicolon, which represents ';' in these contexts:
@@ -84,8 +84,8 @@ int b = 3;
//indent run -di0
int a = {{;
int b = 3;
-exit 1
-error: Standard Input:2: Stuff missing from end of file
+// exit 1
+// error: Standard Input:2: Stuff missing from end of file
//indent end
@@ -101,6 +101,6 @@ error: Standard Input:2: Stuff missing f
int a = {{;
int b = 3;
}
-exit 1
-error: Standard Input:4: Stuff missing from end of file
+// exit 1
+// error: Standard Input:4: Stuff missing from end of file
//indent end
diff -r 0a680bb122f8 -r 057eecbbd2a0 tests/usr.bin/indent/psym_else.c
--- a/tests/usr.bin/indent/psym_else.c Fri Jun 16 23:17:22 2023 +0000
+++ b/tests/usr.bin/indent/psym_else.c Fri Jun 16 23:19:01 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: psym_else.c,v 1.6 2023/06/14 17:07:32 rillig Exp $ */
+/* $NetBSD: psym_else.c,v 1.7 2023/06/16 23:19:01 rillig Exp $ */
/*
* Tests for the parser symbol psym_else, which represents the keyword 'else'
@@ -83,6 +83,6 @@ function(void)
{
else
}
-exit 1
-error: Standard Input:2: Unmatched 'else'
+// exit 1
+// error: Standard Input:2: Unmatched 'else'
//indent end
diff -r 0a680bb122f8 -r 057eecbbd2a0 tests/usr.bin/indent/psym_rbrace.c
--- a/tests/usr.bin/indent/psym_rbrace.c Fri Jun 16 23:17:22 2023 +0000
+++ b/tests/usr.bin/indent/psym_rbrace.c Fri Jun 16 23:19:01 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: psym_rbrace.c,v 1.4 2023/06/14 20:46:08 rillig Exp $ */
+/* $NetBSD: psym_rbrace.c,v 1.5 2023/06/16 23:19:01 rillig Exp $ */
/*
* Tests for the parser symbol psym_rbrace, which represents '}' and finishes
@@ -23,9 +23,9 @@
{
int
}
-exit 1
-error: Standard Input:3: Statement nesting error
-error: Standard Input:3: Stuff missing from end of file
+// exit 1
+// error: Standard Input:3: Statement nesting error
+// error: Standard Input:3: Stuff missing from end of file
//indent end
@@ -50,9 +50,9 @@ error: Standard Input:3: Stuff missing f
{
if (cond)
}
-exit 1
-error: Standard Input:3: Statement nesting error
-error: Standard Input:3: Stuff missing from end of file
+// exit 1
+// error: Standard Input:3: Statement nesting error
+// error: Standard Input:3: Stuff missing from end of file
//indent end
@@ -66,9 +66,9 @@ error: Standard Input:3: Stuff missing f
{
switch (expr)
}
-exit 1
-error: Standard Input:3: Statement nesting error
-error: Standard Input:3: Stuff missing from end of file
+// exit 1
+// error: Standard Input:3: Statement nesting error
+// error: Standard Input:3: Stuff missing from end of file
//indent end
@@ -82,7 +82,7 @@ error: Standard Input:3: Stuff missing f
{
while (cond)
}
-exit 1
-error: Standard Input:3: Statement nesting error
-error: Standard Input:3: Stuff missing from end of file
+// exit 1
+// error: Standard Input:3: Statement nesting error
+// error: Standard Input:3: Stuff missing from end of file
//indent end
diff -r 0a680bb122f8 -r 057eecbbd2a0 tests/usr.bin/indent/t_options.lua
--- a/tests/usr.bin/indent/t_options.lua Fri Jun 16 23:17:22 2023 +0000
+++ b/tests/usr.bin/indent/t_options.lua Fri Jun 16 23:19:01 2023 +0000
@@ -1,4 +1,4 @@
--- $NetBSD: t_options.lua,v 1.5 2023/06/14 17:07:32 rillig Exp $
+-- $NetBSD: t_options.lua,v 1.6 2023/06/16 23:19:01 rillig Exp $
--
-- Copyright (c) 2023 The NetBSD Foundation, Inc.
-- All rights reserved.
@@ -132,10 +132,10 @@ local function run_indent(inp, args)
indent_in:write(inp)
local ok, kind, info = indent_in:close()
if not ok then
- print(kind .. " " .. info)
+ print("// " .. kind .. " " .. info)
end
for line in io.lines("t_options.err") do
- print(line)
+ print("// " .. line)
end
end
Home |
Main Index |
Thread Index |
Old Index