Commit 574f7643 authored by Peter Eisentraut's avatar Peter Eisentraut

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
parent 5bb2ddc0
...@@ -285,7 +285,10 @@ gmake check EXTRA_TESTS=collate.linux.utf8 LANG=en_US.utf8 ...@@ -285,7 +285,10 @@ gmake check EXTRA_TESTS=collate.linux.utf8 LANG=en_US.utf8
file against the reference outputs stored in the file against the reference outputs stored in the
<filename>src/test/regress/expected</filename> directory. Any <filename>src/test/regress/expected</filename> directory. Any
differences are saved for your inspection in 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.) can run <command>diff</command> yourself, if you prefer.)
</para> </para>
......
...@@ -1970,6 +1970,9 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc ...@@ -1970,6 +1970,9 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
*/ */
ifunc(); 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) while ((c = getopt_long(argc, argv, "hV", long_options, &option_index)) != -1)
{ {
switch (c) switch (c)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment