diff --git a/configure b/configure index d06ded9cd4a..31e547816f3 100755 --- a/configure +++ b/configure @@ -3633,7 +3633,6 @@ fi - # # Injection points # diff --git a/configure.ac b/configure.ac index c5037f71964..cd63ed803af 100644 --- a/configure.ac +++ b/configure.ac @@ -236,7 +236,8 @@ AC_SUBST(enable_dtrace) PGAC_ARG_BOOL(enable, tap-tests, no, [enable TAP tests (requires Perl and IPC::Run)]) AC_SUBST(enable_tap_tests) -AC_ARG_VAR(PG_TEST_EXTRA, [Enable selected extra tests. Overridden by PG_TEST_EXTRA environment variable.]) +AC_ARG_VAR(PG_TEST_EXTRA, + [Enable selected extra tests. Overridden by PG_TEST_EXTRA environment variable.]) # # Injection points diff --git a/meson.build b/meson.build index c11bc928b93..9d1d8847af3 100644 --- a/meson.build +++ b/meson.build @@ -3390,7 +3390,7 @@ foreach test_dir : tests # Export PG_TEST_EXTRA so it can be checked in individual tap tests. # This configure option is overridden by PG_TEST_EXTRA environment variable # if it exists. - '--pg_test_extra', get_option('PG_TEST_EXTRA'), + '--pg-test-extra', get_option('PG_TEST_EXTRA'), ] foreach kind, v : test_dir diff --git a/src/tools/testwrap b/src/tools/testwrap index 665e3f14ed0..8ae8fb79ba7 100755 --- a/src/tools/testwrap +++ b/src/tools/testwrap @@ -13,7 +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('--pg-test-extra', help='extra tests', type=str) parser.add_argument('test_command', nargs='*') args = parser.parse_args() @@ -43,10 +43,12 @@ env_dict = {**os.environ, 'TESTLOGDIR': os.path.join(testdir, 'log')} -# If PG_TEST_EXTRA is not already part of the test environment, check if it's -# passed via program argument --pg_test_extra. Thus we also override -# configuration time value by run time value of PG_TEST_EXTRA. -if "PG_TEST_EXTRA" not in os.environ and args.pg_test_extra: +# 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)