diff options
| author | rillig <rillig@NetBSD.org> | 2023-06-14 17:07:32 +0000 |
|---|---|---|
| committer | rillig <rillig@NetBSD.org> | 2023-06-14 17:07:32 +0000 |
| commit | 0cdfd577988fcf6da76efd1e1b1da3eb3ef5d076 (patch) | |
| tree | 17ee848f7c2258c37f2150023771b78080bf0c4e /tests | |
| parent | 3bd7a9445635275a89d78ffce6ce1fd72bc8d7bd (diff) | |
tests/indent: separate stdout from stderr
Due to buffering, there was no guarantee that the output would be
exactly in the same order as written in the tests.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/usr.bin/indent/fmt_expr.c | 6 | ||||
| -rw-r--r-- | tests/usr.bin/indent/lsym_preprocessing.c | 10 | ||||
| -rw-r--r-- | tests/usr.bin/indent/psym_else.c | 4 | ||||
| -rw-r--r-- | tests/usr.bin/indent/t_options.lua | 7 |
4 files changed, 15 insertions, 12 deletions
diff --git a/tests/usr.bin/indent/fmt_expr.c b/tests/usr.bin/indent/fmt_expr.c index 5ff1b413077..37907b18067 100644 --- a/tests/usr.bin/indent/fmt_expr.c +++ b/tests/usr.bin/indent/fmt_expr.c @@ -1,4 +1,4 @@ -/* $NetBSD: fmt_expr.c,v 1.7 2023/06/10 08:17:04 rillig Exp $ */ +/* $NetBSD: fmt_expr.c,v 1.8 2023/06/14 17:07:32 rillig Exp $ */ /* * Tests for all kinds of expressions that are not directly related to unary @@ -44,8 +44,6 @@ //indent end //indent run -di0 -error: Standard Input:7: Unbalanced parentheses -warning: Standard Input:9: Extra ')' { int var = ({1}); int var = ({ @@ -57,4 +55,6 @@ warning: Standard Input:9: Extra ')' }); } exit 1 +error: Standard Input:7: Unbalanced parentheses +warning: Standard Input:9: Extra ')' //indent end diff --git a/tests/usr.bin/indent/lsym_preprocessing.c b/tests/usr.bin/indent/lsym_preprocessing.c index 0029d0ff1b0..ce8c6980ffd 100644 --- a/tests/usr.bin/indent/lsym_preprocessing.c +++ b/tests/usr.bin/indent/lsym_preprocessing.c @@ -1,4 +1,4 @@ -/* $NetBSD: lsym_preprocessing.c,v 1.12 2023/06/14 10:29:52 rillig Exp $ */ +/* $NetBSD: lsym_preprocessing.c,v 1.13 2023/06/14 17:07:32 rillig Exp $ */ /* * Tests for the token lsym_preprocessing, which represents a '#' that starts @@ -294,10 +294,6 @@ int before; //indent end //indent run -error: Standard Input:1: Unmatched #else -error: Standard Input:2: Unmatched #elif -error: Standard Input:3: Unmatched #elifdef -error: Standard Input:4: Unmatched #endif #else #elif 0 #elifdef var @@ -306,4 +302,8 @@ error: Standard Input:4: Unmatched #endif #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 //indent end diff --git a/tests/usr.bin/indent/psym_else.c b/tests/usr.bin/indent/psym_else.c index 8458afe6764..5fdab0614cb 100644 --- a/tests/usr.bin/indent/psym_else.c +++ b/tests/usr.bin/indent/psym_else.c @@ -1,4 +1,4 @@ -/* $NetBSD: psym_else.c,v 1.5 2023/06/10 17:35:41 rillig Exp $ */ +/* $NetBSD: psym_else.c,v 1.6 2023/06/14 17:07:32 rillig Exp $ */ /* * Tests for the parser symbol psym_else, which represents the keyword 'else' @@ -80,9 +80,9 @@ function(void) //indent end //indent run -error: Standard Input:2: Unmatched 'else' { else } exit 1 +error: Standard Input:2: Unmatched 'else' //indent end diff --git a/tests/usr.bin/indent/t_options.lua b/tests/usr.bin/indent/t_options.lua index ab8ddf22f43..3d5406f5e72 100644 --- a/tests/usr.bin/indent/t_options.lua +++ b/tests/usr.bin/indent/t_options.lua @@ -1,4 +1,4 @@ --- $NetBSD: t_options.lua,v 1.4 2023/05/22 06:35:56 rillig Exp $ +-- $NetBSD: t_options.lua,v 1.5 2023/06/14 17:07:32 rillig Exp $ -- -- Copyright (c) 2023 The NetBSD Foundation, Inc. -- All rights reserved. @@ -126,7 +126,7 @@ end local function run_indent(inp, args) local indent = os.getenv("INDENT") or "indent" - local cmd = indent .. " " .. args .. " 2>&1" + local cmd = indent .. " " .. args .. " 2>t_options.err" local indent_in = assert(io.popen(cmd, "w")) indent_in:write(inp) @@ -134,6 +134,9 @@ local function run_indent(inp, args) if not ok then print(kind .. " " .. info) end + for line in io.lines("t_options.err") do + print(line) + end end local function handle_empty_section(line) |
