Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
a184e4db
Commit
a184e4db
authored
Jul 06, 2012
by
Alvaro Herrera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert libpq regress script to Perl
This should ease its use on the Windows build environment.
parent
adb9b7d5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
22 deletions
+63
-22
src/interfaces/libpq/test/Makefile
src/interfaces/libpq/test/Makefile
+1
-1
src/interfaces/libpq/test/regress.pl
src/interfaces/libpq/test/regress.pl
+62
-0
src/interfaces/libpq/test/regress.sh
src/interfaces/libpq/test/regress.sh
+0
-21
No files found.
src/interfaces/libpq/test/Makefile
View file @
a184e4db
...
...
@@ -15,7 +15,7 @@ all: $(PROGS)
installcheck
:
all
SRCDIR
=
'
$(top_srcdir)
'
SUBDIR
=
'
$(subdir)
'
\
$(
SHELL)
$(top_srcdir)
/
$(subdir)
/regress.sh
$(
PERL)
$(top_srcdir)
/
$(subdir)
/regress.pl
clean distclean maintainer-clean
:
rm
-f
$(PROGS)
...
...
src/interfaces/libpq/test/regress.pl
0 → 100644
View file @
a184e4db
#!/usr/bin/perl -w
use
strict
;
# use of SRCDIR/SUBDIR is required for supporting VPath builds
my
$srcdir
=
$ENV
{'
SRCDIR
'}
or
die
'
SRCDIR environment variable is not set
';
my
$subdir
=
$ENV
{'
SUBDIR
'}
or
die
'
SUBDIR environment variable is not set
';
my
$regress_in
=
"
$srcdir
/
$subdir
/regress.in
";
my
$expected_out
=
"
$srcdir
/
$subdir
/expected.out
";
# the output file should land in the build_dir of VPath, or just in
# the current dir, if VPath isn't used
my
$regress_out
=
"
regress.out
";
# open input file first, so possible error isn't sent to redirected STDERR
open
(
REGRESS_IN
,
"
<
",
$regress_in
)
or
die
"
can't open
$regress_in
for reading: $!
";
# save STDOUT/ERR and redirect both to regress.out
open
(
OLDOUT
,
"
>&
",
\*
STDOUT
)
or
die
"
can't dup STDOUT: $!
";
open
(
OLDERR
,
"
>&
",
\*
STDERR
)
or
die
"
can't dup STDERR: $!
";
open
(
STDOUT
,
"
>
",
$regress_out
)
or
die
"
can't open
$regress_out
for writing: $!
";
open
(
STDERR
,
"
>&
",
\*
STDOUT
)
or
die
"
can't dup STDOUT: $!
";
# read lines from regress.in and run uri-regress on them
while
(
<
REGRESS_IN
>
)
{
chomp
;
print
"
trying
$_
\n
";
system
("
./uri-regress
\"
$_
\"
");
print
"
\n
";
}
# restore STDOUT/ERR so we can print the outcome to the user
open
(
STDERR
,
"
>&
",
\*
OLDERR
)
or
die
;
# can't complain as STDERR is still duped
open
(
STDOUT
,
"
>&
",
\*
OLDOUT
)
or
die
"
Can't restore STDOUT: $!
";
# just in case
close
REGRESS_IN
;
my
$diff_status
=
system
(
"
diff -c
\"
$srcdir
/
$subdir
/expected.out
\"
regress.out >regress.diff
");
if
(
$diff_status
==
0
)
{
print
"
=
"
x
70
,
"
\n
";
print
"
All tests passed
\n
";
exit
0
;
}
else
{
print
"
=
"
x
70
,
"
\n
";
print
<<EOF;
FAILED: the test result differs from the expected output
Review the difference in "$subdir/regress.diff"
EOF
print
"
=
"
x
70
,
"
\n
";
exit
1
;
}
src/interfaces/libpq/test/regress.sh
deleted
100644 → 0
View file @
adb9b7d5
#!/bin/sh
while
read
line
do
echo
"trying
$line
"
./uri-regress
"
$line
"
echo
""
done
<
"
${
SRCDIR
}
/
${
SUBDIR
}
"
/regress.in
>
regress.out 2>&1
if
diff
-c
"
${
SRCDIR
}
/
${
SUBDIR
}
/"
expected.out regress.out
>
regress.diff
;
then
echo
"========================================"
echo
"All tests passed"
exit
0
else
echo
"========================================"
echo
"FAILED: the test result differs from the expected output"
echo
echo
"Review the difference in
${
SUBDIR
}
/regress.diff"
echo
"========================================"
exit
1
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment