Module Name: src Committed By: rillig Date: Fri Oct 22 20:54:36 UTC 2021
Modified Files: src/distrib/sets/lists/tests: mi src/tests/usr.bin/indent: Makefile t_misc.sh Added Files: src/tests/usr.bin/indent: lex_char.c lex_string.c opt_P.c opt_T.c opt_bl_br.c opt_c.c opt_cd.c opt_ci.c opt_cli.c opt_d.c opt_di.c opt_i.c opt_l.c opt_lc.c opt_ldi.c opt_ta.c opt_ts.c Removed Files: src/tests/usr.bin/indent: lex_char.0 lex_char.0.pro lex_char.0.stdout lex_string.0 lex_string.0.pro lex_string.0.stdout opt-P.0 opt-P.0.pro opt-P.0.stdout opt-T.0 opt-T.0.pro opt-T.0.stdout opt-bl.0 opt-bl.0.pro opt-bl.0.stdout opt-br.0 opt-br.0.pro opt-br.0.stdout opt-c.0 opt-c.0.pro opt-c.0.stdout opt-cd.0 opt-cd.0.pro opt-cd.0.stdout opt-ci.0 opt-ci.0.pro opt-ci.0.stdout opt-cli.0 opt-cli.0.pro opt-cli.0.stdout opt-d.0 opt-d.0.pro opt-d.0.stdout opt-di.0 opt-di.0.pro opt-di.0.stdout opt-i.0 opt-i.0.pro opt-i.0.stdout opt-l.0 opt-l.0.pro opt-l.0.stdout opt-lc.0 opt-lc.0.pro opt-lc.0.stdout opt-ldi.0 opt-ldi.0.pro opt-ldi.0.stdout opt-ta.0 opt-ta.0.pro opt-ta.0.stdout opt-ts.0 opt-ts.0.pro opt-ts.0.stdout Log Message: tests/indent: migrate integer options tests to t_options To generate a diff of this commit: cvs rdiff -u -r1.1150 -r1.1151 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.26 -r1.27 src/tests/usr.bin/indent/Makefile cvs rdiff -u -r1.2 -r0 src/tests/usr.bin/indent/lex_char.0 \ src/tests/usr.bin/indent/lex_char.0.stdout \ src/tests/usr.bin/indent/lex_string.0 \ src/tests/usr.bin/indent/lex_string.0.stdout \ src/tests/usr.bin/indent/opt-P.0 src/tests/usr.bin/indent/opt-T.0 \ src/tests/usr.bin/indent/opt-T.0.stdout src/tests/usr.bin/indent/opt-bl.0 \ src/tests/usr.bin/indent/opt-bl.0.stdout \ src/tests/usr.bin/indent/opt-br.0 \ src/tests/usr.bin/indent/opt-br.0.stdout \ src/tests/usr.bin/indent/opt-c.0.stdout src/tests/usr.bin/indent/opt-cd.0 \ src/tests/usr.bin/indent/opt-cd.0.stdout \ src/tests/usr.bin/indent/opt-ci.0 \ src/tests/usr.bin/indent/opt-ci.0.stdout \ src/tests/usr.bin/indent/opt-cli.0 \ src/tests/usr.bin/indent/opt-cli.0.stdout \ src/tests/usr.bin/indent/opt-d.0 src/tests/usr.bin/indent/opt-d.0.stdout \ src/tests/usr.bin/indent/opt-di.0 \ src/tests/usr.bin/indent/opt-di.0.stdout src/tests/usr.bin/indent/opt-i.0 \ src/tests/usr.bin/indent/opt-i.0.stdout src/tests/usr.bin/indent/opt-l.0 \ src/tests/usr.bin/indent/opt-l.0.stdout src/tests/usr.bin/indent/opt-lc.0 \ src/tests/usr.bin/indent/opt-lc.0.stdout \ src/tests/usr.bin/indent/opt-ta.0 \ src/tests/usr.bin/indent/opt-ta.0.stdout \ src/tests/usr.bin/indent/opt-ts.0 \ src/tests/usr.bin/indent/opt-ts.0.stdout cvs rdiff -u -r1.1 -r0 src/tests/usr.bin/indent/lex_char.0.pro \ src/tests/usr.bin/indent/lex_string.0.pro \ src/tests/usr.bin/indent/opt-P.0.pro src/tests/usr.bin/indent/opt-T.0.pro \ src/tests/usr.bin/indent/opt-bl.0.pro \ src/tests/usr.bin/indent/opt-br.0.pro \ src/tests/usr.bin/indent/opt-c.0.pro \ src/tests/usr.bin/indent/opt-cd.0.pro \ src/tests/usr.bin/indent/opt-ci.0.pro \ src/tests/usr.bin/indent/opt-cli.0.pro \ src/tests/usr.bin/indent/opt-d.0.pro \ src/tests/usr.bin/indent/opt-di.0.pro \ src/tests/usr.bin/indent/opt-i.0.pro src/tests/usr.bin/indent/opt-l.0.pro \ src/tests/usr.bin/indent/opt-lc.0.pro \ src/tests/usr.bin/indent/opt-ldi.0.pro \ src/tests/usr.bin/indent/opt-ta.0.pro \ src/tests/usr.bin/indent/opt-ts.0.pro cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/indent/lex_char.c \ src/tests/usr.bin/indent/lex_string.c src/tests/usr.bin/indent/opt_P.c \ src/tests/usr.bin/indent/opt_T.c src/tests/usr.bin/indent/opt_bl_br.c \ src/tests/usr.bin/indent/opt_c.c src/tests/usr.bin/indent/opt_cd.c \ src/tests/usr.bin/indent/opt_ci.c src/tests/usr.bin/indent/opt_cli.c \ src/tests/usr.bin/indent/opt_d.c src/tests/usr.bin/indent/opt_di.c \ src/tests/usr.bin/indent/opt_i.c src/tests/usr.bin/indent/opt_l.c \ src/tests/usr.bin/indent/opt_lc.c src/tests/usr.bin/indent/opt_ldi.c \ src/tests/usr.bin/indent/opt_ta.c src/tests/usr.bin/indent/opt_ts.c cvs rdiff -u -r1.3 -r0 src/tests/usr.bin/indent/opt-P.0.stdout \ src/tests/usr.bin/indent/opt-c.0 src/tests/usr.bin/indent/opt-ldi.0 \ src/tests/usr.bin/indent/opt-ldi.0.stdout cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/indent/t_misc.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.1150 src/distrib/sets/lists/tests/mi:1.1151 --- src/distrib/sets/lists/tests/mi:1.1150 Fri Oct 22 19:46:41 2021 +++ src/distrib/sets/lists/tests/mi Fri Oct 22 20:54:36 2021 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1150 2021/10/22 19:46:41 rillig Exp $ +# $NetBSD: mi,v 1.1151 2021/10/22 20:54:36 rillig Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -4767,13 +4767,15 @@ ./usr/tests/usr.bin/indent/lex.0.pro tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/lex.0.stdout tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/lex.c tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/lex_char.0 tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/lex_char.0.pro tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/lex_char.0.stdout tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/indent/lex_char.0 tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/lex_char.0.pro tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/lex_char.0.stdout tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/lex_char.c tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/indent/lex_ident.c tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/lex_string.0 tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/lex_string.0.pro tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/lex_string.0.stdout tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/indent/lex_string.0 tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/lex_string.0.pro tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/lex_string.0.stdout tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/lex_string.c tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/indent/lineno.0 tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/lineno.0.pro tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/lineno.0.stdout tests-obsolete obsolete,atf @@ -4787,12 +4789,12 @@ ./usr/tests/usr.bin/indent/opt--version.0 tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/indent/opt--version.0.pro tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/indent/opt--version.0.stdout tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-P.0 tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-P.0.pro tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-P.0.stdout tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-T.0 tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-T.0.pro tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-T.0.stdout tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/indent/opt-P.0 tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-P.0.pro tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-P.0.stdout tests-obsolete obsolete,atf +./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 @@ -4818,42 +4820,42 @@ ./usr/tests/usr.bin/indent/opt-bc.0 tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-bc.0.pro tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-bc.0.stdout tests-obsolete obsolete,atf -./usr/tests/usr.bin/indent/opt-bl.0 tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-bl.0.pro tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-bl.0.stdout tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-br.0 tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-br.0.pro tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-br.0.stdout tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/indent/opt-bl.0 tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-bl.0.pro tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-bl.0.stdout tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-br.0 tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-br.0.pro tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-br.0.stdout tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-bs.0 tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-bs.0.pro tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-bs.0.stdout tests-obsolete obsolete,atf -./usr/tests/usr.bin/indent/opt-c.0 tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-c.0.pro tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-c.0.stdout tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-cd.0 tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-cd.0.pro tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-cd.0.stdout tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/indent/opt-c.0 tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-c.0.pro tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-c.0.stdout tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-cd.0 tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-cd.0.pro tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-cd.0.stdout tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-cdb.0 tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-cdb.0.pro tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-cdb.0.stdout tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-ce.0 tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-ce.0.pro tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-ce.0.stdout tests-obsolete obsolete,atf -./usr/tests/usr.bin/indent/opt-ci.0 tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-ci.0.pro tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-ci.0.stdout tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-cli.0 tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-cli.0.pro tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-cli.0.stdout tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/indent/opt-ci.0 tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-ci.0.pro tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-ci.0.stdout tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-cli.0 tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-cli.0.pro tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-cli.0.stdout tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-cs.0 tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-cs.0.pro tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-cs.0.stdout tests-obsolete obsolete,atf -./usr/tests/usr.bin/indent/opt-d.0 tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-d.0.pro tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-d.0.stdout tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-di.0 tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-di.0.pro tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-di.0.stdout tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/indent/opt-d.0 tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-d.0.pro tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-d.0.stdout tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-di.0 tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-di.0.pro tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-di.0.stdout tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-dj.0 tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-dj.0.pro tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-dj.0.stdout tests-obsolete obsolete,atf @@ -4872,21 +4874,21 @@ ./usr/tests/usr.bin/indent/opt-fcb.0 tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-fcb.0.pro tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-fcb.0.stdout tests-obsolete obsolete,atf -./usr/tests/usr.bin/indent/opt-i.0 tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-i.0.pro tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-i.0.stdout tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/indent/opt-i.0 tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-i.0.pro tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-i.0.stdout tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-ip.0 tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-ip.0.pro tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-ip.0.stdout tests-obsolete obsolete,atf -./usr/tests/usr.bin/indent/opt-l.0 tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-l.0.pro tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-l.0.stdout tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-lc.0 tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-lc.0.pro tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-lc.0.stdout tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-ldi.0 tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-ldi.0.pro tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-ldi.0.stdout tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/indent/opt-l.0 tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-l.0.pro tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-l.0.stdout tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-lc.0 tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-lc.0.pro tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-lc.0.stdout tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-ldi.0 tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-ldi.0.pro tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-ldi.0.stdout tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-lp.0 tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-lp.0.pro tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-lp.0.stdout tests-obsolete obsolete,atf @@ -4983,12 +4985,12 @@ ./usr/tests/usr.bin/indent/opt-sob.0 tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-sob.0.pro tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-sob.0.stdout tests-obsolete obsolete,atf -./usr/tests/usr.bin/indent/opt-ta.0 tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-ta.0.pro tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-ta.0.stdout tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-ts.0 tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-ts.0.pro tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/indent/opt-ts.0.stdout tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/indent/opt-ta.0 tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-ta.0.pro tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-ta.0.stdout tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-ts.0 tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-ts.0.pro tests-obsolete obsolete,atf +./usr/tests/usr.bin/indent/opt-ts.0.stdout tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-ut.0 tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-ut.0.pro tests-obsolete obsolete,atf ./usr/tests/usr.bin/indent/opt-ut.0.stdout tests-obsolete obsolete,atf Index: src/tests/usr.bin/indent/Makefile diff -u src/tests/usr.bin/indent/Makefile:1.26 src/tests/usr.bin/indent/Makefile:1.27 --- src/tests/usr.bin/indent/Makefile:1.26 Fri Oct 22 19:46:41 2021 +++ src/tests/usr.bin/indent/Makefile Fri Oct 22 20:54:36 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.26 2021/10/22 19:46:41 rillig Exp $ +# $NetBSD: Makefile,v 1.27 2021/10/22 20:54:36 rillig Exp $ .include <bsd.own.mk> @@ -17,12 +17,8 @@ FILES+= f_decls.0.stdout FILES+= indent_off_on.c FILES+= label.c FILES+= lex_ident.c -FILES+= lex_char.0 -FILES+= lex_char.0.pro -FILES+= lex_char.0.stdout -FILES+= lex_string.0 -FILES+= lex_string.0.pro -FILES+= lex_string.0.stdout +FILES+= lex_char.c +FILES+= lex_string.c FILES+= list_head.0 FILES+= list_head.0.stdout FILES+= offsetof.0 @@ -30,12 +26,6 @@ FILES+= offsetof.0.stdout FILES+= opt--version.0 FILES+= opt--version.0.pro FILES+= opt--version.0.stdout -FILES+= opt-P.0 -FILES+= opt-P.0.pro -FILES+= opt-P.0.stdout -FILES+= opt-T.0 -FILES+= opt-T.0.pro -FILES+= opt-T.0.stdout FILES+= opt-U.0 FILES+= opt-U.0.list FILES+= opt-U.0.pro @@ -43,77 +33,50 @@ FILES+= opt-U.0.stdout FILES+= opt-bap+sob.0 FILES+= opt-bap+sob.0.pro FILES+= opt-bap+sob.0.stdout -FILES+= opt-bl.0 -FILES+= opt-bl.0.pro -FILES+= opt-bl.0.stdout -FILES+= opt-br.0 -FILES+= opt-br.0.pro -FILES+= opt-br.0.stdout -FILES+= opt-c.0 -FILES+= opt-c.0.pro -FILES+= opt-c.0.stdout -FILES+= opt-cd.0 -FILES+= opt-cd.0.pro -FILES+= opt-cd.0.stdout -FILES+= opt-ci.0 -FILES+= opt-ci.0.pro -FILES+= opt-ci.0.stdout -FILES+= opt-cli.0 -FILES+= opt-cli.0.pro -FILES+= opt-cli.0.stdout -FILES+= opt-d.0 -FILES+= opt-d.0.pro -FILES+= opt-d.0.stdout -FILES+= opt-di.0 -FILES+= opt-di.0.pro -FILES+= opt-di.0.stdout -FILES+= opt-i.0 -FILES+= opt-i.0.pro -FILES+= opt-i.0.stdout -FILES+= opt-l.0 -FILES+= opt-l.0.pro -FILES+= opt-l.0.stdout -FILES+= opt-lc.0 -FILES+= opt-lc.0.pro -FILES+= opt-lc.0.stdout -FILES+= opt-ldi.0 -FILES+= opt-ldi.0.pro -FILES+= opt-ldi.0.stdout FILES+= opt-npro.0 FILES+= opt-npro.0.pro FILES+= opt-npro.0.stdout -FILES+= opt-ta.0 -FILES+= opt-ta.0.pro -FILES+= opt-ta.0.stdout -FILES+= opt-ts.0 -FILES+= opt-ts.0.pro -FILES+= opt-ts.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 FILES+= opt_bad.c FILES+= opt_badp.c FILES+= opt_bap.c FILES+= opt_bbb.c FILES+= opt_bc.c +FILES+= opt_bl_br.c FILES+= opt_bs.c +FILES+= opt_c.c +FILES+= opt_cd.c FILES+= opt_cdb.c FILES+= opt_ce.c +FILES+= opt_ci.c +FILES+= opt_cli.c FILES+= opt_cs.c +FILES+= opt_d.c +FILES+= opt_di.c FILES+= opt_dj.c FILES+= opt_eei.c FILES+= opt_ei.c FILES+= opt_fbs.c FILES+= opt_fc1.c FILES+= opt_fcb.c +FILES+= opt_i.c FILES+= opt_ip.c +FILES+= opt_l.c +FILES+= opt_lc.c +FILES+= opt_ldi.c FILES+= opt_lp.c FILES+= opt_lpl.c FILES+= opt_pcs.c FILES+= opt_psl.c FILES+= opt_sc.c FILES+= opt_sob.c +FILES+= opt_ta.c +FILES+= opt_ts.c FILES+= opt_ut.c FILES+= opt_v.c FILES+= ps_ind_level.c Index: src/tests/usr.bin/indent/t_misc.sh diff -u src/tests/usr.bin/indent/t_misc.sh:1.3 src/tests/usr.bin/indent/t_misc.sh:1.4 --- src/tests/usr.bin/indent/t_misc.sh:1.3 Fri Oct 22 19:27:53 2021 +++ src/tests/usr.bin/indent/t_misc.sh Fri Oct 22 20:54:36 2021 @@ -1,5 +1,5 @@ #! /bin/sh -# $NetBSD: t_misc.sh,v 1.3 2021/10/22 19:27:53 rillig Exp $ +# $NetBSD: t_misc.sh,v 1.4 2021/10/22 20:54:36 rillig Exp $ # # Copyright (c) 2021 The NetBSD Foundation, Inc. # All rights reserved. @@ -172,9 +172,28 @@ nested_struct_declarations_body() "$indent" -i1 -nut < 'code.c' } +atf_test_case 'option_P_in_profile_file' +option_P_in_profile_file_body() +{ + # Mentioning another profile via -P has no effect since only a single + # profile can be specified on the command line, and there is no + # 'include' option. + + # It's syntactically possible to specify a profile file inside another + # profile file. Such a profile file is ignored since only a single + # profile file is ever loaded. + printf '%s\n' '-P/nonexistent' > .indent.pro + + echo 'syntax # error' > code.c + + atf_check -o 'inline:syntax'"$nl"'#error'"$nl" \ + "$indent" < code.c +} + atf_init_test_cases() { atf_add_test_case 'in_place' atf_add_test_case 'verbose_profile' atf_add_test_case 'nested_struct_declarations' + atf_add_test_case 'option_P_in_profile_file' } Added files: Index: src/tests/usr.bin/indent/lex_char.c diff -u /dev/null src/tests/usr.bin/indent/lex_char.c:1.1 --- /dev/null Fri Oct 22 20:54:36 2021 +++ src/tests/usr.bin/indent/lex_char.c Fri Oct 22 20:54:36 2021 @@ -0,0 +1,26 @@ +/* $NetBSD: lex_char.c,v 1.1 2021/10/22 20:54:36 rillig Exp $ */ +/* $FreeBSD$ */ + +/* + * Test lexing of character constants. + */ + +#indent input +int simple = 'x'; +int multi = 'xy'; +int empty = ''; +int null = '\0'; +int escape_hex = '\x3f'; +int escape_octal = '\040'; +int escape_a = '\a'; +int escape_b = '\b'; +int escape_f = '\f'; +int escape_n = '\n'; +int escape_t = '\t'; +int escape_v = '\v'; +int escape_single_quote = '\''; +int escape_double_quote = '\"'; +int escape_backslash = '\\'; +#indent end + +#indent run-equals-input -di0 Index: src/tests/usr.bin/indent/lex_string.c diff -u /dev/null src/tests/usr.bin/indent/lex_string.c:1.1 --- /dev/null Fri Oct 22 20:54:36 2021 +++ src/tests/usr.bin/indent/lex_string.c Fri Oct 22 20:54:36 2021 @@ -0,0 +1,40 @@ +/* $NetBSD: lex_string.c,v 1.1 2021/10/22 20:54:36 rillig Exp $ */ +/* $FreeBSD$ */ + +/* + * Test lexing of string literals. + */ + +#indent input +char simple[] = "x"; +char multi[] = "xy"; +char empty[] = ""; +char null[] = "\0"; +char escape_hex[] = "\x3f"; +char escape_octal[] = "\040"; +char escape_a[] = "\a"; +char escape_b[] = "\b"; +char escape_f[] = "\f"; +char escape_n[] = "\n"; +char escape_t[] = "\t"; +char escape_v[] = "\v"; +char escape_single_quote[] = "\'"; +char escape_double_quote[] = "\""; +char escape_backslash[] = "\\"; + +char escape_newline[] = "\ +"; +#indent end + +#indent run-equals-input -di0 + +/* Concatenated string literals are separated with a single space. */ +#indent input +char concat[] = "line 1\n" +"line2" "has" "several""words\n"; +#indent end + +#indent run -di0 +char concat[] = "line 1\n" +"line2" "has" "several" "words\n"; +#indent end Index: src/tests/usr.bin/indent/opt_P.c diff -u /dev/null src/tests/usr.bin/indent/opt_P.c:1.1 --- /dev/null Fri Oct 22 20:54:36 2021 +++ src/tests/usr.bin/indent/opt_P.c Fri Oct 22 20:54:36 2021 @@ -0,0 +1,19 @@ +/* $NetBSD: opt_P.c,v 1.1 2021/10/22 20:54:36 rillig Exp $ */ +/* $FreeBSD$ */ + +/* + * Tests for the option '-P', which specifies a profile file to be used + * instead of '$HOME/.indent.pro'. + * + * The format of the tests in t_options.sh does not allow the tests to create + * arbitrary files, therefore this test is rather restricted. See t_misc.sh + * for more related tests with individual setup. + */ + +#indent input +int decl; +#indent end + +#indent run -di24 -P/dev/null -di32 +int decl; +#indent end Index: src/tests/usr.bin/indent/opt_T.c diff -u /dev/null src/tests/usr.bin/indent/opt_T.c:1.1 --- /dev/null Fri Oct 22 20:54:36 2021 +++ src/tests/usr.bin/indent/opt_T.c Fri Oct 22 20:54:36 2021 @@ -0,0 +1,28 @@ +/* $NetBSD: opt_T.c,v 1.1 2021/10/22 20:54:36 rillig Exp $ */ +/* $FreeBSD$ */ + +#indent input +void +example(void *arg) +{ + int cast = (custom_type_name) * arg; + + int mult = (unknown_type_name) * arg; + + /* See the option -ta for handling these types. */ + int suff = (unknown_type_name_t) * arg; +} +#indent end + +#indent run -Tcustom_type_name +void +example(void *arg) +{ + int cast = (custom_type_name)*arg; + + int mult = (unknown_type_name) * arg; + + /* See the option -ta for handling these types. */ + int suff = (unknown_type_name_t) * arg; +} +#indent end Index: src/tests/usr.bin/indent/opt_bl_br.c diff -u /dev/null src/tests/usr.bin/indent/opt_bl_br.c:1.1 --- /dev/null Fri Oct 22 20:54:36 2021 +++ src/tests/usr.bin/indent/opt_bl_br.c Fri Oct 22 20:54:36 2021 @@ -0,0 +1,67 @@ +/* $NetBSD: opt_bl_br.c,v 1.1 2021/10/22 20:54:36 rillig Exp $ */ +/* $FreeBSD$ */ + +#indent input +void +example(int n) +{ + /* + * XXX: The '} else' looks strange in this style since the 'else' is + * not at the left margin of the code. + */ + if (n > 99) { print("large"); } + else if (n > 9) { print("double-digit"); } + else if (n > 0) print("positive"); + else { print("negative"); } +} +#indent end + +#indent run -bl +void +example(int n) +{ + /* + * XXX: The '} else' looks strange in this style since the 'else' is + * not at the left margin of the code. + */ + if (n > 99) + { + print("large"); + } else if (n > 9) + { + print("double-digit"); + } else if (n > 0) + print("positive"); + else + { + print("negative"); + } +} +#indent end + +#indent input +void +example(int n) +{ + if (n > 99) { print("large"); } + else if (n > 9) { print("double-digit"); } + else if (n > 0) print("positive"); + else { print("negative"); } +} +#indent end + +#indent run -br +void +example(int n) +{ + if (n > 99) { + print("large"); + } else if (n > 9) { + print("double-digit"); + } else if (n > 0) + print("positive"); + else { + print("negative"); + } +} +#indent end Index: src/tests/usr.bin/indent/opt_c.c diff -u /dev/null src/tests/usr.bin/indent/opt_c.c:1.1 --- /dev/null Fri Oct 22 20:54:36 2021 +++ src/tests/usr.bin/indent/opt_c.c Fri Oct 22 20:54:36 2021 @@ -0,0 +1,26 @@ +/* $NetBSD: opt_c.c,v 1.1 2021/10/22 20:54:36 rillig Exp $ */ +/* $FreeBSD$ */ + +#indent input +bool +is_prime(int n) +{ + if (n <= 3) + return n >= 2; /* special case */ + if (n % 2 == 0) + return false; /* even numbers */ + return true; +} +#indent end + +#indent run -c49 +bool +is_prime(int n) +{ + if (n <= 3) + return n >= 2; /* special case */ + if (n % 2 == 0) + return false; /* even numbers */ + return true; +} +#indent end Index: src/tests/usr.bin/indent/opt_cd.c diff -u /dev/null src/tests/usr.bin/indent/opt_cd.c:1.1 --- /dev/null Fri Oct 22 20:54:36 2021 +++ src/tests/usr.bin/indent/opt_cd.c Fri Oct 22 20:54:36 2021 @@ -0,0 +1,10 @@ +/* $NetBSD: opt_cd.c,v 1.1 2021/10/22 20:54:36 rillig Exp $ */ +/* $FreeBSD$ */ + +#indent input +int aflag; /* Apply to all files. */ +#indent end + +#indent run -cd49 +int aflag; /* Apply to all files. */ +#indent end Index: src/tests/usr.bin/indent/opt_ci.c diff -u /dev/null src/tests/usr.bin/indent/opt_ci.c:1.1 --- /dev/null Fri Oct 22 20:54:36 2021 +++ src/tests/usr.bin/indent/opt_ci.c Fri Oct 22 20:54:36 2021 @@ -0,0 +1,20 @@ +/* $NetBSD: opt_ci.c,v 1.1 2021/10/22 20:54:36 rillig Exp $ */ +/* $FreeBSD$ */ + +#indent input +int +sum(int a, int b) +{ + return a + + b; +} +#indent end + +#indent run -ci2 +int +sum(int a, int b) +{ + return a + + b; +} +#indent end Index: src/tests/usr.bin/indent/opt_cli.c diff -u /dev/null src/tests/usr.bin/indent/opt_cli.c:1.1 --- /dev/null Fri Oct 22 20:54:36 2021 +++ src/tests/usr.bin/indent/opt_cli.c Fri Oct 22 20:54:36 2021 @@ -0,0 +1,41 @@ +/* $NetBSD: opt_cli.c,v 1.1 2021/10/22 20:54:36 rillig Exp $ */ +/* $FreeBSD$ */ + +#indent input +void +classify(int n) +{ + switch (n) { + case 0: print("zero"); break; + case 1: print("one"); break; + case 2: case 3: print("prime"); break; + case 4: print("square"); break; + default: print("large"); break; + } +} +#indent end + +#indent run -cli1.5 +void +classify(int n) +{ + switch (n) { + case 0: + print("zero"); + break; + case 1: + print("one"); + break; + case 2: + case 3: + print("prime"); + break; + case 4: + print("square"); + break; + default: + print("large"); + break; + } +} +#indent end Index: src/tests/usr.bin/indent/opt_d.c diff -u /dev/null src/tests/usr.bin/indent/opt_d.c:1.1 --- /dev/null Fri Oct 22 20:54:36 2021 +++ src/tests/usr.bin/indent/opt_d.c Fri Oct 22 20:54:36 2021 @@ -0,0 +1,39 @@ +/* $NetBSD: opt_d.c,v 1.1 2021/10/22 20:54:36 rillig Exp $ */ +/* $FreeBSD$ */ + +/* XXX: oops, the comments at level 0 move below the '{' */ +#indent input +void +example(void) +/* comment at level 0 */ + /* comment at level 0 */ +{ +/* comment at level 1 */ + /* comment at level 1 */ + /* comment at level 1 */ + { +/* comment at level 2 */ + /* comment at level 2 */ + /* comment at level 2 */ + /* comment at level 2 */ + } +} +#indent end + +#indent run -d1 +void +example(void) +{ +/* comment at level 0 */ +/* comment at level 0 */ +/* comment at level 1 */ +/* comment at level 1 */ +/* comment at level 1 */ + { + /* comment at level 2 */ + /* comment at level 2 */ + /* comment at level 2 */ + /* comment at level 2 */ + } +} +#indent end Index: src/tests/usr.bin/indent/opt_di.c diff -u /dev/null src/tests/usr.bin/indent/opt_di.c:1.1 --- /dev/null Fri Oct 22 20:54:36 2021 +++ src/tests/usr.bin/indent/opt_di.c Fri Oct 22 20:54:36 2021 @@ -0,0 +1,18 @@ +/* $NetBSD: opt_di.c,v 1.1 2021/10/22 20:54:36 rillig Exp $ */ +/* $FreeBSD$ */ + +#indent input +int space; +int tab; +int tab16; + +struct long_name long_name; +#indent end + +#indent run -di8 +int space; +int tab; +int tab16; + +struct long_name long_name; +#indent end Index: src/tests/usr.bin/indent/opt_i.c diff -u /dev/null src/tests/usr.bin/indent/opt_i.c:1.1 --- /dev/null Fri Oct 22 20:54:36 2021 +++ src/tests/usr.bin/indent/opt_i.c Fri Oct 22 20:54:36 2021 @@ -0,0 +1,21 @@ +/* $NetBSD: opt_i.c,v 1.1 2021/10/22 20:54:36 rillig Exp $ */ +/* $FreeBSD$ */ + +#indent input +void +example(void) +{ + if (1 > 0) if (2 > 1) return yes; return no; +} +#indent end + +#indent run -i3 +void +example(void) +{ + if (1 > 0) + if (2 > 1) + return yes; + return no; +} +#indent end Index: src/tests/usr.bin/indent/opt_l.c diff -u /dev/null src/tests/usr.bin/indent/opt_l.c:1.1 --- /dev/null Fri Oct 22 20:54:36 2021 +++ src/tests/usr.bin/indent/opt_l.c Fri Oct 22 20:54:36 2021 @@ -0,0 +1,59 @@ +/* $NetBSD: opt_l.c,v 1.1 2021/10/22 20:54:36 rillig Exp $ */ +/* $FreeBSD$ */ + +#indent input +/* + * With a line length of 38, this comment and the next one are broken. + */ + +/* The options -l and -lc produce the same output. */ +#indent end + +#indent run -l38 +/* + * With a line length of 38, this + * comment and the next one are + * broken. + */ + +/* + * The options -l and -lc produce the + * same output. + */ +#indent end +#indent run-equals-prev-output -lc38 + + +#indent input +int decl; /* comment comment comment comment */ +#indent end + +#indent run -di8 -c17 -lc32 +int decl; /* comment comment comment comment */ +#indent end + +#indent run -di8 -c17 -l32 +int decl; /* comment comment + * comment comment */ +#indent end + + +/* + * FIXME: Even though the line length is limited with -l38, + * the overly long lines in the code are not broken. + */ +#indent input +void +example(int a, int b, int c, const char *cp) +{ + for (const char *p = cp; *p != '\0'; p++) + if (*p > a) + if (*p > b) + if (*p > c) + return; + + function(1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10); +} +#indent end + +#indent run-equals-input -l38 Index: src/tests/usr.bin/indent/opt_lc.c diff -u /dev/null src/tests/usr.bin/indent/opt_lc.c:1.1 --- /dev/null Fri Oct 22 20:54:36 2021 +++ src/tests/usr.bin/indent/opt_lc.c Fri Oct 22 20:54:36 2021 @@ -0,0 +1,24 @@ +/* $NetBSD: opt_lc.c,v 1.1 2021/10/22 20:54:36 rillig Exp $ */ +/* $FreeBSD$ */ + +/* + * Tests for the option '-lc', which specifies the maximum line length for + * block comments. This option does not apply to comments to the right of the + * code though, or to the code itself. + */ + +#indent input +void +example(int a, int b, int c, const char *cp) +{ + for (const char *p = cp; *p != '\0'; p++) + if (*p > a) + if (*p > b) + if (*p > c) + return; + + function(1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10); +} +#indent end + +#indent run-equals-input -lc38 Index: src/tests/usr.bin/indent/opt_ldi.c diff -u /dev/null src/tests/usr.bin/indent/opt_ldi.c:1.1 --- /dev/null Fri Oct 22 20:54:36 2021 +++ src/tests/usr.bin/indent/opt_ldi.c Fri Oct 22 20:54:36 2021 @@ -0,0 +1,37 @@ +/* $NetBSD: opt_ldi.c,v 1.1 2021/10/22 20:54:36 rillig Exp $ */ +/* $FreeBSD$ */ + +/* + * Tests for the option '-ldi', which specifies where the variable names of + * locally declared variables are placed. + */ + +#indent input +int global; + +void +function(void) +{ + int local; +} +#indent end + +#indent run -ldi8 +int global; + +void +function(void) +{ + int local; +} +#indent end + +#indent run -ldi24 +int global; + +void +function(void) +{ + int local; +} +#indent end Index: src/tests/usr.bin/indent/opt_ta.c diff -u /dev/null src/tests/usr.bin/indent/opt_ta.c:1.1 --- /dev/null Fri Oct 22 20:54:36 2021 +++ src/tests/usr.bin/indent/opt_ta.c Fri Oct 22 20:54:36 2021 @@ -0,0 +1,22 @@ +/* $NetBSD: opt_ta.c,v 1.1 2021/10/22 20:54:36 rillig Exp $ */ +/* $FreeBSD$ */ + +#indent input +void +example(void *arg) +{ + int mult = (unknown_type_name) * arg; + + int suff = (unknown_type_name_t) * arg; +} +#indent end + +#indent run -ta +void +example(void *arg) +{ + int mult = (unknown_type_name) * arg; + + int suff = (unknown_type_name_t)*arg; +} +#indent end Index: src/tests/usr.bin/indent/opt_ts.c diff -u /dev/null src/tests/usr.bin/indent/opt_ts.c:1.1 --- /dev/null Fri Oct 22 20:54:36 2021 +++ src/tests/usr.bin/indent/opt_ts.c Fri Oct 22 20:54:36 2021 @@ -0,0 +1,33 @@ +/* $NetBSD: opt_ts.c,v 1.1 2021/10/22 20:54:36 rillig Exp $ */ +/* $FreeBSD$ */ + +/* + * Tests for the option '-ts', which specifies the width of a single + * tabulator. + */ + +/* + * Since in this test, a tab is only worth 4 spaces, the indentation needs + * more tabs to reach the indentation of 8 and the alignment at 16. + */ +#indent input +int variable; + +void +function(void) +{ + int local_variable; + char local_variable; +} +#indent end + +#indent run -ts4 +int variable; + +void +function(void) +{ + int local_variable; + char local_variable; +} +#indent end