#
1.49 |
|
16-Jun-2023 |
rillig |
indent: merge lexer symbols for type in/outside parentheses
|
#
1.48 |
|
14-Jun-2023 |
rillig |
indent: merge parser symbols for stmt and stmt_list
They were handled in exactly the same way.
|
#
1.47 |
|
20-May-2023 |
rillig |
tests/indent: migrate test driver from AWK to Lua
Lua reports more details when os.execute fails, which is useful when running old versions of indent for comparison. The new test driver also supports multiple test files in the same run.
|
#
1.46 |
|
13-May-2023 |
rillig |
tests/indent: add test for lexing of numbers
|
Revision tags: netbsd-10-base
|
#
1.45 |
|
24-Apr-2022 |
rillig |
tests/indent: migrate token tests to other tests
In indent.h 1.49 from 2021-10-25, the enumeration token_type was split into lexer_symbol and parser_symbol to more clearly express that these tokens fall into completely different classes of usage patterns.
|
#
1.44 |
|
24-Apr-2022 |
rillig |
tests/indent: change directive from '#' to '//'
Using a '//' instead of '#' turns the directives into well-formed C code, resulting in fewer error markers in the editor.
|
#
1.43 |
|
24-Apr-2022 |
rillig |
tests/indent: migrate tests for parentheses, brackets, braces
|
#
1.42 |
|
23-Apr-2022 |
rillig |
tests/indent: migrate tests for the tokens '{' and '.'
|
#
1.41 |
|
23-Apr-2022 |
rillig |
tests/indent: migrate a few token tests to psym tests
|
#
1.40 |
|
22-Apr-2022 |
rillig |
indent: remove FreeBSD IDs
Most of the IDs were empty anyway.
|
#
1.39 |
|
28-Nov-2021 |
rillig |
tests/indent: migrate token_question to lsym_question and extend it
|
#
1.38 |
|
28-Nov-2021 |
rillig |
tests/indent: migrate test token_case_label to lsym_case_label
|
#
1.37 |
|
28-Nov-2021 |
rillig |
tests/indent: migrate token_comma to lsym_comma
The section on initializer values is new.
|
#
1.36 |
|
28-Nov-2021 |
rillig |
tests/indent: move test for ':' to lsym_token.c
|
#
1.35 |
|
28-Nov-2021 |
rillig |
indent: treat L"string" as a single token
There is never whitespace between the 'L' and the string literal or the character constant. There might be a backslash-newline between them, but that case was not handled before either.
No functional change.
|
#
1.34 |
|
18-Nov-2021 |
rillig |
tests/indent: add skeletons for testing tokens and parser symbols
The constants that were previously defined in indent_codes.h were a wild mixture of tokens from the lexer and symbols on the parser stack. They were split into separate types starting at indent.h 1.49 from 2021-10-25 and finishing at 1.73 from 2021-10-31.
To match the tests with the new token names, the old tests need to be migrated to the newly added tests. This will take some time so first add the skeletons and migrate them in smaller steps, cleaning them up and extending them on the way.
|
#
1.33 |
|
23-Oct-2021 |
rillig |
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.
|
#
1.32 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate test for '-bap -sob' to t_options
|
#
1.31 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate test for '--version' to t_options
|
#
1.30 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate test for offsetof to t_options
|
#
1.29 |
|
23-Oct-2021 |
rillig |
tests/indent: remove redundant test list_head
The test cases are already in fmt_decl.c, in old_style_definition and LIST_HEAD.
|
#
1.28 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate f_decls to using t_options, add more tests
|
#
1.27 |
|
22-Oct-2021 |
rillig |
tests/indent: migrate integer options tests to t_options
|
#
1.26 |
|
22-Oct-2021 |
rillig |
tests/indent: migrate tests for parentheses, struct, #if, wide char
|
#
1.25 |
|
22-Oct-2021 |
rillig |
tests/indent: migrate a few more tests to t_options
|
#
1.24 |
|
19-Oct-2021 |
rillig |
tests/indent: add test for INDENT OFF/ON comments
Just to prevent unintended side effects when fixing bugs in this area.
|
#
1.23 |
|
19-Oct-2021 |
rillig |
tests/indent: make add-test generate flexible tests
They need fewer source files and are more versatile.
|
#
1.22 |
|
18-Oct-2021 |
rillig |
tests/indent: remove redundant tests for '-ncs' and '-pcs'
These tests are already covered by opt_cs.c and opt_pcs.c.
|
#
1.21 |
|
18-Oct-2021 |
rillig |
tests/indent: condense test for indentation level, add missing files
|
#
1.20 |
|
18-Oct-2021 |
rillig |
tests/indent: condense the token tests
This reduces the number of files in the test directory. It also allows the tests to be read from top to bottom, looking at only a single file.
Since t_options.awk complains about files that don't have any test case at all, add some test for each token kind. Most of the tests had previously been effectively empty.
|
#
1.19 |
|
18-Oct-2021 |
rillig |
tests/indent: extend tests for labels, extract test driver
Having the test driver in a separate file allows to run it on its own, as 'awk -f t_options.awk label.c'. When the test driver warns, exit 1; this is only needed for the standalone version, when run from inside ATF the warnings on stderr already suffice to make the test fail in the end.
|
#
1.18 |
|
18-Oct-2021 |
rillig |
tests/indent: consolidate tests for comments
These tests have been the motivation for t_options.sh, which allows to run indent with various command line options on the same input, without having to create 3 files per test case.
A test file actually contains several tests, all separated by '#indent' directives. Isolating each of these tests is simpler than having to pick up the corresponding sections from 3 separate files. Running indent on each small test case isolates the test cases from each other, preventing them to influence later test cases. Exactly this had happened when support for C99 comments was added in March 2021, which later turned out to be done wrong.
|
#
1.17 |
|
18-Oct-2021 |
rillig |
tests/indent: merge tests for numbers into token_ident
The previous tests 'binary' and 'float' not only test binary and floating point numbers, making their names too specific. Move them into a new test token_ident that covers all "identifier-like" tokens, just as in the code.
The test cases for the option '-cs' are already covered more systematically in opt_cs.c, so remove that test.
|
#
1.16 |
|
16-Oct-2021 |
rillig |
tests/indent: condense tests for bool options
Previously, each bool option such as '-bacc/-nbacc' had 6 test files: input, options, output for the positive and negative option. Splitting this test data into separate files made it harder than necessary to quickly compare the test output from '-bacc' with that of '-nbacc'.
Have a single test for the positive and negative option, allowing several tests to run on the same input with different options.
This commit only contains the rather mechanic changes of concatenating the previous test files and inserting the '#indent' directives, which are documented in t_options.sh. Removing duplicate input sections, as well as other cleanups will follow soon.
No functional change.
|
#
1.15 |
|
14-Oct-2021 |
rillig |
tests/indent: provide full line coverage for argument handling
|
#
1.14 |
|
13-Oct-2021 |
rillig |
indent: check command line options stricter
Previously, bool options were allowed to have trailing garbage. For example, the option '-bacc' could be spelled '-bacchus' as well.
Check that the exact option name is given in the command line, to prevent typos in the configuration files and to reduce surprises just in case a future option is a prefix of an existing option, or vice versa.
Add a new test program for error handling. Most of these tests are so simple that it would be overkill to create 3 files for each test.
|
#
1.13 |
|
07-Oct-2021 |
rillig |
tests/indent: test parsing of command line options in profile file
|
#
1.12 |
|
05-Oct-2021 |
rillig |
tests/indent: demonstrate off-by-one error in edge case
|
#
1.11 |
|
25-Sep-2021 |
rillig |
tests/indent: test deeply nested struct declarations
|
#
1.10 |
|
25-Sep-2021 |
rillig |
tests/indent: test edge cases for the tokenizer
|
#
1.9 |
|
25-Sep-2021 |
rillig |
tests/indent: test lexing of character constants and string literals
|
Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
|
#
1.8 |
|
12-Mar-2021 |
rillig |
tests/indent: add test templates for testing specific parser symbols
The basic idea of indent is to split the input into tokens and then reassemble them, reformatting them on the way. These tokens determine how the output is formatted, therefore add tests for each of the terminal tokens and nonterminal parser symbols, to cover more common cases, and edge cases as well.
|
#
1.7 |
|
09-Mar-2021 |
rillig |
tests/indent: demonstrate strange alignment for global variables
|
#
1.6 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate wrong removed empty line before '//'
|
#
1.5 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate another bug in nested blocks
|
#
1.4 |
|
08-Mar-2021 |
rillig |
tests/indent: add test for output line counting
|
#
1.3 |
|
06-Mar-2021 |
rillig |
tests/indent: add templates for options tests
Given that indent "has even more switches than ls(1)", there are far too few tests. To make it easier to add meaningful tests for each of the options, add the templates for the tests right now, ready to be filled in.
|
#
1.2 |
|
21-Feb-2021 |
rillig |
indent: add test demonstrating that indent cannot handle C99
indent cannot handle line-end comments.
The indent test suite requires each test file to have both a NetBSD and a FreeBSD RCS ID. If the FreeBSD RCS ID is missing, the test will silently pass since in that case, an empty file is compared with an empty file. See the /start/,/end/ operator in t_indent.sh.
|
Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
|
#
1.1 |
|
04-Apr-2019 |
kamil |
branches: 1.1.2; Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot into our local copy.
FreeBSD actively maintains this program in their sources and their repository contains over 100 commits with changes.
Keep the delta between the FreeBSD and NetBSD versions to absolute minimum, mostly RCS Id and compatiblity fixes.
Major chages in this import:
- Added an option -ldi<N> to control indentation of local variable names. - Added option -P for loading user-provided files as profiles - Added -tsn for setting tabsize - Rename -nsac/-sac ("space after cast") to -ncs/-cs - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines. - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1) - Group global option variables into an options structure - Use bsearch() for looking up type keywords. - Don't produce unneeded space character in function declarators - Don't unnecessarily add a blank before a comment ends. - Don't ignore newlines after comments that follow braces.
Merge the FreeBSD intend(1) tests with our ATF framework. All tests pass.
Upgrade prepared by Manikishan Ghantasala. Final polishing by myself.
Part II, checkin new files.
|
#
1.45 |
|
24-Apr-2022 |
rillig |
tests/indent: migrate token tests to other tests
In indent.h 1.49 from 2021-10-25, the enumeration token_type was split into lexer_symbol and parser_symbol to more clearly express that these tokens fall into completely different classes of usage patterns.
|
#
1.44 |
|
24-Apr-2022 |
rillig |
tests/indent: change directive from '#' to '//'
Using a '//' instead of '#' turns the directives into well-formed C code, resulting in fewer error markers in the editor.
|
#
1.43 |
|
24-Apr-2022 |
rillig |
tests/indent: migrate tests for parentheses, brackets, braces
|
#
1.42 |
|
23-Apr-2022 |
rillig |
tests/indent: migrate tests for the tokens '{' and '.'
|
#
1.41 |
|
23-Apr-2022 |
rillig |
tests/indent: migrate a few token tests to psym tests
|
#
1.40 |
|
22-Apr-2022 |
rillig |
indent: remove FreeBSD IDs
Most of the IDs were empty anyway.
|
#
1.39 |
|
28-Nov-2021 |
rillig |
tests/indent: migrate token_question to lsym_question and extend it
|
#
1.38 |
|
28-Nov-2021 |
rillig |
tests/indent: migrate test token_case_label to lsym_case_label
|
#
1.37 |
|
28-Nov-2021 |
rillig |
tests/indent: migrate token_comma to lsym_comma
The section on initializer values is new.
|
#
1.36 |
|
28-Nov-2021 |
rillig |
tests/indent: move test for ':' to lsym_token.c
|
#
1.35 |
|
28-Nov-2021 |
rillig |
indent: treat L"string" as a single token
There is never whitespace between the 'L' and the string literal or the character constant. There might be a backslash-newline between them, but that case was not handled before either.
No functional change.
|
#
1.34 |
|
18-Nov-2021 |
rillig |
tests/indent: add skeletons for testing tokens and parser symbols
The constants that were previously defined in indent_codes.h were a wild mixture of tokens from the lexer and symbols on the parser stack. They were split into separate types starting at indent.h 1.49 from 2021-10-25 and finishing at 1.73 from 2021-10-31.
To match the tests with the new token names, the old tests need to be migrated to the newly added tests. This will take some time so first add the skeletons and migrate them in smaller steps, cleaning them up and extending them on the way.
|
#
1.33 |
|
23-Oct-2021 |
rillig |
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.
|
#
1.32 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate test for '-bap -sob' to t_options
|
#
1.31 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate test for '--version' to t_options
|
#
1.30 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate test for offsetof to t_options
|
#
1.29 |
|
23-Oct-2021 |
rillig |
tests/indent: remove redundant test list_head
The test cases are already in fmt_decl.c, in old_style_definition and LIST_HEAD.
|
#
1.28 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate f_decls to using t_options, add more tests
|
#
1.27 |
|
22-Oct-2021 |
rillig |
tests/indent: migrate integer options tests to t_options
|
#
1.26 |
|
22-Oct-2021 |
rillig |
tests/indent: migrate tests for parentheses, struct, #if, wide char
|
#
1.25 |
|
22-Oct-2021 |
rillig |
tests/indent: migrate a few more tests to t_options
|
#
1.24 |
|
19-Oct-2021 |
rillig |
tests/indent: add test for INDENT OFF/ON comments
Just to prevent unintended side effects when fixing bugs in this area.
|
#
1.23 |
|
19-Oct-2021 |
rillig |
tests/indent: make add-test generate flexible tests
They need fewer source files and are more versatile.
|
#
1.22 |
|
18-Oct-2021 |
rillig |
tests/indent: remove redundant tests for '-ncs' and '-pcs'
These tests are already covered by opt_cs.c and opt_pcs.c.
|
#
1.21 |
|
18-Oct-2021 |
rillig |
tests/indent: condense test for indentation level, add missing files
|
#
1.20 |
|
18-Oct-2021 |
rillig |
tests/indent: condense the token tests
This reduces the number of files in the test directory. It also allows the tests to be read from top to bottom, looking at only a single file.
Since t_options.awk complains about files that don't have any test case at all, add some test for each token kind. Most of the tests had previously been effectively empty.
|
#
1.19 |
|
18-Oct-2021 |
rillig |
tests/indent: extend tests for labels, extract test driver
Having the test driver in a separate file allows to run it on its own, as 'awk -f t_options.awk label.c'. When the test driver warns, exit 1; this is only needed for the standalone version, when run from inside ATF the warnings on stderr already suffice to make the test fail in the end.
|
#
1.18 |
|
18-Oct-2021 |
rillig |
tests/indent: consolidate tests for comments
These tests have been the motivation for t_options.sh, which allows to run indent with various command line options on the same input, without having to create 3 files per test case.
A test file actually contains several tests, all separated by '#indent' directives. Isolating each of these tests is simpler than having to pick up the corresponding sections from 3 separate files. Running indent on each small test case isolates the test cases from each other, preventing them to influence later test cases. Exactly this had happened when support for C99 comments was added in March 2021, which later turned out to be done wrong.
|
#
1.17 |
|
18-Oct-2021 |
rillig |
tests/indent: merge tests for numbers into token_ident
The previous tests 'binary' and 'float' not only test binary and floating point numbers, making their names too specific. Move them into a new test token_ident that covers all "identifier-like" tokens, just as in the code.
The test cases for the option '-cs' are already covered more systematically in opt_cs.c, so remove that test.
|
#
1.16 |
|
16-Oct-2021 |
rillig |
tests/indent: condense tests for bool options
Previously, each bool option such as '-bacc/-nbacc' had 6 test files: input, options, output for the positive and negative option. Splitting this test data into separate files made it harder than necessary to quickly compare the test output from '-bacc' with that of '-nbacc'.
Have a single test for the positive and negative option, allowing several tests to run on the same input with different options.
This commit only contains the rather mechanic changes of concatenating the previous test files and inserting the '#indent' directives, which are documented in t_options.sh. Removing duplicate input sections, as well as other cleanups will follow soon.
No functional change.
|
#
1.15 |
|
14-Oct-2021 |
rillig |
tests/indent: provide full line coverage for argument handling
|
#
1.14 |
|
13-Oct-2021 |
rillig |
indent: check command line options stricter
Previously, bool options were allowed to have trailing garbage. For example, the option '-bacc' could be spelled '-bacchus' as well.
Check that the exact option name is given in the command line, to prevent typos in the configuration files and to reduce surprises just in case a future option is a prefix of an existing option, or vice versa.
Add a new test program for error handling. Most of these tests are so simple that it would be overkill to create 3 files for each test.
|
#
1.13 |
|
07-Oct-2021 |
rillig |
tests/indent: test parsing of command line options in profile file
|
#
1.12 |
|
05-Oct-2021 |
rillig |
tests/indent: demonstrate off-by-one error in edge case
|
#
1.11 |
|
25-Sep-2021 |
rillig |
tests/indent: test deeply nested struct declarations
|
#
1.10 |
|
25-Sep-2021 |
rillig |
tests/indent: test edge cases for the tokenizer
|
#
1.9 |
|
25-Sep-2021 |
rillig |
tests/indent: test lexing of character constants and string literals
|
Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
|
#
1.8 |
|
12-Mar-2021 |
rillig |
tests/indent: add test templates for testing specific parser symbols
The basic idea of indent is to split the input into tokens and then reassemble them, reformatting them on the way. These tokens determine how the output is formatted, therefore add tests for each of the terminal tokens and nonterminal parser symbols, to cover more common cases, and edge cases as well.
|
#
1.7 |
|
09-Mar-2021 |
rillig |
tests/indent: demonstrate strange alignment for global variables
|
#
1.6 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate wrong removed empty line before '//'
|
#
1.5 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate another bug in nested blocks
|
#
1.4 |
|
08-Mar-2021 |
rillig |
tests/indent: add test for output line counting
|
#
1.3 |
|
06-Mar-2021 |
rillig |
tests/indent: add templates for options tests
Given that indent "has even more switches than ls(1)", there are far too few tests. To make it easier to add meaningful tests for each of the options, add the templates for the tests right now, ready to be filled in.
|
#
1.2 |
|
21-Feb-2021 |
rillig |
indent: add test demonstrating that indent cannot handle C99
indent cannot handle line-end comments.
The indent test suite requires each test file to have both a NetBSD and a FreeBSD RCS ID. If the FreeBSD RCS ID is missing, the test will silently pass since in that case, an empty file is compared with an empty file. See the /start/,/end/ operator in t_indent.sh.
|
Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
|
#
1.1 |
|
04-Apr-2019 |
kamil |
branches: 1.1.2; Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot into our local copy.
FreeBSD actively maintains this program in their sources and their repository contains over 100 commits with changes.
Keep the delta between the FreeBSD and NetBSD versions to absolute minimum, mostly RCS Id and compatiblity fixes.
Major chages in this import:
- Added an option -ldi<N> to control indentation of local variable names. - Added option -P for loading user-provided files as profiles - Added -tsn for setting tabsize - Rename -nsac/-sac ("space after cast") to -ncs/-cs - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines. - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1) - Group global option variables into an options structure - Use bsearch() for looking up type keywords. - Don't produce unneeded space character in function declarators - Don't unnecessarily add a blank before a comment ends. - Don't ignore newlines after comments that follow braces.
Merge the FreeBSD intend(1) tests with our ATF framework. All tests pass.
Upgrade prepared by Manikishan Ghantasala. Final polishing by myself.
Part II, checkin new files.
|
#
1.42 |
|
23-Apr-2022 |
rillig |
tests/indent: migrate tests for the tokens '{' and '.'
|
#
1.41 |
|
23-Apr-2022 |
rillig |
tests/indent: migrate a few token tests to psym tests
|
#
1.40 |
|
22-Apr-2022 |
rillig |
indent: remove FreeBSD IDs
Most of the IDs were empty anyway.
|
#
1.39 |
|
28-Nov-2021 |
rillig |
tests/indent: migrate token_question to lsym_question and extend it
|
#
1.38 |
|
28-Nov-2021 |
rillig |
tests/indent: migrate test token_case_label to lsym_case_label
|
#
1.37 |
|
28-Nov-2021 |
rillig |
tests/indent: migrate token_comma to lsym_comma
The section on initializer values is new.
|
#
1.36 |
|
28-Nov-2021 |
rillig |
tests/indent: move test for ':' to lsym_token.c
|
#
1.35 |
|
28-Nov-2021 |
rillig |
indent: treat L"string" as a single token
There is never whitespace between the 'L' and the string literal or the character constant. There might be a backslash-newline between them, but that case was not handled before either.
No functional change.
|
#
1.34 |
|
18-Nov-2021 |
rillig |
tests/indent: add skeletons for testing tokens and parser symbols
The constants that were previously defined in indent_codes.h were a wild mixture of tokens from the lexer and symbols on the parser stack. They were split into separate types starting at indent.h 1.49 from 2021-10-25 and finishing at 1.73 from 2021-10-31.
To match the tests with the new token names, the old tests need to be migrated to the newly added tests. This will take some time so first add the skeletons and migrate them in smaller steps, cleaning them up and extending them on the way.
|
#
1.33 |
|
23-Oct-2021 |
rillig |
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.
|
#
1.32 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate test for '-bap -sob' to t_options
|
#
1.31 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate test for '--version' to t_options
|
#
1.30 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate test for offsetof to t_options
|
#
1.29 |
|
23-Oct-2021 |
rillig |
tests/indent: remove redundant test list_head
The test cases are already in fmt_decl.c, in old_style_definition and LIST_HEAD.
|
#
1.28 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate f_decls to using t_options, add more tests
|
#
1.27 |
|
22-Oct-2021 |
rillig |
tests/indent: migrate integer options tests to t_options
|
#
1.26 |
|
22-Oct-2021 |
rillig |
tests/indent: migrate tests for parentheses, struct, #if, wide char
|
#
1.25 |
|
22-Oct-2021 |
rillig |
tests/indent: migrate a few more tests to t_options
|
#
1.24 |
|
19-Oct-2021 |
rillig |
tests/indent: add test for INDENT OFF/ON comments
Just to prevent unintended side effects when fixing bugs in this area.
|
#
1.23 |
|
19-Oct-2021 |
rillig |
tests/indent: make add-test generate flexible tests
They need fewer source files and are more versatile.
|
#
1.22 |
|
18-Oct-2021 |
rillig |
tests/indent: remove redundant tests for '-ncs' and '-pcs'
These tests are already covered by opt_cs.c and opt_pcs.c.
|
#
1.21 |
|
18-Oct-2021 |
rillig |
tests/indent: condense test for indentation level, add missing files
|
#
1.20 |
|
18-Oct-2021 |
rillig |
tests/indent: condense the token tests
This reduces the number of files in the test directory. It also allows the tests to be read from top to bottom, looking at only a single file.
Since t_options.awk complains about files that don't have any test case at all, add some test for each token kind. Most of the tests had previously been effectively empty.
|
#
1.19 |
|
18-Oct-2021 |
rillig |
tests/indent: extend tests for labels, extract test driver
Having the test driver in a separate file allows to run it on its own, as 'awk -f t_options.awk label.c'. When the test driver warns, exit 1; this is only needed for the standalone version, when run from inside ATF the warnings on stderr already suffice to make the test fail in the end.
|
#
1.18 |
|
18-Oct-2021 |
rillig |
tests/indent: consolidate tests for comments
These tests have been the motivation for t_options.sh, which allows to run indent with various command line options on the same input, without having to create 3 files per test case.
A test file actually contains several tests, all separated by '#indent' directives. Isolating each of these tests is simpler than having to pick up the corresponding sections from 3 separate files. Running indent on each small test case isolates the test cases from each other, preventing them to influence later test cases. Exactly this had happened when support for C99 comments was added in March 2021, which later turned out to be done wrong.
|
#
1.17 |
|
18-Oct-2021 |
rillig |
tests/indent: merge tests for numbers into token_ident
The previous tests 'binary' and 'float' not only test binary and floating point numbers, making their names too specific. Move them into a new test token_ident that covers all "identifier-like" tokens, just as in the code.
The test cases for the option '-cs' are already covered more systematically in opt_cs.c, so remove that test.
|
#
1.16 |
|
16-Oct-2021 |
rillig |
tests/indent: condense tests for bool options
Previously, each bool option such as '-bacc/-nbacc' had 6 test files: input, options, output for the positive and negative option. Splitting this test data into separate files made it harder than necessary to quickly compare the test output from '-bacc' with that of '-nbacc'.
Have a single test for the positive and negative option, allowing several tests to run on the same input with different options.
This commit only contains the rather mechanic changes of concatenating the previous test files and inserting the '#indent' directives, which are documented in t_options.sh. Removing duplicate input sections, as well as other cleanups will follow soon.
No functional change.
|
#
1.15 |
|
14-Oct-2021 |
rillig |
tests/indent: provide full line coverage for argument handling
|
#
1.14 |
|
13-Oct-2021 |
rillig |
indent: check command line options stricter
Previously, bool options were allowed to have trailing garbage. For example, the option '-bacc' could be spelled '-bacchus' as well.
Check that the exact option name is given in the command line, to prevent typos in the configuration files and to reduce surprises just in case a future option is a prefix of an existing option, or vice versa.
Add a new test program for error handling. Most of these tests are so simple that it would be overkill to create 3 files for each test.
|
#
1.13 |
|
07-Oct-2021 |
rillig |
tests/indent: test parsing of command line options in profile file
|
#
1.12 |
|
05-Oct-2021 |
rillig |
tests/indent: demonstrate off-by-one error in edge case
|
#
1.11 |
|
25-Sep-2021 |
rillig |
tests/indent: test deeply nested struct declarations
|
#
1.10 |
|
25-Sep-2021 |
rillig |
tests/indent: test edge cases for the tokenizer
|
#
1.9 |
|
25-Sep-2021 |
rillig |
tests/indent: test lexing of character constants and string literals
|
Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
|
#
1.8 |
|
12-Mar-2021 |
rillig |
tests/indent: add test templates for testing specific parser symbols
The basic idea of indent is to split the input into tokens and then reassemble them, reformatting them on the way. These tokens determine how the output is formatted, therefore add tests for each of the terminal tokens and nonterminal parser symbols, to cover more common cases, and edge cases as well.
|
#
1.7 |
|
09-Mar-2021 |
rillig |
tests/indent: demonstrate strange alignment for global variables
|
#
1.6 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate wrong removed empty line before '//'
|
#
1.5 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate another bug in nested blocks
|
#
1.4 |
|
08-Mar-2021 |
rillig |
tests/indent: add test for output line counting
|
#
1.3 |
|
06-Mar-2021 |
rillig |
tests/indent: add templates for options tests
Given that indent "has even more switches than ls(1)", there are far too few tests. To make it easier to add meaningful tests for each of the options, add the templates for the tests right now, ready to be filled in.
|
#
1.2 |
|
21-Feb-2021 |
rillig |
indent: add test demonstrating that indent cannot handle C99
indent cannot handle line-end comments.
The indent test suite requires each test file to have both a NetBSD and a FreeBSD RCS ID. If the FreeBSD RCS ID is missing, the test will silently pass since in that case, an empty file is compared with an empty file. See the /start/,/end/ operator in t_indent.sh.
|
Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
|
#
1.1 |
|
04-Apr-2019 |
kamil |
branches: 1.1.2; Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot into our local copy.
FreeBSD actively maintains this program in their sources and their repository contains over 100 commits with changes.
Keep the delta between the FreeBSD and NetBSD versions to absolute minimum, mostly RCS Id and compatiblity fixes.
Major chages in this import:
- Added an option -ldi<N> to control indentation of local variable names. - Added option -P for loading user-provided files as profiles - Added -tsn for setting tabsize - Rename -nsac/-sac ("space after cast") to -ncs/-cs - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines. - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1) - Group global option variables into an options structure - Use bsearch() for looking up type keywords. - Don't produce unneeded space character in function declarators - Don't unnecessarily add a blank before a comment ends. - Don't ignore newlines after comments that follow braces.
Merge the FreeBSD intend(1) tests with our ATF framework. All tests pass.
Upgrade prepared by Manikishan Ghantasala. Final polishing by myself.
Part II, checkin new files.
|
#
1.39 |
|
28-Nov-2021 |
rillig |
tests/indent: migrate token_question to lsym_question and extend it
|
#
1.38 |
|
28-Nov-2021 |
rillig |
tests/indent: migrate test token_case_label to lsym_case_label
|
#
1.37 |
|
28-Nov-2021 |
rillig |
tests/indent: migrate token_comma to lsym_comma
The section on initializer values is new.
|
#
1.36 |
|
28-Nov-2021 |
rillig |
tests/indent: move test for ':' to lsym_token.c
|
#
1.35 |
|
28-Nov-2021 |
rillig |
indent: treat L"string" as a single token
There is never whitespace between the 'L' and the string literal or the character constant. There might be a backslash-newline between them, but that case was not handled before either.
No functional change.
|
#
1.34 |
|
18-Nov-2021 |
rillig |
tests/indent: add skeletons for testing tokens and parser symbols
The constants that were previously defined in indent_codes.h were a wild mixture of tokens from the lexer and symbols on the parser stack. They were split into separate types starting at indent.h 1.49 from 2021-10-25 and finishing at 1.73 from 2021-10-31.
To match the tests with the new token names, the old tests need to be migrated to the newly added tests. This will take some time so first add the skeletons and migrate them in smaller steps, cleaning them up and extending them on the way.
|
#
1.33 |
|
23-Oct-2021 |
rillig |
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.
|
#
1.32 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate test for '-bap -sob' to t_options
|
#
1.31 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate test for '--version' to t_options
|
#
1.30 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate test for offsetof to t_options
|
#
1.29 |
|
23-Oct-2021 |
rillig |
tests/indent: remove redundant test list_head
The test cases are already in fmt_decl.c, in old_style_definition and LIST_HEAD.
|
#
1.28 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate f_decls to using t_options, add more tests
|
#
1.27 |
|
22-Oct-2021 |
rillig |
tests/indent: migrate integer options tests to t_options
|
#
1.26 |
|
22-Oct-2021 |
rillig |
tests/indent: migrate tests for parentheses, struct, #if, wide char
|
#
1.25 |
|
22-Oct-2021 |
rillig |
tests/indent: migrate a few more tests to t_options
|
#
1.24 |
|
19-Oct-2021 |
rillig |
tests/indent: add test for INDENT OFF/ON comments
Just to prevent unintended side effects when fixing bugs in this area.
|
#
1.23 |
|
19-Oct-2021 |
rillig |
tests/indent: make add-test generate flexible tests
They need fewer source files and are more versatile.
|
#
1.22 |
|
18-Oct-2021 |
rillig |
tests/indent: remove redundant tests for '-ncs' and '-pcs'
These tests are already covered by opt_cs.c and opt_pcs.c.
|
#
1.21 |
|
18-Oct-2021 |
rillig |
tests/indent: condense test for indentation level, add missing files
|
#
1.20 |
|
18-Oct-2021 |
rillig |
tests/indent: condense the token tests
This reduces the number of files in the test directory. It also allows the tests to be read from top to bottom, looking at only a single file.
Since t_options.awk complains about files that don't have any test case at all, add some test for each token kind. Most of the tests had previously been effectively empty.
|
#
1.19 |
|
18-Oct-2021 |
rillig |
tests/indent: extend tests for labels, extract test driver
Having the test driver in a separate file allows to run it on its own, as 'awk -f t_options.awk label.c'. When the test driver warns, exit 1; this is only needed for the standalone version, when run from inside ATF the warnings on stderr already suffice to make the test fail in the end.
|
#
1.18 |
|
18-Oct-2021 |
rillig |
tests/indent: consolidate tests for comments
These tests have been the motivation for t_options.sh, which allows to run indent with various command line options on the same input, without having to create 3 files per test case.
A test file actually contains several tests, all separated by '#indent' directives. Isolating each of these tests is simpler than having to pick up the corresponding sections from 3 separate files. Running indent on each small test case isolates the test cases from each other, preventing them to influence later test cases. Exactly this had happened when support for C99 comments was added in March 2021, which later turned out to be done wrong.
|
#
1.17 |
|
18-Oct-2021 |
rillig |
tests/indent: merge tests for numbers into token_ident
The previous tests 'binary' and 'float' not only test binary and floating point numbers, making their names too specific. Move them into a new test token_ident that covers all "identifier-like" tokens, just as in the code.
The test cases for the option '-cs' are already covered more systematically in opt_cs.c, so remove that test.
|
#
1.16 |
|
16-Oct-2021 |
rillig |
tests/indent: condense tests for bool options
Previously, each bool option such as '-bacc/-nbacc' had 6 test files: input, options, output for the positive and negative option. Splitting this test data into separate files made it harder than necessary to quickly compare the test output from '-bacc' with that of '-nbacc'.
Have a single test for the positive and negative option, allowing several tests to run on the same input with different options.
This commit only contains the rather mechanic changes of concatenating the previous test files and inserting the '#indent' directives, which are documented in t_options.sh. Removing duplicate input sections, as well as other cleanups will follow soon.
No functional change.
|
#
1.15 |
|
14-Oct-2021 |
rillig |
tests/indent: provide full line coverage for argument handling
|
#
1.14 |
|
13-Oct-2021 |
rillig |
indent: check command line options stricter
Previously, bool options were allowed to have trailing garbage. For example, the option '-bacc' could be spelled '-bacchus' as well.
Check that the exact option name is given in the command line, to prevent typos in the configuration files and to reduce surprises just in case a future option is a prefix of an existing option, or vice versa.
Add a new test program for error handling. Most of these tests are so simple that it would be overkill to create 3 files for each test.
|
#
1.13 |
|
07-Oct-2021 |
rillig |
tests/indent: test parsing of command line options in profile file
|
#
1.12 |
|
05-Oct-2021 |
rillig |
tests/indent: demonstrate off-by-one error in edge case
|
#
1.11 |
|
25-Sep-2021 |
rillig |
tests/indent: test deeply nested struct declarations
|
#
1.10 |
|
25-Sep-2021 |
rillig |
tests/indent: test edge cases for the tokenizer
|
#
1.9 |
|
25-Sep-2021 |
rillig |
tests/indent: test lexing of character constants and string literals
|
Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
|
#
1.8 |
|
12-Mar-2021 |
rillig |
tests/indent: add test templates for testing specific parser symbols
The basic idea of indent is to split the input into tokens and then reassemble them, reformatting them on the way. These tokens determine how the output is formatted, therefore add tests for each of the terminal tokens and nonterminal parser symbols, to cover more common cases, and edge cases as well.
|
#
1.7 |
|
09-Mar-2021 |
rillig |
tests/indent: demonstrate strange alignment for global variables
|
#
1.6 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate wrong removed empty line before '//'
|
#
1.5 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate another bug in nested blocks
|
#
1.4 |
|
08-Mar-2021 |
rillig |
tests/indent: add test for output line counting
|
#
1.3 |
|
06-Mar-2021 |
rillig |
tests/indent: add templates for options tests
Given that indent "has even more switches than ls(1)", there are far too few tests. To make it easier to add meaningful tests for each of the options, add the templates for the tests right now, ready to be filled in.
|
#
1.2 |
|
21-Feb-2021 |
rillig |
indent: add test demonstrating that indent cannot handle C99
indent cannot handle line-end comments.
The indent test suite requires each test file to have both a NetBSD and a FreeBSD RCS ID. If the FreeBSD RCS ID is missing, the test will silently pass since in that case, an empty file is compared with an empty file. See the /start/,/end/ operator in t_indent.sh.
|
Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
|
#
1.1 |
|
04-Apr-2019 |
kamil |
branches: 1.1.2; Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot into our local copy.
FreeBSD actively maintains this program in their sources and their repository contains over 100 commits with changes.
Keep the delta between the FreeBSD and NetBSD versions to absolute minimum, mostly RCS Id and compatiblity fixes.
Major chages in this import:
- Added an option -ldi<N> to control indentation of local variable names. - Added option -P for loading user-provided files as profiles - Added -tsn for setting tabsize - Rename -nsac/-sac ("space after cast") to -ncs/-cs - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines. - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1) - Group global option variables into an options structure - Use bsearch() for looking up type keywords. - Don't produce unneeded space character in function declarators - Don't unnecessarily add a blank before a comment ends. - Don't ignore newlines after comments that follow braces.
Merge the FreeBSD intend(1) tests with our ATF framework. All tests pass.
Upgrade prepared by Manikishan Ghantasala. Final polishing by myself.
Part II, checkin new files.
|
#
1.34 |
|
18-Nov-2021 |
rillig |
tests/indent: add skeletons for testing tokens and parser symbols
The constants that were previously defined in indent_codes.h were a wild mixture of tokens from the lexer and symbols on the parser stack. They were split into separate types starting at indent.h 1.49 from 2021-10-25 and finishing at 1.73 from 2021-10-31.
To match the tests with the new token names, the old tests need to be migrated to the newly added tests. This will take some time so first add the skeletons and migrate them in smaller steps, cleaning them up and extending them on the way.
|
#
1.33 |
|
23-Oct-2021 |
rillig |
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.
|
#
1.32 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate test for '-bap -sob' to t_options
|
#
1.31 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate test for '--version' to t_options
|
#
1.30 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate test for offsetof to t_options
|
#
1.29 |
|
23-Oct-2021 |
rillig |
tests/indent: remove redundant test list_head
The test cases are already in fmt_decl.c, in old_style_definition and LIST_HEAD.
|
#
1.28 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate f_decls to using t_options, add more tests
|
#
1.27 |
|
22-Oct-2021 |
rillig |
tests/indent: migrate integer options tests to t_options
|
#
1.26 |
|
22-Oct-2021 |
rillig |
tests/indent: migrate tests for parentheses, struct, #if, wide char
|
#
1.25 |
|
22-Oct-2021 |
rillig |
tests/indent: migrate a few more tests to t_options
|
#
1.24 |
|
19-Oct-2021 |
rillig |
tests/indent: add test for INDENT OFF/ON comments
Just to prevent unintended side effects when fixing bugs in this area.
|
#
1.23 |
|
19-Oct-2021 |
rillig |
tests/indent: make add-test generate flexible tests
They need fewer source files and are more versatile.
|
#
1.22 |
|
18-Oct-2021 |
rillig |
tests/indent: remove redundant tests for '-ncs' and '-pcs'
These tests are already covered by opt_cs.c and opt_pcs.c.
|
#
1.21 |
|
18-Oct-2021 |
rillig |
tests/indent: condense test for indentation level, add missing files
|
#
1.20 |
|
18-Oct-2021 |
rillig |
tests/indent: condense the token tests
This reduces the number of files in the test directory. It also allows the tests to be read from top to bottom, looking at only a single file.
Since t_options.awk complains about files that don't have any test case at all, add some test for each token kind. Most of the tests had previously been effectively empty.
|
#
1.19 |
|
18-Oct-2021 |
rillig |
tests/indent: extend tests for labels, extract test driver
Having the test driver in a separate file allows to run it on its own, as 'awk -f t_options.awk label.c'. When the test driver warns, exit 1; this is only needed for the standalone version, when run from inside ATF the warnings on stderr already suffice to make the test fail in the end.
|
#
1.18 |
|
18-Oct-2021 |
rillig |
tests/indent: consolidate tests for comments
These tests have been the motivation for t_options.sh, which allows to run indent with various command line options on the same input, without having to create 3 files per test case.
A test file actually contains several tests, all separated by '#indent' directives. Isolating each of these tests is simpler than having to pick up the corresponding sections from 3 separate files. Running indent on each small test case isolates the test cases from each other, preventing them to influence later test cases. Exactly this had happened when support for C99 comments was added in March 2021, which later turned out to be done wrong.
|
#
1.17 |
|
18-Oct-2021 |
rillig |
tests/indent: merge tests for numbers into token_ident
The previous tests 'binary' and 'float' not only test binary and floating point numbers, making their names too specific. Move them into a new test token_ident that covers all "identifier-like" tokens, just as in the code.
The test cases for the option '-cs' are already covered more systematically in opt_cs.c, so remove that test.
|
#
1.16 |
|
16-Oct-2021 |
rillig |
tests/indent: condense tests for bool options
Previously, each bool option such as '-bacc/-nbacc' had 6 test files: input, options, output for the positive and negative option. Splitting this test data into separate files made it harder than necessary to quickly compare the test output from '-bacc' with that of '-nbacc'.
Have a single test for the positive and negative option, allowing several tests to run on the same input with different options.
This commit only contains the rather mechanic changes of concatenating the previous test files and inserting the '#indent' directives, which are documented in t_options.sh. Removing duplicate input sections, as well as other cleanups will follow soon.
No functional change.
|
#
1.15 |
|
14-Oct-2021 |
rillig |
tests/indent: provide full line coverage for argument handling
|
#
1.14 |
|
13-Oct-2021 |
rillig |
indent: check command line options stricter
Previously, bool options were allowed to have trailing garbage. For example, the option '-bacc' could be spelled '-bacchus' as well.
Check that the exact option name is given in the command line, to prevent typos in the configuration files and to reduce surprises just in case a future option is a prefix of an existing option, or vice versa.
Add a new test program for error handling. Most of these tests are so simple that it would be overkill to create 3 files for each test.
|
#
1.13 |
|
07-Oct-2021 |
rillig |
tests/indent: test parsing of command line options in profile file
|
#
1.12 |
|
05-Oct-2021 |
rillig |
tests/indent: demonstrate off-by-one error in edge case
|
#
1.11 |
|
25-Sep-2021 |
rillig |
tests/indent: test deeply nested struct declarations
|
#
1.10 |
|
25-Sep-2021 |
rillig |
tests/indent: test edge cases for the tokenizer
|
#
1.9 |
|
25-Sep-2021 |
rillig |
tests/indent: test lexing of character constants and string literals
|
Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
|
#
1.8 |
|
12-Mar-2021 |
rillig |
tests/indent: add test templates for testing specific parser symbols
The basic idea of indent is to split the input into tokens and then reassemble them, reformatting them on the way. These tokens determine how the output is formatted, therefore add tests for each of the terminal tokens and nonterminal parser symbols, to cover more common cases, and edge cases as well.
|
#
1.7 |
|
09-Mar-2021 |
rillig |
tests/indent: demonstrate strange alignment for global variables
|
#
1.6 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate wrong removed empty line before '//'
|
#
1.5 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate another bug in nested blocks
|
#
1.4 |
|
08-Mar-2021 |
rillig |
tests/indent: add test for output line counting
|
#
1.3 |
|
06-Mar-2021 |
rillig |
tests/indent: add templates for options tests
Given that indent "has even more switches than ls(1)", there are far too few tests. To make it easier to add meaningful tests for each of the options, add the templates for the tests right now, ready to be filled in.
|
#
1.2 |
|
21-Feb-2021 |
rillig |
indent: add test demonstrating that indent cannot handle C99
indent cannot handle line-end comments.
The indent test suite requires each test file to have both a NetBSD and a FreeBSD RCS ID. If the FreeBSD RCS ID is missing, the test will silently pass since in that case, an empty file is compared with an empty file. See the /start/,/end/ operator in t_indent.sh.
|
Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
|
#
1.1 |
|
04-Apr-2019 |
kamil |
branches: 1.1.2; Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot into our local copy.
FreeBSD actively maintains this program in their sources and their repository contains over 100 commits with changes.
Keep the delta between the FreeBSD and NetBSD versions to absolute minimum, mostly RCS Id and compatiblity fixes.
Major chages in this import:
- Added an option -ldi<N> to control indentation of local variable names. - Added option -P for loading user-provided files as profiles - Added -tsn for setting tabsize - Rename -nsac/-sac ("space after cast") to -ncs/-cs - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines. - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1) - Group global option variables into an options structure - Use bsearch() for looking up type keywords. - Don't produce unneeded space character in function declarators - Don't unnecessarily add a blank before a comment ends. - Don't ignore newlines after comments that follow braces.
Merge the FreeBSD intend(1) tests with our ATF framework. All tests pass.
Upgrade prepared by Manikishan Ghantasala. Final polishing by myself.
Part II, checkin new files.
|
#
1.33 |
|
23-Oct-2021 |
rillig |
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.
|
#
1.32 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate test for '-bap -sob' to t_options
|
#
1.31 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate test for '--version' to t_options
|
#
1.30 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate test for offsetof to t_options
|
#
1.29 |
|
23-Oct-2021 |
rillig |
tests/indent: remove redundant test list_head
The test cases are already in fmt_decl.c, in old_style_definition and LIST_HEAD.
|
#
1.28 |
|
23-Oct-2021 |
rillig |
tests/indent: migrate f_decls to using t_options, add more tests
|
#
1.27 |
|
22-Oct-2021 |
rillig |
tests/indent: migrate integer options tests to t_options
|
#
1.26 |
|
22-Oct-2021 |
rillig |
tests/indent: migrate tests for parentheses, struct, #if, wide char
|
#
1.25 |
|
22-Oct-2021 |
rillig |
tests/indent: migrate a few more tests to t_options
|
#
1.24 |
|
19-Oct-2021 |
rillig |
tests/indent: add test for INDENT OFF/ON comments
Just to prevent unintended side effects when fixing bugs in this area.
|
#
1.23 |
|
19-Oct-2021 |
rillig |
tests/indent: make add-test generate flexible tests
They need fewer source files and are more versatile.
|
#
1.22 |
|
18-Oct-2021 |
rillig |
tests/indent: remove redundant tests for '-ncs' and '-pcs'
These tests are already covered by opt_cs.c and opt_pcs.c.
|
#
1.21 |
|
18-Oct-2021 |
rillig |
tests/indent: condense test for indentation level, add missing files
|
#
1.20 |
|
18-Oct-2021 |
rillig |
tests/indent: condense the token tests
This reduces the number of files in the test directory. It also allows the tests to be read from top to bottom, looking at only a single file.
Since t_options.awk complains about files that don't have any test case at all, add some test for each token kind. Most of the tests had previously been effectively empty.
|
#
1.19 |
|
18-Oct-2021 |
rillig |
tests/indent: extend tests for labels, extract test driver
Having the test driver in a separate file allows to run it on its own, as 'awk -f t_options.awk label.c'. When the test driver warns, exit 1; this is only needed for the standalone version, when run from inside ATF the warnings on stderr already suffice to make the test fail in the end.
|
#
1.18 |
|
18-Oct-2021 |
rillig |
tests/indent: consolidate tests for comments
These tests have been the motivation for t_options.sh, which allows to run indent with various command line options on the same input, without having to create 3 files per test case.
A test file actually contains several tests, all separated by '#indent' directives. Isolating each of these tests is simpler than having to pick up the corresponding sections from 3 separate files. Running indent on each small test case isolates the test cases from each other, preventing them to influence later test cases. Exactly this had happened when support for C99 comments was added in March 2021, which later turned out to be done wrong.
|
#
1.17 |
|
18-Oct-2021 |
rillig |
tests/indent: merge tests for numbers into token_ident
The previous tests 'binary' and 'float' not only test binary and floating point numbers, making their names too specific. Move them into a new test token_ident that covers all "identifier-like" tokens, just as in the code.
The test cases for the option '-cs' are already covered more systematically in opt_cs.c, so remove that test.
|
#
1.16 |
|
16-Oct-2021 |
rillig |
tests/indent: condense tests for bool options
Previously, each bool option such as '-bacc/-nbacc' had 6 test files: input, options, output for the positive and negative option. Splitting this test data into separate files made it harder than necessary to quickly compare the test output from '-bacc' with that of '-nbacc'.
Have a single test for the positive and negative option, allowing several tests to run on the same input with different options.
This commit only contains the rather mechanic changes of concatenating the previous test files and inserting the '#indent' directives, which are documented in t_options.sh. Removing duplicate input sections, as well as other cleanups will follow soon.
No functional change.
|
#
1.15 |
|
14-Oct-2021 |
rillig |
tests/indent: provide full line coverage for argument handling
|
#
1.14 |
|
13-Oct-2021 |
rillig |
indent: check command line options stricter
Previously, bool options were allowed to have trailing garbage. For example, the option '-bacc' could be spelled '-bacchus' as well.
Check that the exact option name is given in the command line, to prevent typos in the configuration files and to reduce surprises just in case a future option is a prefix of an existing option, or vice versa.
Add a new test program for error handling. Most of these tests are so simple that it would be overkill to create 3 files for each test.
|
#
1.13 |
|
07-Oct-2021 |
rillig |
tests/indent: test parsing of command line options in profile file
|
#
1.12 |
|
05-Oct-2021 |
rillig |
tests/indent: demonstrate off-by-one error in edge case
|
#
1.11 |
|
25-Sep-2021 |
rillig |
tests/indent: test deeply nested struct declarations
|
#
1.10 |
|
25-Sep-2021 |
rillig |
tests/indent: test edge cases for the tokenizer
|
#
1.9 |
|
25-Sep-2021 |
rillig |
tests/indent: test lexing of character constants and string literals
|
Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
|
#
1.8 |
|
12-Mar-2021 |
rillig |
tests/indent: add test templates for testing specific parser symbols
The basic idea of indent is to split the input into tokens and then reassemble them, reformatting them on the way. These tokens determine how the output is formatted, therefore add tests for each of the terminal tokens and nonterminal parser symbols, to cover more common cases, and edge cases as well.
|
#
1.7 |
|
09-Mar-2021 |
rillig |
tests/indent: demonstrate strange alignment for global variables
|
#
1.6 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate wrong removed empty line before '//'
|
#
1.5 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate another bug in nested blocks
|
#
1.4 |
|
08-Mar-2021 |
rillig |
tests/indent: add test for output line counting
|
#
1.3 |
|
06-Mar-2021 |
rillig |
tests/indent: add templates for options tests
Given that indent "has even more switches than ls(1)", there are far too few tests. To make it easier to add meaningful tests for each of the options, add the templates for the tests right now, ready to be filled in.
|
#
1.2 |
|
21-Feb-2021 |
rillig |
indent: add test demonstrating that indent cannot handle C99
indent cannot handle line-end comments.
The indent test suite requires each test file to have both a NetBSD and a FreeBSD RCS ID. If the FreeBSD RCS ID is missing, the test will silently pass since in that case, an empty file is compared with an empty file. See the /start/,/end/ operator in t_indent.sh.
|
Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
|
#
1.1 |
|
04-Apr-2019 |
kamil |
branches: 1.1.2; Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot into our local copy.
FreeBSD actively maintains this program in their sources and their repository contains over 100 commits with changes.
Keep the delta between the FreeBSD and NetBSD versions to absolute minimum, mostly RCS Id and compatiblity fixes.
Major chages in this import:
- Added an option -ldi<N> to control indentation of local variable names. - Added option -P for loading user-provided files as profiles - Added -tsn for setting tabsize - Rename -nsac/-sac ("space after cast") to -ncs/-cs - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines. - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1) - Group global option variables into an options structure - Use bsearch() for looking up type keywords. - Don't produce unneeded space character in function declarators - Don't unnecessarily add a blank before a comment ends. - Don't ignore newlines after comments that follow braces.
Merge the FreeBSD intend(1) tests with our ATF framework. All tests pass.
Upgrade prepared by Manikishan Ghantasala. Final polishing by myself.
Part II, checkin new files.
|
#
1.27 |
|
22-Oct-2021 |
rillig |
tests/indent: migrate integer options tests to t_options
|
#
1.26 |
|
22-Oct-2021 |
rillig |
tests/indent: migrate tests for parentheses, struct, #if, wide char
|
#
1.25 |
|
22-Oct-2021 |
rillig |
tests/indent: migrate a few more tests to t_options
|
#
1.24 |
|
19-Oct-2021 |
rillig |
tests/indent: add test for INDENT OFF/ON comments
Just to prevent unintended side effects when fixing bugs in this area.
|
#
1.23 |
|
19-Oct-2021 |
rillig |
tests/indent: make add-test generate flexible tests
They need fewer source files and are more versatile.
|
#
1.22 |
|
18-Oct-2021 |
rillig |
tests/indent: remove redundant tests for '-ncs' and '-pcs'
These tests are already covered by opt_cs.c and opt_pcs.c.
|
#
1.21 |
|
18-Oct-2021 |
rillig |
tests/indent: condense test for indentation level, add missing files
|
#
1.20 |
|
18-Oct-2021 |
rillig |
tests/indent: condense the token tests
This reduces the number of files in the test directory. It also allows the tests to be read from top to bottom, looking at only a single file.
Since t_options.awk complains about files that don't have any test case at all, add some test for each token kind. Most of the tests had previously been effectively empty.
|
#
1.19 |
|
18-Oct-2021 |
rillig |
tests/indent: extend tests for labels, extract test driver
Having the test driver in a separate file allows to run it on its own, as 'awk -f t_options.awk label.c'. When the test driver warns, exit 1; this is only needed for the standalone version, when run from inside ATF the warnings on stderr already suffice to make the test fail in the end.
|
#
1.18 |
|
18-Oct-2021 |
rillig |
tests/indent: consolidate tests for comments
These tests have been the motivation for t_options.sh, which allows to run indent with various command line options on the same input, without having to create 3 files per test case.
A test file actually contains several tests, all separated by '#indent' directives. Isolating each of these tests is simpler than having to pick up the corresponding sections from 3 separate files. Running indent on each small test case isolates the test cases from each other, preventing them to influence later test cases. Exactly this had happened when support for C99 comments was added in March 2021, which later turned out to be done wrong.
|
#
1.17 |
|
18-Oct-2021 |
rillig |
tests/indent: merge tests for numbers into token_ident
The previous tests 'binary' and 'float' not only test binary and floating point numbers, making their names too specific. Move them into a new test token_ident that covers all "identifier-like" tokens, just as in the code.
The test cases for the option '-cs' are already covered more systematically in opt_cs.c, so remove that test.
|
#
1.16 |
|
16-Oct-2021 |
rillig |
tests/indent: condense tests for bool options
Previously, each bool option such as '-bacc/-nbacc' had 6 test files: input, options, output for the positive and negative option. Splitting this test data into separate files made it harder than necessary to quickly compare the test output from '-bacc' with that of '-nbacc'.
Have a single test for the positive and negative option, allowing several tests to run on the same input with different options.
This commit only contains the rather mechanic changes of concatenating the previous test files and inserting the '#indent' directives, which are documented in t_options.sh. Removing duplicate input sections, as well as other cleanups will follow soon.
No functional change.
|
#
1.15 |
|
14-Oct-2021 |
rillig |
tests/indent: provide full line coverage for argument handling
|
#
1.14 |
|
13-Oct-2021 |
rillig |
indent: check command line options stricter
Previously, bool options were allowed to have trailing garbage. For example, the option '-bacc' could be spelled '-bacchus' as well.
Check that the exact option name is given in the command line, to prevent typos in the configuration files and to reduce surprises just in case a future option is a prefix of an existing option, or vice versa.
Add a new test program for error handling. Most of these tests are so simple that it would be overkill to create 3 files for each test.
|
#
1.13 |
|
07-Oct-2021 |
rillig |
tests/indent: test parsing of command line options in profile file
|
#
1.12 |
|
05-Oct-2021 |
rillig |
tests/indent: demonstrate off-by-one error in edge case
|
#
1.11 |
|
25-Sep-2021 |
rillig |
tests/indent: test deeply nested struct declarations
|
#
1.10 |
|
25-Sep-2021 |
rillig |
tests/indent: test edge cases for the tokenizer
|
#
1.9 |
|
25-Sep-2021 |
rillig |
tests/indent: test lexing of character constants and string literals
|
Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
|
#
1.8 |
|
12-Mar-2021 |
rillig |
tests/indent: add test templates for testing specific parser symbols
The basic idea of indent is to split the input into tokens and then reassemble them, reformatting them on the way. These tokens determine how the output is formatted, therefore add tests for each of the terminal tokens and nonterminal parser symbols, to cover more common cases, and edge cases as well.
|
#
1.7 |
|
09-Mar-2021 |
rillig |
tests/indent: demonstrate strange alignment for global variables
|
#
1.6 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate wrong removed empty line before '//'
|
#
1.5 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate another bug in nested blocks
|
#
1.4 |
|
08-Mar-2021 |
rillig |
tests/indent: add test for output line counting
|
#
1.3 |
|
06-Mar-2021 |
rillig |
tests/indent: add templates for options tests
Given that indent "has even more switches than ls(1)", there are far too few tests. To make it easier to add meaningful tests for each of the options, add the templates for the tests right now, ready to be filled in.
|
#
1.2 |
|
21-Feb-2021 |
rillig |
indent: add test demonstrating that indent cannot handle C99
indent cannot handle line-end comments.
The indent test suite requires each test file to have both a NetBSD and a FreeBSD RCS ID. If the FreeBSD RCS ID is missing, the test will silently pass since in that case, an empty file is compared with an empty file. See the /start/,/end/ operator in t_indent.sh.
|
Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
|
#
1.1 |
|
04-Apr-2019 |
kamil |
branches: 1.1.2; Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot into our local copy.
FreeBSD actively maintains this program in their sources and their repository contains over 100 commits with changes.
Keep the delta between the FreeBSD and NetBSD versions to absolute minimum, mostly RCS Id and compatiblity fixes.
Major chages in this import:
- Added an option -ldi<N> to control indentation of local variable names. - Added option -P for loading user-provided files as profiles - Added -tsn for setting tabsize - Rename -nsac/-sac ("space after cast") to -ncs/-cs - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines. - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1) - Group global option variables into an options structure - Use bsearch() for looking up type keywords. - Don't produce unneeded space character in function declarators - Don't unnecessarily add a blank before a comment ends. - Don't ignore newlines after comments that follow braces.
Merge the FreeBSD intend(1) tests with our ATF framework. All tests pass.
Upgrade prepared by Manikishan Ghantasala. Final polishing by myself.
Part II, checkin new files.
|
#
1.24 |
|
19-Oct-2021 |
rillig |
tests/indent: add test for INDENT OFF/ON comments
Just to prevent unintended side effects when fixing bugs in this area.
|
#
1.23 |
|
19-Oct-2021 |
rillig |
tests/indent: make add-test generate flexible tests
They need fewer source files and are more versatile.
|
#
1.22 |
|
18-Oct-2021 |
rillig |
tests/indent: remove redundant tests for '-ncs' and '-pcs'
These tests are already covered by opt_cs.c and opt_pcs.c.
|
#
1.21 |
|
18-Oct-2021 |
rillig |
tests/indent: condense test for indentation level, add missing files
|
#
1.20 |
|
18-Oct-2021 |
rillig |
tests/indent: condense the token tests
This reduces the number of files in the test directory. It also allows the tests to be read from top to bottom, looking at only a single file.
Since t_options.awk complains about files that don't have any test case at all, add some test for each token kind. Most of the tests had previously been effectively empty.
|
#
1.19 |
|
18-Oct-2021 |
rillig |
tests/indent: extend tests for labels, extract test driver
Having the test driver in a separate file allows to run it on its own, as 'awk -f t_options.awk label.c'. When the test driver warns, exit 1; this is only needed for the standalone version, when run from inside ATF the warnings on stderr already suffice to make the test fail in the end.
|
#
1.18 |
|
18-Oct-2021 |
rillig |
tests/indent: consolidate tests for comments
These tests have been the motivation for t_options.sh, which allows to run indent with various command line options on the same input, without having to create 3 files per test case.
A test file actually contains several tests, all separated by '#indent' directives. Isolating each of these tests is simpler than having to pick up the corresponding sections from 3 separate files. Running indent on each small test case isolates the test cases from each other, preventing them to influence later test cases. Exactly this had happened when support for C99 comments was added in March 2021, which later turned out to be done wrong.
|
#
1.17 |
|
18-Oct-2021 |
rillig |
tests/indent: merge tests for numbers into token_ident
The previous tests 'binary' and 'float' not only test binary and floating point numbers, making their names too specific. Move them into a new test token_ident that covers all "identifier-like" tokens, just as in the code.
The test cases for the option '-cs' are already covered more systematically in opt_cs.c, so remove that test.
|
#
1.16 |
|
16-Oct-2021 |
rillig |
tests/indent: condense tests for bool options
Previously, each bool option such as '-bacc/-nbacc' had 6 test files: input, options, output for the positive and negative option. Splitting this test data into separate files made it harder than necessary to quickly compare the test output from '-bacc' with that of '-nbacc'.
Have a single test for the positive and negative option, allowing several tests to run on the same input with different options.
This commit only contains the rather mechanic changes of concatenating the previous test files and inserting the '#indent' directives, which are documented in t_options.sh. Removing duplicate input sections, as well as other cleanups will follow soon.
No functional change.
|
#
1.15 |
|
14-Oct-2021 |
rillig |
tests/indent: provide full line coverage for argument handling
|
#
1.14 |
|
13-Oct-2021 |
rillig |
indent: check command line options stricter
Previously, bool options were allowed to have trailing garbage. For example, the option '-bacc' could be spelled '-bacchus' as well.
Check that the exact option name is given in the command line, to prevent typos in the configuration files and to reduce surprises just in case a future option is a prefix of an existing option, or vice versa.
Add a new test program for error handling. Most of these tests are so simple that it would be overkill to create 3 files for each test.
|
#
1.13 |
|
07-Oct-2021 |
rillig |
tests/indent: test parsing of command line options in profile file
|
#
1.12 |
|
05-Oct-2021 |
rillig |
tests/indent: demonstrate off-by-one error in edge case
|
#
1.11 |
|
25-Sep-2021 |
rillig |
tests/indent: test deeply nested struct declarations
|
#
1.10 |
|
25-Sep-2021 |
rillig |
tests/indent: test edge cases for the tokenizer
|
#
1.9 |
|
25-Sep-2021 |
rillig |
tests/indent: test lexing of character constants and string literals
|
Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
|
#
1.8 |
|
12-Mar-2021 |
rillig |
tests/indent: add test templates for testing specific parser symbols
The basic idea of indent is to split the input into tokens and then reassemble them, reformatting them on the way. These tokens determine how the output is formatted, therefore add tests for each of the terminal tokens and nonterminal parser symbols, to cover more common cases, and edge cases as well.
|
#
1.7 |
|
09-Mar-2021 |
rillig |
tests/indent: demonstrate strange alignment for global variables
|
#
1.6 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate wrong removed empty line before '//'
|
#
1.5 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate another bug in nested blocks
|
#
1.4 |
|
08-Mar-2021 |
rillig |
tests/indent: add test for output line counting
|
#
1.3 |
|
06-Mar-2021 |
rillig |
tests/indent: add templates for options tests
Given that indent "has even more switches than ls(1)", there are far too few tests. To make it easier to add meaningful tests for each of the options, add the templates for the tests right now, ready to be filled in.
|
#
1.2 |
|
21-Feb-2021 |
rillig |
indent: add test demonstrating that indent cannot handle C99
indent cannot handle line-end comments.
The indent test suite requires each test file to have both a NetBSD and a FreeBSD RCS ID. If the FreeBSD RCS ID is missing, the test will silently pass since in that case, an empty file is compared with an empty file. See the /start/,/end/ operator in t_indent.sh.
|
Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
|
#
1.1 |
|
04-Apr-2019 |
kamil |
branches: 1.1.2; Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot into our local copy.
FreeBSD actively maintains this program in their sources and their repository contains over 100 commits with changes.
Keep the delta between the FreeBSD and NetBSD versions to absolute minimum, mostly RCS Id and compatiblity fixes.
Major chages in this import:
- Added an option -ldi<N> to control indentation of local variable names. - Added option -P for loading user-provided files as profiles - Added -tsn for setting tabsize - Rename -nsac/-sac ("space after cast") to -ncs/-cs - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines. - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1) - Group global option variables into an options structure - Use bsearch() for looking up type keywords. - Don't produce unneeded space character in function declarators - Don't unnecessarily add a blank before a comment ends. - Don't ignore newlines after comments that follow braces.
Merge the FreeBSD intend(1) tests with our ATF framework. All tests pass.
Upgrade prepared by Manikishan Ghantasala. Final polishing by myself.
Part II, checkin new files.
|
#
1.22 |
|
18-Oct-2021 |
rillig |
tests/indent: remove redundant tests for '-ncs' and '-pcs'
These tests are already covered by opt_cs.c and opt_pcs.c.
|
#
1.21 |
|
18-Oct-2021 |
rillig |
tests/indent: condense test for indentation level, add missing files
|
#
1.20 |
|
18-Oct-2021 |
rillig |
tests/indent: condense the token tests
This reduces the number of files in the test directory. It also allows the tests to be read from top to bottom, looking at only a single file.
Since t_options.awk complains about files that don't have any test case at all, add some test for each token kind. Most of the tests had previously been effectively empty.
|
#
1.19 |
|
18-Oct-2021 |
rillig |
tests/indent: extend tests for labels, extract test driver
Having the test driver in a separate file allows to run it on its own, as 'awk -f t_options.awk label.c'. When the test driver warns, exit 1; this is only needed for the standalone version, when run from inside ATF the warnings on stderr already suffice to make the test fail in the end.
|
#
1.18 |
|
18-Oct-2021 |
rillig |
tests/indent: consolidate tests for comments
These tests have been the motivation for t_options.sh, which allows to run indent with various command line options on the same input, without having to create 3 files per test case.
A test file actually contains several tests, all separated by '#indent' directives. Isolating each of these tests is simpler than having to pick up the corresponding sections from 3 separate files. Running indent on each small test case isolates the test cases from each other, preventing them to influence later test cases. Exactly this had happened when support for C99 comments was added in March 2021, which later turned out to be done wrong.
|
#
1.17 |
|
18-Oct-2021 |
rillig |
tests/indent: merge tests for numbers into token_ident
The previous tests 'binary' and 'float' not only test binary and floating point numbers, making their names too specific. Move them into a new test token_ident that covers all "identifier-like" tokens, just as in the code.
The test cases for the option '-cs' are already covered more systematically in opt_cs.c, so remove that test.
|
#
1.16 |
|
16-Oct-2021 |
rillig |
tests/indent: condense tests for bool options
Previously, each bool option such as '-bacc/-nbacc' had 6 test files: input, options, output for the positive and negative option. Splitting this test data into separate files made it harder than necessary to quickly compare the test output from '-bacc' with that of '-nbacc'.
Have a single test for the positive and negative option, allowing several tests to run on the same input with different options.
This commit only contains the rather mechanic changes of concatenating the previous test files and inserting the '#indent' directives, which are documented in t_options.sh. Removing duplicate input sections, as well as other cleanups will follow soon.
No functional change.
|
#
1.15 |
|
14-Oct-2021 |
rillig |
tests/indent: provide full line coverage for argument handling
|
#
1.14 |
|
13-Oct-2021 |
rillig |
indent: check command line options stricter
Previously, bool options were allowed to have trailing garbage. For example, the option '-bacc' could be spelled '-bacchus' as well.
Check that the exact option name is given in the command line, to prevent typos in the configuration files and to reduce surprises just in case a future option is a prefix of an existing option, or vice versa.
Add a new test program for error handling. Most of these tests are so simple that it would be overkill to create 3 files for each test.
|
#
1.13 |
|
07-Oct-2021 |
rillig |
tests/indent: test parsing of command line options in profile file
|
#
1.12 |
|
05-Oct-2021 |
rillig |
tests/indent: demonstrate off-by-one error in edge case
|
#
1.11 |
|
25-Sep-2021 |
rillig |
tests/indent: test deeply nested struct declarations
|
#
1.10 |
|
25-Sep-2021 |
rillig |
tests/indent: test edge cases for the tokenizer
|
#
1.9 |
|
25-Sep-2021 |
rillig |
tests/indent: test lexing of character constants and string literals
|
Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
|
#
1.8 |
|
12-Mar-2021 |
rillig |
tests/indent: add test templates for testing specific parser symbols
The basic idea of indent is to split the input into tokens and then reassemble them, reformatting them on the way. These tokens determine how the output is formatted, therefore add tests for each of the terminal tokens and nonterminal parser symbols, to cover more common cases, and edge cases as well.
|
#
1.7 |
|
09-Mar-2021 |
rillig |
tests/indent: demonstrate strange alignment for global variables
|
#
1.6 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate wrong removed empty line before '//'
|
#
1.5 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate another bug in nested blocks
|
#
1.4 |
|
08-Mar-2021 |
rillig |
tests/indent: add test for output line counting
|
#
1.3 |
|
06-Mar-2021 |
rillig |
tests/indent: add templates for options tests
Given that indent "has even more switches than ls(1)", there are far too few tests. To make it easier to add meaningful tests for each of the options, add the templates for the tests right now, ready to be filled in.
|
#
1.2 |
|
21-Feb-2021 |
rillig |
indent: add test demonstrating that indent cannot handle C99
indent cannot handle line-end comments.
The indent test suite requires each test file to have both a NetBSD and a FreeBSD RCS ID. If the FreeBSD RCS ID is missing, the test will silently pass since in that case, an empty file is compared with an empty file. See the /start/,/end/ operator in t_indent.sh.
|
Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
|
#
1.1 |
|
04-Apr-2019 |
kamil |
branches: 1.1.2; Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot into our local copy.
FreeBSD actively maintains this program in their sources and their repository contains over 100 commits with changes.
Keep the delta between the FreeBSD and NetBSD versions to absolute minimum, mostly RCS Id and compatiblity fixes.
Major chages in this import:
- Added an option -ldi<N> to control indentation of local variable names. - Added option -P for loading user-provided files as profiles - Added -tsn for setting tabsize - Rename -nsac/-sac ("space after cast") to -ncs/-cs - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines. - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1) - Group global option variables into an options structure - Use bsearch() for looking up type keywords. - Don't produce unneeded space character in function declarators - Don't unnecessarily add a blank before a comment ends. - Don't ignore newlines after comments that follow braces.
Merge the FreeBSD intend(1) tests with our ATF framework. All tests pass.
Upgrade prepared by Manikishan Ghantasala. Final polishing by myself.
Part II, checkin new files.
|
#
1.16 |
|
16-Oct-2021 |
rillig |
tests/indent: condense tests for bool options
Previously, each bool option such as '-bacc/-nbacc' had 6 test files: input, options, output for the positive and negative option. Splitting this test data into separate files made it harder than necessary to quickly compare the test output from '-bacc' with that of '-nbacc'.
Have a single test for the positive and negative option, allowing several tests to run on the same input with different options.
This commit only contains the rather mechanic changes of concatenating the previous test files and inserting the '#indent' directives, which are documented in t_options.sh. Removing duplicate input sections, as well as other cleanups will follow soon.
No functional change.
|
#
1.15 |
|
14-Oct-2021 |
rillig |
tests/indent: provide full line coverage for argument handling
|
#
1.14 |
|
13-Oct-2021 |
rillig |
indent: check command line options stricter
Previously, bool options were allowed to have trailing garbage. For example, the option '-bacc' could be spelled '-bacchus' as well.
Check that the exact option name is given in the command line, to prevent typos in the configuration files and to reduce surprises just in case a future option is a prefix of an existing option, or vice versa.
Add a new test program for error handling. Most of these tests are so simple that it would be overkill to create 3 files for each test.
|
#
1.13 |
|
07-Oct-2021 |
rillig |
tests/indent: test parsing of command line options in profile file
|
#
1.12 |
|
05-Oct-2021 |
rillig |
tests/indent: demonstrate off-by-one error in edge case
|
#
1.11 |
|
25-Sep-2021 |
rillig |
tests/indent: test deeply nested struct declarations
|
#
1.10 |
|
25-Sep-2021 |
rillig |
tests/indent: test edge cases for the tokenizer
|
#
1.9 |
|
25-Sep-2021 |
rillig |
tests/indent: test lexing of character constants and string literals
|
Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
|
#
1.8 |
|
12-Mar-2021 |
rillig |
tests/indent: add test templates for testing specific parser symbols
The basic idea of indent is to split the input into tokens and then reassemble them, reformatting them on the way. These tokens determine how the output is formatted, therefore add tests for each of the terminal tokens and nonterminal parser symbols, to cover more common cases, and edge cases as well.
|
#
1.7 |
|
09-Mar-2021 |
rillig |
tests/indent: demonstrate strange alignment for global variables
|
#
1.6 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate wrong removed empty line before '//'
|
#
1.5 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate another bug in nested blocks
|
#
1.4 |
|
08-Mar-2021 |
rillig |
tests/indent: add test for output line counting
|
#
1.3 |
|
06-Mar-2021 |
rillig |
tests/indent: add templates for options tests
Given that indent "has even more switches than ls(1)", there are far too few tests. To make it easier to add meaningful tests for each of the options, add the templates for the tests right now, ready to be filled in.
|
#
1.2 |
|
21-Feb-2021 |
rillig |
indent: add test demonstrating that indent cannot handle C99
indent cannot handle line-end comments.
The indent test suite requires each test file to have both a NetBSD and a FreeBSD RCS ID. If the FreeBSD RCS ID is missing, the test will silently pass since in that case, an empty file is compared with an empty file. See the /start/,/end/ operator in t_indent.sh.
|
Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
|
#
1.1 |
|
04-Apr-2019 |
kamil |
branches: 1.1.2; Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot into our local copy.
FreeBSD actively maintains this program in their sources and their repository contains over 100 commits with changes.
Keep the delta between the FreeBSD and NetBSD versions to absolute minimum, mostly RCS Id and compatiblity fixes.
Major chages in this import:
- Added an option -ldi<N> to control indentation of local variable names. - Added option -P for loading user-provided files as profiles - Added -tsn for setting tabsize - Rename -nsac/-sac ("space after cast") to -ncs/-cs - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines. - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1) - Group global option variables into an options structure - Use bsearch() for looking up type keywords. - Don't produce unneeded space character in function declarators - Don't unnecessarily add a blank before a comment ends. - Don't ignore newlines after comments that follow braces.
Merge the FreeBSD intend(1) tests with our ATF framework. All tests pass.
Upgrade prepared by Manikishan Ghantasala. Final polishing by myself.
Part II, checkin new files.
|
#
1.11 |
|
25-Sep-2021 |
rillig |
tests/indent: test deeply nested struct declarations
|
#
1.10 |
|
25-Sep-2021 |
rillig |
tests/indent: test edge cases for the tokenizer
|
#
1.9 |
|
25-Sep-2021 |
rillig |
tests/indent: test lexing of character constants and string literals
|
Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
|
#
1.8 |
|
12-Mar-2021 |
rillig |
tests/indent: add test templates for testing specific parser symbols
The basic idea of indent is to split the input into tokens and then reassemble them, reformatting them on the way. These tokens determine how the output is formatted, therefore add tests for each of the terminal tokens and nonterminal parser symbols, to cover more common cases, and edge cases as well.
|
#
1.7 |
|
09-Mar-2021 |
rillig |
tests/indent: demonstrate strange alignment for global variables
|
#
1.6 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate wrong removed empty line before '//'
|
#
1.5 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate another bug in nested blocks
|
#
1.4 |
|
08-Mar-2021 |
rillig |
tests/indent: add test for output line counting
|
#
1.3 |
|
06-Mar-2021 |
rillig |
tests/indent: add templates for options tests
Given that indent "has even more switches than ls(1)", there are far too few tests. To make it easier to add meaningful tests for each of the options, add the templates for the tests right now, ready to be filled in.
|
#
1.2 |
|
21-Feb-2021 |
rillig |
indent: add test demonstrating that indent cannot handle C99
indent cannot handle line-end comments.
The indent test suite requires each test file to have both a NetBSD and a FreeBSD RCS ID. If the FreeBSD RCS ID is missing, the test will silently pass since in that case, an empty file is compared with an empty file. See the /start/,/end/ operator in t_indent.sh.
|
Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
|
#
1.1 |
|
04-Apr-2019 |
kamil |
branches: 1.1.2; Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot into our local copy.
FreeBSD actively maintains this program in their sources and their repository contains over 100 commits with changes.
Keep the delta between the FreeBSD and NetBSD versions to absolute minimum, mostly RCS Id and compatiblity fixes.
Major chages in this import:
- Added an option -ldi<N> to control indentation of local variable names. - Added option -P for loading user-provided files as profiles - Added -tsn for setting tabsize - Rename -nsac/-sac ("space after cast") to -ncs/-cs - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines. - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1) - Group global option variables into an options structure - Use bsearch() for looking up type keywords. - Don't produce unneeded space character in function declarators - Don't unnecessarily add a blank before a comment ends. - Don't ignore newlines after comments that follow braces.
Merge the FreeBSD intend(1) tests with our ATF framework. All tests pass.
Upgrade prepared by Manikishan Ghantasala. Final polishing by myself.
Part II, checkin new files.
|
#
1.11 |
|
25-Sep-2021 |
rillig |
tests/indent: test deeply nested struct declarations
|
#
1.10 |
|
25-Sep-2021 |
rillig |
tests/indent: test edge cases for the tokenizer
|
#
1.9 |
|
25-Sep-2021 |
rillig |
tests/indent: test lexing of character constants and string literals
|
Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
|
#
1.8 |
|
12-Mar-2021 |
rillig |
tests/indent: add test templates for testing specific parser symbols
The basic idea of indent is to split the input into tokens and then reassemble them, reformatting them on the way. These tokens determine how the output is formatted, therefore add tests for each of the terminal tokens and nonterminal parser symbols, to cover more common cases, and edge cases as well.
|
#
1.7 |
|
09-Mar-2021 |
rillig |
tests/indent: demonstrate strange alignment for global variables
|
#
1.6 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate wrong removed empty line before '//'
|
#
1.5 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate another bug in nested blocks
|
#
1.4 |
|
08-Mar-2021 |
rillig |
tests/indent: add test for output line counting
|
#
1.3 |
|
06-Mar-2021 |
rillig |
tests/indent: add templates for options tests
Given that indent "has even more switches than ls(1)", there are far too few tests. To make it easier to add meaningful tests for each of the options, add the templates for the tests right now, ready to be filled in.
|
#
1.2 |
|
21-Feb-2021 |
rillig |
indent: add test demonstrating that indent cannot handle C99
indent cannot handle line-end comments.
The indent test suite requires each test file to have both a NetBSD and a FreeBSD RCS ID. If the FreeBSD RCS ID is missing, the test will silently pass since in that case, an empty file is compared with an empty file. See the /start/,/end/ operator in t_indent.sh.
|
Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
|
#
1.1 |
|
04-Apr-2019 |
kamil |
branches: 1.1.2; Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot into our local copy.
FreeBSD actively maintains this program in their sources and their repository contains over 100 commits with changes.
Keep the delta between the FreeBSD and NetBSD versions to absolute minimum, mostly RCS Id and compatiblity fixes.
Major chages in this import:
- Added an option -ldi<N> to control indentation of local variable names. - Added option -P for loading user-provided files as profiles - Added -tsn for setting tabsize - Rename -nsac/-sac ("space after cast") to -ncs/-cs - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines. - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1) - Group global option variables into an options structure - Use bsearch() for looking up type keywords. - Don't produce unneeded space character in function declarators - Don't unnecessarily add a blank before a comment ends. - Don't ignore newlines after comments that follow braces.
Merge the FreeBSD intend(1) tests with our ATF framework. All tests pass.
Upgrade prepared by Manikishan Ghantasala. Final polishing by myself.
Part II, checkin new files.
|
#
1.8 |
|
12-Mar-2021 |
rillig |
tests/indent: add test templates for testing specific parser symbols
The basic idea of indent is to split the input into tokens and then reassemble them, reformatting them on the way. These tokens determine how the output is formatted, therefore add tests for each of the terminal tokens and nonterminal parser symbols, to cover more common cases, and edge cases as well.
|
#
1.7 |
|
09-Mar-2021 |
rillig |
tests/indent: demonstrate strange alignment for global variables
|
#
1.6 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate wrong removed empty line before '//'
|
#
1.5 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate another bug in nested blocks
|
#
1.4 |
|
08-Mar-2021 |
rillig |
tests/indent: add test for output line counting
|
#
1.3 |
|
06-Mar-2021 |
rillig |
tests/indent: add templates for options tests
Given that indent "has even more switches than ls(1)", there are far too few tests. To make it easier to add meaningful tests for each of the options, add the templates for the tests right now, ready to be filled in.
|
#
1.2 |
|
21-Feb-2021 |
rillig |
indent: add test demonstrating that indent cannot handle C99
indent cannot handle line-end comments.
The indent test suite requires each test file to have both a NetBSD and a FreeBSD RCS ID. If the FreeBSD RCS ID is missing, the test will silently pass since in that case, an empty file is compared with an empty file. See the /start/,/end/ operator in t_indent.sh.
|
Revision tags: netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
|
#
1.1 |
|
04-Apr-2019 |
kamil |
branches: 1.1.2; Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot into our local copy.
FreeBSD actively maintains this program in their sources and their repository contains over 100 commits with changes.
Keep the delta between the FreeBSD and NetBSD versions to absolute minimum, mostly RCS Id and compatiblity fixes.
Major chages in this import:
- Added an option -ldi<N> to control indentation of local variable names. - Added option -P for loading user-provided files as profiles - Added -tsn for setting tabsize - Rename -nsac/-sac ("space after cast") to -ncs/-cs - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines. - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1) - Group global option variables into an options structure - Use bsearch() for looking up type keywords. - Don't produce unneeded space character in function declarators - Don't unnecessarily add a blank before a comment ends. - Don't ignore newlines after comments that follow braces.
Merge the FreeBSD intend(1) tests with our ATF framework. All tests pass.
Upgrade prepared by Manikishan Ghantasala. Final polishing by myself.
Part II, checkin new files.
|
#
1.7 |
|
09-Mar-2021 |
rillig |
tests/indent: demonstrate strange alignment for global variables
|
#
1.6 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate wrong removed empty line before '//'
|
#
1.5 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate another bug in nested blocks
|
#
1.4 |
|
08-Mar-2021 |
rillig |
tests/indent: add test for output line counting
|
#
1.3 |
|
06-Mar-2021 |
rillig |
tests/indent: add templates for options tests
Given that indent "has even more switches than ls(1)", there are far too few tests. To make it easier to add meaningful tests for each of the options, add the templates for the tests right now, ready to be filled in.
|
#
1.2 |
|
21-Feb-2021 |
rillig |
indent: add test demonstrating that indent cannot handle C99
indent cannot handle line-end comments.
The indent test suite requires each test file to have both a NetBSD and a FreeBSD RCS ID. If the FreeBSD RCS ID is missing, the test will silently pass since in that case, an empty file is compared with an empty file. See the /start/,/end/ operator in t_indent.sh.
|
Revision tags: netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
|
#
1.1 |
|
04-Apr-2019 |
kamil |
branches: 1.1.2; Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot into our local copy.
FreeBSD actively maintains this program in their sources and their repository contains over 100 commits with changes.
Keep the delta between the FreeBSD and NetBSD versions to absolute minimum, mostly RCS Id and compatiblity fixes.
Major chages in this import:
- Added an option -ldi<N> to control indentation of local variable names. - Added option -P for loading user-provided files as profiles - Added -tsn for setting tabsize - Rename -nsac/-sac ("space after cast") to -ncs/-cs - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines. - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1) - Group global option variables into an options structure - Use bsearch() for looking up type keywords. - Don't produce unneeded space character in function declarators - Don't unnecessarily add a blank before a comment ends. - Don't ignore newlines after comments that follow braces.
Merge the FreeBSD intend(1) tests with our ATF framework. All tests pass.
Upgrade prepared by Manikishan Ghantasala. Final polishing by myself.
Part II, checkin new files.
|
#
1.6 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate wrong removed empty line before '//'
|
#
1.5 |
|
08-Mar-2021 |
rillig |
tests/indent: demonstrate another bug in nested blocks
|
#
1.4 |
|
08-Mar-2021 |
rillig |
tests/indent: add test for output line counting
|
#
1.3 |
|
06-Mar-2021 |
rillig |
tests/indent: add templates for options tests
Given that indent "has even more switches than ls(1)", there are far too few tests. To make it easier to add meaningful tests for each of the options, add the templates for the tests right now, ready to be filled in.
|
#
1.2 |
|
21-Feb-2021 |
rillig |
indent: add test demonstrating that indent cannot handle C99
indent cannot handle line-end comments.
The indent test suite requires each test file to have both a NetBSD and a FreeBSD RCS ID. If the FreeBSD RCS ID is missing, the test will silently pass since in that case, an empty file is compared with an empty file. See the /start/,/end/ operator in t_indent.sh.
|
Revision tags: netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
|
#
1.1 |
|
04-Apr-2019 |
kamil |
branches: 1.1.2; Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot into our local copy.
FreeBSD actively maintains this program in their sources and their repository contains over 100 commits with changes.
Keep the delta between the FreeBSD and NetBSD versions to absolute minimum, mostly RCS Id and compatiblity fixes.
Major chages in this import:
- Added an option -ldi<N> to control indentation of local variable names. - Added option -P for loading user-provided files as profiles - Added -tsn for setting tabsize - Rename -nsac/-sac ("space after cast") to -ncs/-cs - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines. - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1) - Group global option variables into an options structure - Use bsearch() for looking up type keywords. - Don't produce unneeded space character in function declarators - Don't unnecessarily add a blank before a comment ends. - Don't ignore newlines after comments that follow braces.
Merge the FreeBSD intend(1) tests with our ATF framework. All tests pass.
Upgrade prepared by Manikishan Ghantasala. Final polishing by myself.
Part II, checkin new files.
|
#
1.3 |
|
06-Mar-2021 |
rillig |
tests/indent: add templates for options tests
Given that indent "has even more switches than ls(1)", there are far too few tests. To make it easier to add meaningful tests for each of the options, add the templates for the tests right now, ready to be filled in.
|
#
1.2 |
|
21-Feb-2021 |
rillig |
indent: add test demonstrating that indent cannot handle C99
indent cannot handle line-end comments.
The indent test suite requires each test file to have both a NetBSD and a FreeBSD RCS ID. If the FreeBSD RCS ID is missing, the test will silently pass since in that case, an empty file is compared with an empty file. See the /start/,/end/ operator in t_indent.sh.
|
Revision tags: netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
|
#
1.1 |
|
04-Apr-2019 |
kamil |
branches: 1.1.2; Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot into our local copy.
FreeBSD actively maintains this program in their sources and their repository contains over 100 commits with changes.
Keep the delta between the FreeBSD and NetBSD versions to absolute minimum, mostly RCS Id and compatiblity fixes.
Major chages in this import:
- Added an option -ldi<N> to control indentation of local variable names. - Added option -P for loading user-provided files as profiles - Added -tsn for setting tabsize - Rename -nsac/-sac ("space after cast") to -ncs/-cs - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines. - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1) - Group global option variables into an options structure - Use bsearch() for looking up type keywords. - Don't produce unneeded space character in function declarators - Don't unnecessarily add a blank before a comment ends. - Don't ignore newlines after comments that follow braces.
Merge the FreeBSD intend(1) tests with our ATF framework. All tests pass.
Upgrade prepared by Manikishan Ghantasala. Final polishing by myself.
Part II, checkin new files.
|
#
1.2 |
|
21-Feb-2021 |
rillig |
indent: add test demonstrating that indent cannot handle C99
indent cannot handle line-end comments.
The indent test suite requires each test file to have both a NetBSD and a FreeBSD RCS ID. If the FreeBSD RCS ID is missing, the test will silently pass since in that case, an empty file is compared with an empty file. See the /start/,/end/ operator in t_indent.sh.
|
Revision tags: netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
|
#
1.1 |
|
04-Apr-2019 |
kamil |
branches: 1.1.2; Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot into our local copy.
FreeBSD actively maintains this program in their sources and their repository contains over 100 commits with changes.
Keep the delta between the FreeBSD and NetBSD versions to absolute minimum, mostly RCS Id and compatiblity fixes.
Major chages in this import:
- Added an option -ldi<N> to control indentation of local variable names. - Added option -P for loading user-provided files as profiles - Added -tsn for setting tabsize - Rename -nsac/-sac ("space after cast") to -ncs/-cs - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines. - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1) - Group global option variables into an options structure - Use bsearch() for looking up type keywords. - Don't produce unneeded space character in function declarators - Don't unnecessarily add a blank before a comment ends. - Don't ignore newlines after comments that follow braces.
Merge the FreeBSD intend(1) tests with our ATF framework. All tests pass.
Upgrade prepared by Manikishan Ghantasala. Final polishing by myself.
Part II, checkin new files.
|