]> granicus.if.org Git - postgresql/commitdiff
pg_regress: Allow overriding diff options
authorPeter Eisentraut <peter_e@gmx.net>
Wed, 30 Jan 2013 03:58:38 +0000 (22:58 -0500)
committerPeter Eisentraut <peter_e@gmx.net>
Wed, 30 Jan 2013 03:59:45 +0000 (22:59 -0500)
By setting the environment variable PG_REGRESS_DIFF_OPTS, custom diff
options can be passed.

reviewed by Jeevan Chalke

doc/src/sgml/regress.sgml
src/test/regress/pg_regress.c

index 60250bb7a9f0763064b691381d1c703d110f5f22..327c3d04f7b84175b3e81de8677e6e5ea2e2866f 100644 (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>
 
index 1980fd63957c8b890cc8b658b830cf4c669f5ff7..b632326e08df4f75a31cd34e8f76c715d3fd90f4 100644 (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)