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: migrate tests for parenth...



details:   https://anonhg.NetBSD.org/src/rev/beaa14413cd9
branches:  trunk
changeset: 989983:beaa14413cd9
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Oct 22 19:46:41 2021 +0000

description:
tests/indent: migrate tests for parentheses, struct, #if, wide char

diffstat:

 distrib/sets/lists/tests/mi                            |  22 ++++----
 tests/usr.bin/indent/Makefile                          |  12 +----
 tests/usr.bin/indent/opt_bad.c                         |  25 ++++++++-
 tests/usr.bin/indent/parens.0                          |  28 ----------
 tests/usr.bin/indent/parens.0.pro                      |   3 -
 tests/usr.bin/indent/parens.0.stdout                   |  28 ----------
 tests/usr.bin/indent/struct.0                          |  22 --------
 tests/usr.bin/indent/struct.0.stdout                   |  24 --------
 tests/usr.bin/indent/surplusbad.0                      |  10 ---
 tests/usr.bin/indent/surplusbad.0.pro                  |   3 -
 tests/usr.bin/indent/surplusbad.0.stdout               |  10 ---
 tests/usr.bin/indent/token_keyword_struct_union_enum.c |  49 +++++++++++++++++-
 tests/usr.bin/indent/token_string_prefix.c             |  11 +++-
 tests/usr.bin/indent/wchar.0                           |   7 --
 tests/usr.bin/indent/wchar.0.stdout                    |   7 --
 15 files changed, 94 insertions(+), 167 deletions(-)

diffs (truncated from 391 to 300 lines):

diff -r 05d5c0c98757 -r beaa14413cd9 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Fri Oct 22 19:27:53 2021 +0000
+++ b/distrib/sets/lists/tests/mi       Fri Oct 22 19:46:41 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1149 2021/10/22 19:27:53 rillig Exp $
+# $NetBSD: mi,v 1.1150 2021/10/22 19:46:41 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5023,9 +5023,9 @@
 ./usr/tests/usr.bin/indent/opt_sob.c                                   tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/indent/opt_ut.c                                    tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/indent/opt_v.c                                     tests-usr.bin-tests     compattestfile,atf
-./usr/tests/usr.bin/indent/parens.0                                    tests-usr.bin-tests     compattestfile,atf
-./usr/tests/usr.bin/indent/parens.0.pro                                        tests-usr.bin-tests     compattestfile,atf
-./usr/tests/usr.bin/indent/parens.0.stdout                             tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/indent/parens.0                                    tests-obsolete          obsolete,atf
+./usr/tests/usr.bin/indent/parens.0.pro                                        tests-obsolete          obsolete,atf
+./usr/tests/usr.bin/indent/parens.0.stdout                             tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/pcs.0                                       tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/pcs.0.pro                                   tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/pcs.0.stdout                                        tests-obsolete          obsolete,atf
@@ -5033,11 +5033,11 @@
 ./usr/tests/usr.bin/indent/ps_ind_level.0.pro                          tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/ps_ind_level.0.stdout                       tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/ps_ind_level.c                              tests-usr.bin-tests     compattestfile,atf
-./usr/tests/usr.bin/indent/struct.0                                    tests-usr.bin-tests     compattestfile,atf
-./usr/tests/usr.bin/indent/struct.0.stdout                             tests-usr.bin-tests     compattestfile,atf
-./usr/tests/usr.bin/indent/surplusbad.0                                        tests-usr.bin-tests     compattestfile,atf
-./usr/tests/usr.bin/indent/surplusbad.0.pro                            tests-usr.bin-tests     compattestfile,atf
-./usr/tests/usr.bin/indent/surplusbad.0.stdout                         tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/indent/struct.0                                    tests-obsolete          obsolete,atf
+./usr/tests/usr.bin/indent/struct.0.stdout                             tests-obsolete          obsolete,atf
+./usr/tests/usr.bin/indent/surplusbad.0                                        tests-obsolete          obsolete,atf
+./usr/tests/usr.bin/indent/surplusbad.0.pro                            tests-obsolete          obsolete,atf
+./usr/tests/usr.bin/indent/surplusbad.0.stdout                         tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/t_errors                                    tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/indent/t_indent                                    tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/indent/t_misc                                      tests-usr.bin-tests     compattestfile,atf
@@ -5199,8 +5199,8 @@
 ./usr/tests/usr.bin/indent/types_from_file.0.list                      tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/indent/types_from_file.0.pro                       tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/indent/types_from_file.0.stdout                    tests-usr.bin-tests     compattestfile,atf
-./usr/tests/usr.bin/indent/wchar.0                                     tests-usr.bin-tests     compattestfile,atf
-./usr/tests/usr.bin/indent/wchar.0.stdout                              tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/indent/wchar.0                                     tests-obsolete          obsolete,atf
+./usr/tests/usr.bin/indent/wchar.0.stdout                              tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/infocmp                            tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/infocmp/Atffile                    tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/infocmp/Kyuafile                   tests-usr.bin-tests     compattestfile,atf,kyua
diff -r 05d5c0c98757 -r beaa14413cd9 tests/usr.bin/indent/Makefile
--- a/tests/usr.bin/indent/Makefile     Fri Oct 22 19:27:53 2021 +0000
+++ b/tests/usr.bin/indent/Makefile     Fri Oct 22 19:46:41 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.25 2021/10/22 19:27:53 rillig Exp $
+#      $NetBSD: Makefile,v 1.26 2021/10/22 19:46:41 rillig Exp $
 
 .include <bsd.own.mk>
 
@@ -116,15 +116,7 @@
 FILES+=                opt_sob.c
 FILES+=                opt_ut.c
 FILES+=                opt_v.c
-FILES+=                parens.0
-FILES+=                parens.0.stdout
-FILES+=                parens.0.pro
 FILES+=                ps_ind_level.c
-FILES+=                struct.0
-FILES+=                struct.0.stdout
-FILES+=                surplusbad.0
-FILES+=                surplusbad.0.stdout
-FILES+=                surplusbad.0.pro
 FILES+=                t_options.awk
 FILES+=                token_binary_op.c
 FILES+=                token_case_label.c
@@ -168,8 +160,6 @@
 FILES+=                types_from_file.0.stdout
 FILES+=                types_from_file.0.list
 FILES+=                types_from_file.0.pro
-FILES+=                wchar.0
-FILES+=                wchar.0.stdout
 
 add-test: .PHONY
        @set -eu; \
