Module Name:    src
Committed By:   rillig
Date:           Fri Jun 16 23:19:01 UTC 2023

Modified Files:
        src/tests/usr.bin/indent: fmt_expr.c lsym_lbrace.c lsym_preprocessing.c
            lsym_semicolon.c psym_else.c psym_rbrace.c t_options.lua

Log Message:
tests/indent: format stderr output as end-of-line comments

This generates fewer error markers in syntax-aware editors.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/indent/fmt_expr.c \
    src/tests/usr.bin/indent/lsym_lbrace.c
cvs rdiff -u -r1.14 -r1.15 src/tests/usr.bin/indent/lsym_preprocessing.c
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/indent/lsym_semicolon.c \
    src/tests/usr.bin/indent/t_options.lua
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/indent/psym_else.c
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/indent/psym_rbrace.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/indent/fmt_expr.c
diff -u src/tests/usr.bin/indent/fmt_expr.c:1.9 src/tests/usr.bin/indent/fmt_expr.c:1.10
--- src/tests/usr.bin/indent/fmt_expr.c:1.9	Fri Jun 16 12:55:57 2023
+++ src/tests/usr.bin/indent/fmt_expr.c	Fri Jun 16 23:19:01 2023
@@ -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
Index: src/tests/usr.bin/indent/lsym_lbrace.c
diff -u src/tests/usr.bin/indent/lsym_lbrace.c:1.9 src/tests/usr.bin/indent/lsym_lbrace.c:1.10
--- src/tests/usr.bin/indent/lsym_lbrace.c:1.9	Thu Jun 15 09:19:07 2023
+++ src/tests/usr.bin/indent/lsym_lbrace.c	Fri Jun 16 23:19:01 2023
@@ -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
 
 

Index: src/tests/usr.bin/indent/lsym_preprocessing.c
diff -u src/tests/usr.bin/indent/lsym_preprocessing.c:1.14 src/tests/usr.bin/indent/lsym_preprocessing.c:1.15
--- src/tests/usr.bin/indent/lsym_preprocessing.c:1.14	Wed Jun 14 20:46:08 2023
+++ src/tests/usr.bin/indent/lsym_preprocessing.c	Fri Jun 16 23:19:01 2023
@@ -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
 
 

Index: src/tests/usr.bin/indent/lsym_semicolon.c
diff -u src/tests/usr.bin/indent/lsym_semicolon.c:1.5 src/tests/usr.bin/indent/lsym_semicolon.c:1.6
--- src/tests/usr.bin/indent/lsym_semicolon.c:1.5	Thu Jun 15 09:19:07 2023
+++ src/tests/usr.bin/indent/lsym_semicolon.c	Fri Jun 16 23:19:01 2023
@@ -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
Index: src/tests/usr.bin/indent/t_options.lua
diff -u src/tests/usr.bin/indent/t_options.lua:1.5 src/tests/usr.bin/indent/t_options.lua:1.6
--- src/tests/usr.bin/indent/t_options.lua:1.5	Wed Jun 14 17:07:32 2023
+++ src/tests/usr.bin/indent/t_options.lua	Fri Jun 16 23:19:01 2023
@@ -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
 

Index: src/tests/usr.bin/indent/psym_else.c
diff -u src/tests/usr.bin/indent/psym_else.c:1.6 src/tests/usr.bin/indent/psym_else.c:1.7
--- src/tests/usr.bin/indent/psym_else.c:1.6	Wed Jun 14 17:07:32 2023
+++ src/tests/usr.bin/indent/psym_else.c	Fri Jun 16 23:19:01 2023
@@ -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

Index: src/tests/usr.bin/indent/psym_rbrace.c
diff -u src/tests/usr.bin/indent/psym_rbrace.c:1.4 src/tests/usr.bin/indent/psym_rbrace.c:1.5
--- src/tests/usr.bin/indent/psym_rbrace.c:1.4	Wed Jun 14 20:46:08 2023
+++ src/tests/usr.bin/indent/psym_rbrace.c	Fri Jun 16 23:19:01 2023
@@ -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

Reply via email to