aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2007-01-19 21:21:13 +0000
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2007-01-19 21:21:13 +0000
commit67a4c24bc8c7ce7f0916259a7b544256f257a552 (patch)
tree65ca60a71866818ca5a3944df7ebde7498b713e3
parent506b292852ea40f1fcb5ffec9809dd6a5ce6e01c (diff)
downloadpostgresql-67a4c24bc8c7ce7f0916259a7b544256f257a552.tar.gz
postgresql-67a4c24bc8c7ce7f0916259a7b544256f257a552.zip
Fix pg_regress breakage for PL and contrib tests, by not requiring that
"input" and "output" dirs be necessarily present.
-rw-r--r--src/test/regress/pg_regress.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index da10cda9ddd..3da5ccf7d71 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -11,7 +11,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.26 2007/01/19 16:42:24 alvherre Exp $
+ * $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.27 2007/01/19 21:21:13 alvherre Exp $
*
*-------------------------------------------------------------------------
*/
@@ -478,11 +478,20 @@ convert_sourcefiles_in(char *source, char *dest, char *suffix)
pgfnames_cleanup(names);
}
+/* Create the .sql and .out files from the .source files, if any */
static void
convert_sourcefiles(void)
{
- convert_sourcefiles_in("input", "sql", "sql");
- convert_sourcefiles_in("output", "expected", "out");
+ struct stat st;
+ int ret;
+
+ ret = stat("input", &st);
+ if (ret == 0 && S_ISDIR(st.st_mode))
+ convert_sourcefiles_in("input", "sql", "sql");
+
+ ret = stat("output", &st);
+ if (ret == 0 && S_ISDIR(st.st_mode))
+ convert_sourcefiles_in("output", "expected", "out");
}
/*