Use \if/\endif to remove non-libxml2 expected output in regression tests - Mailing list pgsql-hackers

From Michael Paquier
Subject Use \if/\endif to remove non-libxml2 expected output in regression tests
Date
Msg-id aiu6CXO67q-s70n5@paquier.xyz
Whole thread
Responses Re: Use \if/\endif to remove non-libxml2 expected output in regression tests
List pgsql-hackers
Hi all,

While dealing with libxml2 things today, I have been reminded that we
have a regression test output for the case where we don't compile with
libxml2, which is error-prone (I also forgot xml_1.out; and managed to
forget about xml_2.out until massasauga has reminded me about it).

The only location where we use USE_LIBXML is in the backend's xml.c,
so we need some imagination for an \if query that can trigger an early
exit.  And it is simply possible to check if we have some data in the
table where the initial inserts are done at the top of the test, which
is what the attached patch is doing.

With this patch in place, we don't need to care about updating the
output file when not building with libxml2, leading to these numbers:
 4 files changed, 16 insertions(+), 1482 deletions(-)

I'd like to backpatch that down to v14, to ease future maintenance.
Any comments and/or objections?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Andres Taylor
Date:
Subject: Re: Remove redundant DISTINCT when GROUP BY already guarantees uniqueness
Next
From: Daniel Gustafsson
Date:
Subject: Re: Use \if/\endif to remove non-libxml2 expected output in regression tests