mirror of
https://github.com/postgres/postgres.git
synced 2025-11-22 12:22:45 +03:00
Add 'make check-tests' behavior to the meson based builds
There was no easy way to run specific tests in the meson based builds. Author: Nazir Bilal Yavuz <byavuz81@gmail.com> Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> Reviewed-by: Jian He <jian.universality@gmail.com> Discussion: postgr.es/m/CAExHW5tK-QqayUN0%2BN3MF5bjV6vLKDCkRuGwoDJwc7vGjwCygQ%40mail.gmail.com
This commit is contained in:
12
meson.build
12
meson.build
@@ -3679,11 +3679,9 @@ foreach test_dir : tests
|
|||||||
'--dbname', dbname,
|
'--dbname', dbname,
|
||||||
] + t.get('regress_args', [])
|
] + t.get('regress_args', [])
|
||||||
|
|
||||||
test_selection = []
|
test_schedule = t.get('schedule', [])
|
||||||
if t.has_key('schedule')
|
|
||||||
test_selection += ['--schedule', t['schedule'],]
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
test_selection = []
|
||||||
if kind == 'isolation'
|
if kind == 'isolation'
|
||||||
test_selection += t.get('specs', [])
|
test_selection += t.get('specs', [])
|
||||||
else
|
else
|
||||||
@@ -3707,12 +3705,13 @@ foreach test_dir : tests
|
|||||||
testwrap_base,
|
testwrap_base,
|
||||||
'--testgroup', test_group,
|
'--testgroup', test_group,
|
||||||
'--testname', kind,
|
'--testname', kind,
|
||||||
|
'--schedule', test_schedule,
|
||||||
|
'--tests', test_selection,
|
||||||
'--',
|
'--',
|
||||||
test_command_base,
|
test_command_base,
|
||||||
'--outputdir', test_output,
|
'--outputdir', test_output,
|
||||||
'--temp-instance', test_output / 'tmp_check',
|
'--temp-instance', test_output / 'tmp_check',
|
||||||
'--port', testport.to_string(),
|
'--port', testport.to_string(),
|
||||||
test_selection,
|
|
||||||
],
|
],
|
||||||
suite: test_group,
|
suite: test_group,
|
||||||
kwargs: test_kwargs,
|
kwargs: test_kwargs,
|
||||||
@@ -3727,10 +3726,11 @@ foreach test_dir : tests
|
|||||||
testwrap_base,
|
testwrap_base,
|
||||||
'--testgroup', test_group_running,
|
'--testgroup', test_group_running,
|
||||||
'--testname', kind,
|
'--testname', kind,
|
||||||
|
'--schedule', test_schedule,
|
||||||
|
'--tests', test_selection,
|
||||||
'--',
|
'--',
|
||||||
test_command_base,
|
test_command_base,
|
||||||
'--outputdir', test_output_running,
|
'--outputdir', test_output_running,
|
||||||
test_selection,
|
|
||||||
],
|
],
|
||||||
is_parallel: t.get('runningcheck-parallel', true),
|
is_parallel: t.get('runningcheck-parallel', true),
|
||||||
suite: test_group_running,
|
suite: test_group_running,
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ parser.add_argument('--srcdir', help='source directory of test', type=str)
|
|||||||
parser.add_argument('--basedir', help='base directory of test', type=str)
|
parser.add_argument('--basedir', help='base directory of test', type=str)
|
||||||
parser.add_argument('--testgroup', help='test group', type=str)
|
parser.add_argument('--testgroup', help='test group', type=str)
|
||||||
parser.add_argument('--testname', help='test name', type=str)
|
parser.add_argument('--testname', help='test name', type=str)
|
||||||
|
parser.add_argument('--schedule', help='schedule tests', nargs='*')
|
||||||
|
parser.add_argument('--tests', help='tests', nargs='*')
|
||||||
parser.add_argument('--skip', help='skip test (with reason)', 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='*')
|
parser.add_argument('test_command', nargs='*')
|
||||||
@@ -51,6 +53,14 @@ env_dict = {**os.environ,
|
|||||||
if "PG_TEST_EXTRA" not in env_dict and args.pg_test_extra:
|
if "PG_TEST_EXTRA" not in env_dict and args.pg_test_extra:
|
||||||
env_dict["PG_TEST_EXTRA"] = args.pg_test_extra
|
env_dict["PG_TEST_EXTRA"] = args.pg_test_extra
|
||||||
|
|
||||||
|
if "TESTS" in env_dict:
|
||||||
|
args.test_command += env_dict["TESTS"].split()
|
||||||
|
else:
|
||||||
|
if args.schedule:
|
||||||
|
args.test_command += ['--schedule', ' '.join(args.schedule)]
|
||||||
|
if args.tests:
|
||||||
|
args.test_command.extend(args.tests)
|
||||||
|
|
||||||
sp = subprocess.Popen(args.test_command, env=env_dict, stdout=subprocess.PIPE)
|
sp = subprocess.Popen(args.test_command, env=env_dict, stdout=subprocess.PIPE)
|
||||||
# Meson categorizes a passing TODO test point as bad
|
# Meson categorizes a passing TODO test point as bad
|
||||||
# (https://github.com/mesonbuild/meson/issues/13183). Remove the TODO
|
# (https://github.com/mesonbuild/meson/issues/13183). Remove the TODO
|
||||||
|
|||||||
Reference in New Issue
Block a user