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 remaining tests f...



details:   https://anonhg.NetBSD.org/src/rev/ecc7ce42ae65
branches:  trunk
changeset: 1024440:ecc7ce42ae65
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Oct 23 21:45:14 2021 +0000

description:
tests/indent: migrate remaining tests from t_indent to t_options

The test types_from_file was a subset of opt_U and thus has been
removed.

diffstat:

 distrib/sets/lists/tests/mi                   |   32 +++---
 tests/usr.bin/indent/Makefile                 |   17 +---
 tests/usr.bin/indent/opt-U.0                  |   10 --
 tests/usr.bin/indent/opt-U.0.list             |   17 ---
 tests/usr.bin/indent/opt-U.0.pro              |    4 -
 tests/usr.bin/indent/opt-U.0.stdout           |   10 --
 tests/usr.bin/indent/opt-npro.0               |    8 -
 tests/usr.bin/indent/opt-npro.0.pro           |    4 -
 tests/usr.bin/indent/opt-npro.0.stdout        |    8 -
 tests/usr.bin/indent/opt.0                    |   12 --
 tests/usr.bin/indent/opt.0.pro                |   22 ----
 tests/usr.bin/indent/opt.0.stdout             |   24 -----
 tests/usr.bin/indent/t_indent.sh              |   98 ---------------------
 tests/usr.bin/indent/t_misc.sh                |  121 +++++++++++++++++++++++++-
 tests/usr.bin/indent/types_from_file.0        |    4 -
 tests/usr.bin/indent/types_from_file.0.list   |    2 -
 tests/usr.bin/indent/types_from_file.0.pro    |    3 -
 tests/usr.bin/indent/types_from_file.0.stdout |    4 -
 18 files changed, 137 insertions(+), 263 deletions(-)

diffs (truncated from 548 to 300 lines):

diff -r 65cee29095c2 -r ecc7ce42ae65 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Sat Oct 23 20:40:23 2021 +0000
+++ b/distrib/sets/lists/tests/mi       Sat Oct 23 21:45:14 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1160 2021/10/23 20:30:23 rillig Exp $
+# $NetBSD: mi,v 1.1161 2021/10/23 21:45:14 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4798,10 +4798,10 @@
 ./usr/tests/usr.bin/indent/opt-T.0                                     tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/opt-T.0.pro                                 tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/opt-T.0.stdout                              tests-obsolete          obsolete,atf
-./usr/tests/usr.bin/indent/opt-U.0                                     tests-usr.bin-tests     compattestfile,atf
-./usr/tests/usr.bin/indent/opt-U.0.list                                        tests-usr.bin-tests     compattestfile,atf
-./usr/tests/usr.bin/indent/opt-U.0.pro                                 tests-usr.bin-tests     compattestfile,atf
-./usr/tests/usr.bin/indent/opt-U.0.stdout                              tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/indent/opt-U.0                                     tests-obsolete          obsolete,atf
+./usr/tests/usr.bin/indent/opt-U.0.list                                        tests-obsolete          obsolete,atf
+./usr/tests/usr.bin/indent/opt-U.0.pro                                 tests-obsolete          obsolete,atf
+./usr/tests/usr.bin/indent/opt-U.0.stdout                              tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/opt-bacc.0                                  tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/opt-bacc.0.pro                              tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/opt-bacc.0.stdout                           tests-obsolete          obsolete,atf
@@ -4958,9 +4958,9 @@
 ./usr/tests/usr.bin/indent/opt-npcs.0                                  tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/opt-npcs.0.pro                              tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/opt-npcs.0.stdout                           tests-obsolete          obsolete,atf
-./usr/tests/usr.bin/indent/opt-npro.0                                  tests-usr.bin-tests     compattestfile,atf
-./usr/tests/usr.bin/indent/opt-npro.0.pro                              tests-usr.bin-tests     compattestfile,atf
-./usr/tests/usr.bin/indent/opt-npro.0.stdout                           tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/indent/opt-npro.0                                  tests-obsolete          obsolete,atf
+./usr/tests/usr.bin/indent/opt-npro.0.pro                              tests-obsolete          obsolete,atf
+./usr/tests/usr.bin/indent/opt-npro.0.stdout                           tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/opt-npsl.0                                  tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/opt-npsl.0.pro                              tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/opt-npsl.0.stdout                           tests-obsolete          obsolete,atf
@@ -5000,9 +5000,9 @@
 ./usr/tests/usr.bin/indent/opt-v.0                                     tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/opt-v.0.pro                                 tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/opt-v.0.stdout                              tests-obsolete          obsolete,atf
