indent(1): add regression test cases
authorpstef <pstef@FreeBSD.org>
Fri, 10 Feb 2017 09:31:39 +0000 (09:31 +0000)
committerpstef <pstef@FreeBSD.org>
Fri, 10 Feb 2017 09:31:39 +0000 (09:31 +0000)
commit8695fe8cf58a51c293f3a9e95275f51d98028db9
treec74d9738eaa895dd18e79f0654986b4554f5e3ee
parente9f872e5e1bea8de310a7ea0c34c5399611ad5b0
indent(1): add regression test cases

These examples show expected behavior of indent(1). They are meant to be used
together with a regression test mechanism, either Kyua, a Makefile or perhaps
something else. The mechanism should in essence do this:
  indent -P${test}.pro < ${test}.0 > ${test}.0.run
and compare ${test}.0.stdout to ${test}.0.run. If the files differ or the exit
status isn't 0, the test failed.

* ${test}.pro is an indent(1) profile: a list of options passed through a file.
  The program doesn't complain if the file doesn't exist.
* ${test}.0 is a C source file which acts as input for indent(1). It doesn't
  have to have any particular formatting, since it's the output that matters.
* ${test}.0.stdout contains expected output. It doesn't have to be formatted in
  Kernel Normal Form as the point of the tests is to check for regressions in
  the program and not to check that it always produces KNF.

Reviewed by: ngie
Approved by: pfg (mentor)
Differential Revision: https://reviews.freebsd.org/D9007
33 files changed:
usr.bin/indent/tests/comments.0 [new file with mode: 0644]
usr.bin/indent/tests/comments.0.stdout [new file with mode: 0644]
usr.bin/indent/tests/declarations.0 [new file with mode: 0644]
usr.bin/indent/tests/declarations.0.stdout [new file with mode: 0644]
usr.bin/indent/tests/elsecomment.0 [new file with mode: 0644]
usr.bin/indent/tests/elsecomment.0.stdout [new file with mode: 0644]
usr.bin/indent/tests/elsecomment.pro [new file with mode: 0644]
usr.bin/indent/tests/float.0 [new file with mode: 0644]
usr.bin/indent/tests/float.0.stdout [new file with mode: 0644]
usr.bin/indent/tests/label.0 [new file with mode: 0644]
usr.bin/indent/tests/label.0.stdout [new file with mode: 0644]
usr.bin/indent/tests/label.pro [new file with mode: 0644]
usr.bin/indent/tests/list_head.0 [new file with mode: 0644]
usr.bin/indent/tests/list_head.0.stdout [new file with mode: 0644]
usr.bin/indent/tests/nsac.0 [new file with mode: 0644]
usr.bin/indent/tests/nsac.0.stdout [new file with mode: 0644]
usr.bin/indent/tests/nsac.pro [new file with mode: 0644]
usr.bin/indent/tests/offsetof.0 [new file with mode: 0644]
usr.bin/indent/tests/offsetof.0.stdout [new file with mode: 0644]
usr.bin/indent/tests/sac.0 [new file with mode: 0644]
usr.bin/indent/tests/sac.0.stdout [new file with mode: 0644]
usr.bin/indent/tests/sac.pro [new file with mode: 0644]
usr.bin/indent/tests/struct.0 [new file with mode: 0644]
usr.bin/indent/tests/struct.0.stdout [new file with mode: 0644]
usr.bin/indent/tests/surplusbad.0 [new file with mode: 0644]
usr.bin/indent/tests/surplusbad.0.stdout [new file with mode: 0644]
usr.bin/indent/tests/surplusbad.pro [new file with mode: 0644]
usr.bin/indent/tests/types_from_file.0 [new file with mode: 0644]
usr.bin/indent/tests/types_from_file.0.stdout [new file with mode: 0644]
usr.bin/indent/tests/types_from_file.list [new file with mode: 0644]
usr.bin/indent/tests/types_from_file.pro [new file with mode: 0644]
usr.bin/indent/tests/wchar.0 [new file with mode: 0644]
usr.bin/indent/tests/wchar.0.stdout [new file with mode: 0644]