summaryrefslogtreecommitdiff
path: root/src/tools/testwrap
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/testwrap')
-rwxr-xr-xsrc/tools/testwrap10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tools/testwrap b/src/tools/testwrap
index 9a270beb72d..8ae8fb79ba7 100755
--- a/src/tools/testwrap
+++ b/src/tools/testwrap
@@ -13,6 +13,7 @@ parser.add_argument('--basedir', help='base directory of test', type=str)
parser.add_argument('--testgroup', help='test group', type=str)
parser.add_argument('--testname', help='test name', type=str)
parser.add_argument('--skip', help='skip test (with reason)', type=str)
+parser.add_argument('--pg-test-extra', help='extra tests', type=str)
parser.add_argument('test_command', nargs='*')
args = parser.parse_args()
@@ -41,6 +42,15 @@ env_dict = {**os.environ,
'TESTDATADIR': os.path.join(testdir, 'data'),
'TESTLOGDIR': os.path.join(testdir, 'log')}
+
+# The configuration time value of PG_TEST_EXTRA is supplied via arguement
+# --pg-test-extra. But it can be overridden by environment variable
+# PG_TEST_EXTRA at the time of running a test. Hence use value from arguments
+# only if PG_TEST_EXTRA is not set in the test environment, which already
+# contains all the environment variables at the time of running the test.
+if "PG_TEST_EXTRA" not in env_dict and args.pg_test_extra:
+ env_dict["PG_TEST_EXTRA"] = args.pg_test_extra
+
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