aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2024-06-27 19:21:04 -0700
committerNoah Misch <noah@leadboat.com>2024-06-27 19:21:09 -0700
commit288426902ee54a22d22ede769d14c5b7d4b59d99 (patch)
tree6f2b963da04f16431f704b4d1d1d8aad4c3332df /src
parent07d66d3cc2a92f58a8c30a99ec7c9c68684900e9 (diff)
downloadpostgresql-288426902ee54a22d22ede769d14c5b7d4b59d99.tar.gz
postgresql-288426902ee54a22d22ede769d14c5b7d4b59d99.zip
Make TAP todo_start effects the same under Meson and prove_check.
This could have caused spurious failures only on SPARC Linux, because today's only todo_start tests for that platform. Back-patch to v16, where Meson support first appeared. Reviewed by Robert Haas. Discussion: https://postgr.es/m/20240512232923.aa.nmisch@google.com
Diffstat (limited to 'src')
-rwxr-xr-xsrc/tools/testwrap18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/tools/testwrap b/src/tools/testwrap
index 7a64fe76a2d..68976fb2f5d 100755
--- a/src/tools/testwrap
+++ b/src/tools/testwrap
@@ -36,12 +36,22 @@ env_dict = {**os.environ,
'TESTDATADIR': os.path.join(testdir, 'data'),
'TESTLOGDIR': os.path.join(testdir, 'log')}
-sp = subprocess.run(args.test_command, env=env_dict)
-
-if sp.returncode == 0:
+sp = subprocess.Popen(args.test_command, env=env_dict, stdout=subprocess.PIPE)
+# Meson categorizes a passing TODO test point as bad
+# (https://github.com/mesonbuild/meson/issues/13183). Remove the TODO
+# directive, so Meson computes the file result like Perl does. This could
+# have the side effect of delaying stdout lines relative to stderr. That
+# doesn't affect the log file, and the TAP protocol uses stdout only.
+for line in sp.stdout:
+ if line.startswith(b'ok '):
+ line = line.replace(b' # TODO ', b' # testwrap-overridden-TODO ', 1)
+ sys.stdout.buffer.write(line)
+returncode = sp.wait()
+
+if returncode == 0:
print('# test succeeded')
open(os.path.join(testdir, 'test.success'), 'x')
else:
print('# test failed')
open(os.path.join(testdir, 'test.fail'), 'x')
-sys.exit(sp.returncode)
+sys.exit(returncode)