From: Peter Eisentraut Date: Wed, 30 Jan 2013 03:58:38 +0000 (-0500) Subject: pg_regress: Allow overriding diff options X-Git-Tag: REL9_3_BETA1~406 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=574f7643214d8381a03083ffbb08ecceec44d6b2;p=postgresql.git 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 --- diff --git a/doc/src/sgml/regress.sgml b/doc/src/sgml/regress.sgml index 60250bb7a9f..327c3d04f7b 100644 --- a/doc/src/sgml/regress.sgml +++ b/doc/src/sgml/regress.sgml @@ -285,7 +285,10 @@ gmake check EXTRA_TESTS=collate.linux.utf8 LANG=en_US.utf8 file against the reference outputs stored in the src/test/regress/expected directory. Any differences are saved for your inspection in - src/test/regress/regression.diffs. (Or you + src/test/regress/regression.diffs. If you don't + like the diff options that are used by default, set the + environment variable PG_REGRESS_DIFF_OPTS, for + instance PG_REGRESS_DIFF_OPTS='-u'. (Or you can run diff yourself, if you prefer.) diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index 1980fd63957..b632326e08d 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -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)