diff -r 05d5c0c98757 -r beaa14413cd9 tests/usr.bin/indent/opt_bad.c
--- a/tests/usr.bin/indent/opt_bad.c    Fri Oct 22 19:27:53 2021 +0000
+++ b/tests/usr.bin/indent/opt_bad.c    Fri Oct 22 19:46:41 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_bad.c,v 1.3 2021/10/18 07:11:31 rillig Exp $ */
+/* $NetBSD: opt_bad.c,v 1.4 2021/10/22 19:46:41 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -30,6 +30,29 @@
 
 #indent run-equals-prev-output -nbad
 
+
+/* See FreeBSD r303599. */
+#indent input
+#if defined(__i386__)
+int a;
+#elif defined(__amd64__)
+int b;
+#else
+#error "Port me"
+#endif
+#indent end
+
+#indent run -bad
+#if defined(__i386__)
+int            a;
+#elif defined(__amd64__)
+int            b;
+#else
+#error "Port me"
+#endif
+#indent end
+
+
 /* Test local declarations. */
 #indent input
 void function_definition(void) {
diff -r 05d5c0c98757 -r beaa14413cd9 tests/usr.bin/indent/parens.0
--- a/tests/usr.bin/indent/parens.0     Fri Oct 22 19:27:53 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*     $NetBSD: parens.0,v 1.2 2021/03/06 19:51:24 rillig Exp $        */
-/* $FreeBSD: head/usr.bin/indent/tests/parens.0 334583 2018-06-03 19:05:20Z pstef $ */
-typedef void   (*xxxxxxxxxxx) (int,
-                               char);
-
-typedef char   (*xxxxxxxxxxxxxxxxxxxxxxxxxxxx) (int *,
-                                                unsigned *,
-                                                char,
-                                                float *);
-
-void
-test(void)
-{
-       char            chars[secondf(firstf(B),
-                                     *here)];
-
-       float           xxx = yyyyyyyyyyyyyy(zzzzzzzzzzzzz(p1,
-                                                          (p2),
-                                                          p3));
-
-       if (1) {
-               char           *xxx = firstf(secondf2(p1,
-                                                     p2));
-       }
-
-       rb->allocfunc(1);
-       rb2.allocfunc(7);
-}
diff -r 05d5c0c98757 -r beaa14413cd9 tests/usr.bin/indent/parens.0.pro
--- a/tests/usr.bin/indent/parens.0.pro Fri Oct 22 19:27:53 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-/*     $NetBSD: parens.0.pro,v 1.1 2019/04/04 15:27:35 kamil Exp $     */
-/* $FreeBSD: head/usr.bin/indent/tests/parens.0.pro 334583 2018-06-03 19:05:20Z pstef $ */
--ts4 -i4 -di12 -Tallocfunc
diff -r 05d5c0c98757 -r beaa14413cd9 tests/usr.bin/indent/parens.0.stdout
--- a/tests/usr.bin/indent/parens.0.stdout      Fri Oct 22 19:27:53 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*     $NetBSD: parens.0.stdout,v 1.2 2021/09/30 21:48:12 rillig Exp $ */
-/* $FreeBSD: head/usr.bin/indent/tests/parens.0.stdout 334583 2018-06-03 19:05:20Z pstef $ */
-typedef void (*xxxxxxxxxxx)(int,
-                                                       char);
-
-typedef char (*xxxxxxxxxxxxxxxxxxxxxxxxxxxx)(int *,
-                                                                                        unsigned *,
-                                                                                        char,
-                                                                                        float *);
-
-void
-test(void)
-{
-       char            chars[secondf(firstf(B),
-                                                         *here)];
-
-       float           xxx = yyyyyyyyyyyyyy(zzzzzzzzzzzzz(p1,
-                                                                                                  (p2),
-                                                                                                  p3));
-
-       if (1) {
-               char       *xxx = firstf(secondf2(p1,
-                                                                                 p2));
-       }
-
-       rb->allocfunc(1);
-       rb2.allocfunc(7);
-}
diff -r 05d5c0c98757 -r beaa14413cd9 tests/usr.bin/indent/struct.0
--- a/tests/usr.bin/indent/struct.0     Fri Oct 22 19:27:53 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-/*     $NetBSD: struct.0,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
-/* $FreeBSD: head/usr.bin/indent/tests/struct.0 334564 2018-06-03 16:21:15Z pstef $ */
-
-int f(struct x *a);
-
-/* See r303485 */
-void
-t(void)
-{
-       static const struct {
-               int     a;
-               int     b;
-       } c[] = {
-               { D, E },
-               { F, G }
-       };
-}
-
-void u(struct x a) {
-       int b;
-       struct y c = (struct y *)&a;
-}
diff -r 05d5c0c98757 -r beaa14413cd9 tests/usr.bin/indent/struct.0.stdout
--- a/tests/usr.bin/indent/struct.0.stdout      Fri Oct 22 19:27:53 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-/*     $NetBSD: struct.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $  */
-/* $FreeBSD: head/usr.bin/indent/tests/struct.0.stdout 334564 2018-06-03 16:21:15Z pstef $ */
-
-int            f(struct x *a);
-
-/* See r303485 */
-void
-t(void)
-{
-       static const struct {
-               int             a;
-               int             b;
-       }               c[] = {
-               {D, E},
-               {F, G}
-       };
-}
-
-void
-u(struct x a)
-{
-       int             b;
-       struct y        c = (struct y *)&a;
-}
diff -r 05d5c0c98757 -r beaa14413cd9 tests/usr.bin/indent/surplusbad.0
--- a/tests/usr.bin/indent/surplusbad.0 Fri Oct 22 19:27:53 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-/*     $NetBSD: surplusbad.0,v 1.1 2019/04/04 15:27:35 kamil Exp $     */
-/* $FreeBSD: head/usr.bin/indent/tests/surplusbad.0 313544 2017-02-10 09:31:39Z pstef $ */
-/* See r303599 */
-#if defined(__i386__)
-int a;
-#elif defined(__amd64__)
-int b;
-#else
-#error "Port me"
-#endif
diff -r 05d5c0c98757 -r beaa14413cd9 tests/usr.bin/indent/surplusbad.0.pro
--- a/tests/usr.bin/indent/surplusbad.0.pro     Fri Oct 22 19:27:53 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-/*     $NetBSD: surplusbad.0.pro,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
-/* $FreeBSD: head/usr.bin/indent/tests/surplusbad.0.pro 314613 2017-03-03 20:15:22Z ngie $ */
--bad
diff -r 05d5c0c98757 -r beaa14413cd9 tests/usr.bin/indent/surplusbad.0.stdout
--- a/tests/usr.bin/indent/surplusbad.0.stdout  Fri Oct 22 19:27:53 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-/*     $NetBSD: surplusbad.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $      */
-/* $FreeBSD: head/usr.bin/indent/tests/surplusbad.0.stdout 313544 2017-02-10 09:31:39Z pstef $ */
-/* See r303599 */
-#if defined(__i386__)
-int            a;
-#elif defined(__amd64__)
-int            b;
-#else
-#error "Port me"
-#endif
diff -r 05d5c0c98757 -r beaa14413cd9 tests/usr.bin/indent/token_keyword_struct_union_enum.c
--- a/tests/usr.bin/indent/token_keyword_struct_union_enum.c    Fri Oct 22 19:27:53 2021 +0000
+++ b/tests/usr.bin/indent/token_keyword_struct_union_enum.c    Fri Oct 22 19:46:41 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: token_keyword_struct_union_enum.c,v 1.1 2021/10/18 22:30:34 rillig Exp $ */
+/* $NetBSD: token_keyword_struct_union_enum.c,v 1.2 2021/10/22 19:46:41 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -21,3 +21,50 @@
 #indent end
 
 #indent run-equals-input
+
+
+/* See FreeBSD r303485. */
+/* $FreeBSD: head/usr.bin/indent/tests/struct.0 334564 2018-06-03 16:21:15Z pstef $ */



Home | Main Index | Thread Index | Old Index