Fix expecteddir argument in pg_regress
Hi all!
pg_regress accepts the expecteddir argument. However, it is never used
and outputdir is used instead to get the expected files paths.
This patch fixes this and uses the expecteddir argument as expected.
Regards,
Anthonin
Attachments:
v01-0001-pg_regress-Use-expecteddir-for-the-expected-file.patchapplication/octet-stream; name=v01-0001-pg_regress-Use-expecteddir-for-the-expected-file.patchDownload
From 69778019f68ecb1b8eefa6a5266cf86af8c5c3a3 Mon Sep 17 00:00:00 2001
From: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>
Date: Mon, 11 Mar 2024 08:32:54 +0100
Subject: pg_regress: Use expecteddir for the expected file location
pg_regress accepts the expecteddir as an argument. However, it is never
used and outputdir is used instead. This patch fixes this and uses the
expecteddir argument as expected.
---
src/test/regress/pg_regress_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index d607a3023b..8aeed97be1 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -54,7 +54,7 @@ psql_start_test(const char *testname,
outputdir, testname);
snprintf(expectfile, sizeof(expectfile), "%s/expected/%s.out",
- outputdir, testname);
+ expecteddir, testname);
if (!file_exists(expectfile))
snprintf(expectfile, sizeof(expectfile), "%s/expected/%s.out",
inputdir, testname);
--
2.39.3 (Apple Git-145)
On 11 Mar 2024, at 09:23, Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com> wrote:
pg_regress accepts the expecteddir argument. However, it is never used
and outputdir is used instead to get the expected files paths.
Nice catch, c855872074b5bf44ecea033674d22fac831cfc31 added --expecteddir
support to pg_regress but only implemented it for the ECPG tests. Will have
another look at this before applying with a backpatch to v16 where
--expecteddir was added.
--
Daniel Gustafsson
On 14 Mar 2024, at 11:45, Daniel Gustafsson <daniel@yesql.se> wrote:
On 11 Mar 2024, at 09:23, Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com> wrote:
pg_regress accepts the expecteddir argument. However, it is never used
and outputdir is used instead to get the expected files paths.Nice catch, c855872074b5bf44ecea033674d22fac831cfc31 added --expecteddir
support to pg_regress but only implemented it for the ECPG tests. Will have
another look at this before applying with a backpatch to v16 where
--expecteddir was added.
Pushed and backpatched, thanks for the submission!
--
Daniel Gustafsson