-./usr/tests/usr.bin/indent/opt.0                                       tests-usr.bin-tests     compattestfile,atf
-./usr/tests/usr.bin/indent/opt.0.pro                                   tests-usr.bin-tests     compattestfile,atf
-./usr/tests/usr.bin/indent/opt.0.stdout                                        tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/indent/opt.0                                       tests-obsolete          obsolete,atf
+./usr/tests/usr.bin/indent/opt.0.pro                                   tests-obsolete          obsolete,atf
+./usr/tests/usr.bin/indent/opt.0.stdout                                        tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/opt_P.c                                     tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/indent/opt_T.c                                     tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/indent/opt_bacc.c                                  tests-usr.bin-tests     compattestfile,atf
@@ -5061,7 +5061,7 @@
 ./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_indent                                    tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/t_misc                                      tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/indent/t_options                                   tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/indent/t_options.awk                               tests-usr.bin-tests     compattestfile,atf
@@ -5217,10 +5217,10 @@
 ./usr/tests/usr.bin/indent/token_type_def.c                            tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/indent/token_unary_op.c                            tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/indent/token_while_expr.c                          tests-usr.bin-tests     compattestfile,atf
-./usr/tests/usr.bin/indent/types_from_file.0                           tests-usr.bin-tests     compattestfile,atf
-./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/types_from_file.0                           tests-obsolete          obsolete,atf
+./usr/tests/usr.bin/indent/types_from_file.0.list                      tests-obsolete          obsolete,atf
+./usr/tests/usr.bin/indent/types_from_file.0.pro                       tests-obsolete          obsolete,atf
+./usr/tests/usr.bin/indent/types_from_file.0.stdout                    tests-obsolete          obsolete,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
diff -r 65cee29095c2 -r ecc7ce42ae65 tests/usr.bin/indent/Makefile
--- a/tests/usr.bin/indent/Makefile     Sat Oct 23 20:40:23 2021 +0000
+++ b/tests/usr.bin/indent/Makefile     Sat Oct 23 21:45:14 2021 +0000
@@ -1,10 +1,9 @@
-#      $NetBSD: Makefile,v 1.32 2021/10/23 20:30:23 rillig Exp $
+#      $NetBSD: Makefile,v 1.33 2021/10/23 21:45:14 rillig Exp $
 
 .include <bsd.own.mk>
 
 TESTSDIR=      ${TESTSBASE}/usr.bin/indent
 TESTS_SH=      t_errors
-TESTS_SH+=     t_indent
 TESTS_SH+=     t_misc
 TESTS_SH+=     t_options
 
@@ -18,16 +17,6 @@
 FILES+=                lex_ident.c
 FILES+=                lex_char.c
 FILES+=                lex_string.c
-FILES+=                opt-U.0
-FILES+=                opt-U.0.list
-FILES+=                opt-U.0.pro
-FILES+=                opt-U.0.stdout
-FILES+=                opt-npro.0
-FILES+=                opt-npro.0.pro
-FILES+=                opt-npro.0.stdout
-FILES+=                opt.0
-FILES+=                opt.0.pro
-FILES+=                opt.0.stdout
 FILES+=                opt_P.c
 FILES+=                opt_T.c
 FILES+=                opt_bacc.c
@@ -110,10 +99,6 @@
 FILES+=                token_type_def.c
 FILES+=                token_unary_op.c
 FILES+=                token_while_expr.c
-FILES+=                types_from_file.0
-FILES+=                types_from_file.0.stdout
-FILES+=                types_from_file.0.list
-FILES+=                types_from_file.0.pro
 
 add-test: .PHONY
        @set -eu; \
diff -r 65cee29095c2 -r ecc7ce42ae65 tests/usr.bin/indent/opt-U.0
--- a/tests/usr.bin/indent/opt-U.0      Sat Oct 23 20:40:23 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-/* $NetBSD: opt-U.0,v 1.2 2021/03/07 10:12:18 rillig Exp $ */
-/* $FreeBSD$ */
-
-void
-example(void *arg)
-{
-       int known_1 = (size_t)   *   arg;
-       int known_2 = (off_t)   *   arg;
-       int ignored = (ignored_t)   *   arg;
-}
diff -r 65cee29095c2 -r ecc7ce42ae65 tests/usr.bin/indent/opt-U.0.list
--- a/tests/usr.bin/indent/opt-U.0.list Sat Oct 23 20:40:23 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-/* $NetBSD: opt-U.0.list,v 1.1 2021/03/06 17:56:33 rillig Exp $ */
-/* $FreeBSD$ */
-
-/*
- * From each line of this file, the first word is taken to be a type name.
- *
- * Since neither '/*' nor '' are syntactically valid type names, this means
- * that comments like this one are effectively ignored.  When a type name is
- * indented by whitespace, it is ignored as well.
- *
- * Since only the first word of each line is relevant, any remaining words
- * can be used for comments.
- */
-
-size_t                 from stddef.h
-off_t                  for file offsets
- ignored_t             is ignored since it is indented
diff -r 65cee29095c2 -r ecc7ce42ae65 tests/usr.bin/indent/opt-U.0.pro
--- a/tests/usr.bin/indent/opt-U.0.pro  Sat Oct 23 20:40:23 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-/* $NetBSD: opt-U.0.pro,v 1.1 2021/03/06 17:56:33 rillig Exp $ */
-/* $FreeBSD$ */
-
--Uopt-U.0.list
diff -r 65cee29095c2 -r ecc7ce42ae65 tests/usr.bin/indent/opt-U.0.stdout
--- a/tests/usr.bin/indent/opt-U.0.stdout       Sat Oct 23 20:40:23 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-/* $NetBSD: opt-U.0.stdout,v 1.2 2021/03/07 10:12:18 rillig Exp $ */
-/* $FreeBSD$ */
-
-void
-example(void *arg)
-{
-       int             known_1 = (size_t)*arg;
-       int             known_2 = (off_t)*arg;
-       int             ignored = (ignored_t) * arg;
-}
diff -r 65cee29095c2 -r ecc7ce42ae65 tests/usr.bin/indent/opt-npro.0
--- a/tests/usr.bin/indent/opt-npro.0   Sat Oct 23 20:40:23 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-/* $NetBSD: opt-npro.0,v 1.2 2021/03/07 10:12:18 rillig Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Mentioning the option -npro in a .pro file has no effect since at that
- * point, indent has already decided to load the .pro file, and it only
- * decides once.
- */
diff -r 65cee29095c2 -r ecc7ce42ae65 tests/usr.bin/indent/opt-npro.0.pro
--- a/tests/usr.bin/indent/opt-npro.0.pro       Sat Oct 23 20:40:23 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-/* $NetBSD: opt-npro.0.pro,v 1.1 2021/03/06 17:56:34 rillig Exp $ */
-/* $FreeBSD$ */
-
--npro
diff -r 65cee29095c2 -r ecc7ce42ae65 tests/usr.bin/indent/opt-npro.0.stdout
--- a/tests/usr.bin/indent/opt-npro.0.stdout    Sat Oct 23 20:40:23 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-/* $NetBSD: opt-npro.0.stdout,v 1.2 2021/03/07 10:12:18 rillig Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Mentioning the option -npro in a .pro file has no effect since at that
- * point, indent has already decided to load the .pro file, and it only
- * decides once.
- */
diff -r 65cee29095c2 -r ecc7ce42ae65 tests/usr.bin/indent/opt.0
--- a/tests/usr.bin/indent/opt.0        Sat Oct 23 20:40:23 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-/* $NetBSD: opt.0,v 1.1 2021/10/07 18:07:25 rillig Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Test parsing of command line options from a profile file.
- */
-
-int global_var;
-
-int function(int expr) {
-switch (expr) { case 1: return 1; default: return 0; }
-}
diff -r 65cee29095c2 -r ecc7ce42ae65 tests/usr.bin/indent/opt.0.pro
--- a/tests/usr.bin/indent/opt.0.pro    Sat Oct 23 20:40:23 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-/* $NetBSD: opt.0.pro,v 1.3 2021/10/17 18:13:00 rillig Exp $ */
-/* $FreeBSD$ */
-
-/* The latter of the two options wins. */
--di5
--di12
-
-/* It is possible to embed comments in the options, but nobody does that. */
--/* comment */bacc
--T/* define a type */custom_type
-
-/* For int options, trailing garbage would lead to an error message. */
--i3
-
-/*
- * For float options, trailing garbage is ignored.
- *
- * See atof.
- */
--cli3.5garbage
-
--b/*/acc       /* The comment is '/' '*' '/', making the option '-bacc'. */
diff -r 65cee29095c2 -r ecc7ce42ae65 tests/usr.bin/indent/opt.0.stdout
--- a/tests/usr.bin/indent/opt.0.stdout Sat Oct 23 20:40:23 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-/* $NetBSD: opt.0.stdout,v 1.1 2021/10/07 18:07:25 rillig Exp $ */
-/* $FreeBSD$ */
-
-/*
- * Test parsing of command line options from a profile file.
- */
-
-/* $ The variable name is indented by 12 characters due to -di12. */
-int        global_var;
-
-int
-function(int expr)
-{
-   switch (expr) {
-/* $ The indentation is 3 + (int)(3.5 * 3), so 3 + 10.5, so 13. */
-/* $ See parse.c, function parse, 'case switch_expr'. */
-            case 1:
-/* $ The indentation is 3 + (int)3.5 * 3 + 3, so 3 + 9 + 3, so 15. */
-/* $ See parse.c, function parse, 'case switch_expr'. */
-              return 1;
-            default:
-              return 0;
-   }
-}
diff -r 65cee29095c2 -r ecc7ce42ae65 tests/usr.bin/indent/t_indent.sh
--- a/tests/usr.bin/indent/t_indent.sh  Sat Oct 23 20:40:23 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-#! /bin/sh
-# $NetBSD: t_indent.sh,v 1.7 2021/09/25 12:47:17 rillig Exp $
-#
-# Copyright 2016 Dell EMC
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT



Home | Main Index | Thread Index | Old Index