|
11 | 11 | * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group |
12 | 12 | * Portions Copyright (c) 1994, Regents of the University of California |
13 | 13 | * |
14 | | - * $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.26 2007/01/1916:42:24 alvherre Exp $ |
| 14 | + * $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.27 2007/01/1921:21:13 alvherre Exp $ |
15 | 15 | * |
16 | 16 | *------------------------------------------------------------------------- |
17 | 17 | */ |
@@ -478,11 +478,20 @@ convert_sourcefiles_in(char *source, char *dest, char *suffix) |
478 | 478 | pgfnames_cleanup(names); |
479 | 479 | } |
480 | 480 |
|
| 481 | +/* Create the .sql and .out files from the .source files, if any */ |
481 | 482 | staticvoid |
482 | 483 | convert_sourcefiles(void) |
483 | 484 | { |
484 | | -convert_sourcefiles_in("input","sql","sql"); |
485 | | -convert_sourcefiles_in("output","expected","out"); |
| 485 | +structstatst; |
| 486 | +intret; |
| 487 | + |
| 488 | +ret=stat("input",&st); |
| 489 | +if (ret==0&&S_ISDIR(st.st_mode)) |
| 490 | +convert_sourcefiles_in("input","sql","sql"); |
| 491 | + |
| 492 | +ret=stat("output",&st); |
| 493 | +if (ret==0&&S_ISDIR(st.st_mode)) |
| 494 | +convert_sourcefiles_in("output","expected","out"); |
486 | 495 | } |
487 | 496 |
|
488 | 497 | /* |
|