Re: pgindent (was Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.)

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Piotr Stefaniak <postgres@piotr-stefaniak.me>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2017-06-14T17:31:21Z
Lists: pgsql-hackers
Piotr Stefaniak <postgres@piotr-stefaniak.me> writes:
> On 2017-06-13 18:22, Tom Lane wrote:
>> Also, I am wondering about the test cases under tests/.  I do not
>> see anything in the Makefile or elsewhere suggesting how those are
>> to be used.  It would sure be nice to have some quick smoke-test
>> to check that a build on a new platform is working.

> They'd started out like David Holland's tests for his tradcpp(1), with a
> similar makefile (again, BSD make). But I was tenaciously asked to use
> Kyua (a testing framework that is the standard regression test mechanism
> for FreeBSD) instead, so now the makefile's existence and use is a great
> secret and the file is not under any source control. Adaption of the
> indent test suite to Kyua made the makefile more inelegant, but I'm
> attaching it to this email in hope that you can do something useful with
> it. I can only guess that you have the option to use Kyua instead, but I
> don't know the tool at all.

Ah, thanks.  I hacked up a gmake rule for this:

test: $(INDENT)
	cp $(srcdir)/tests/*.list .
	for testsrc in $(srcdir)/tests/*.0; do \
	test=`basename "$$testsrc" .0`; \
	./$(INDENT) $$testsrc $$test.out -P$(srcdir)/tests/$$test.pro || echo FAILED >>$$test.out; \
	diff -u $$testsrc.stdout $$test.out || exit 1; \
	done

and I'm getting one failure, which I don't understand:

--- ./tests/f_decls.0.stdout	2017-05-21 19:40:38.507303623 -0400
+++ f_decls.out	2017-06-14 13:28:49.212871476 -0400
@@ -1,4 +1,4 @@
-char *
+char	       *
 x(void)
 {
 	type		identifier;
@@ -13,7 +13,7 @@
 	return NULL;
 }
 
-int *
+int	       *
 y(void)
 {
 
Does that test case pass for you?

			regards, tom lane


Commits

  1. Manually un-break a few URLs that pgindent used to insist on splitting.

  2. Remove entab and associated detritus.

  3. Phase 3 of pgindent updates.

  4. Phase 2 of pgindent updates.

  5. Initial pgindent run with pg_bsd_indent version 2.0.

  6. Adjust pgindent script to use pg_bsd_indent 2.0.

  7. Final pgindent run with old pg_bsd_indent (version 1.3).

  8. Re-run pgindent.

  9. Preventive maintenance in advance of pgindent run.