pg_regress: Allow overriding diff options

By setting the environment variable PG_REGRESS_DIFF_OPTS, custom diff
options can be passed.

reviewed by Jeevan Chalke
This commit is contained in:
Peter Eisentraut 2013-01-29 22:58:38 -05:00
parent 5bb2ddc0af
commit 574f764321
2 changed files with 7 additions and 1 deletions

View File

@ -285,7 +285,10 @@ gmake check EXTRA_TESTS=collate.linux.utf8 LANG=en_US.utf8
file against the reference outputs stored in the
<filename>src/test/regress/expected</filename> directory. Any
differences are saved for your inspection in
<filename>src/test/regress/regression.diffs</filename>. (Or you
<filename>src/test/regress/regression.diffs</filename>. If you don't
like the <command>diff</command> options that are used by default, set the
environment variable <envar>PG_REGRESS_DIFF_OPTS</envar>, for
instance <literal>PG_REGRESS_DIFF_OPTS='-u'</literal>. (Or you
can run <command>diff</command> yourself, if you prefer.)
</para>

View File

@ -1970,6 +1970,9 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
*/
ifunc();
if (getenv("PG_REGRESS_DIFF_OPTS"))
pretty_diff_opts = getenv("PG_REGRESS_DIFF_OPTS");
while ((c = getopt_long(argc, argv, "hV", long_options, &option_index)) != -1)
{
switch (c)