Skip to content

Commit b2f3f7c

Browse files
use uv to run regression test script if possible
1 parent 94e3136 commit b2f3f7c

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

scripts/regression_test_runner.py

+8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
#!/usr/bin/env python3
2+
# /// script
3+
# requires-python = ">=3.7"
4+
# dependencies = [
5+
# "jsonschema==4.17.3",
6+
# ]
7+
# [tool.uv]
8+
# exclude-newer = "2025-02-26T00:00:00Z"
9+
# ///
210
# Copyright (c) 2022 Mikkel Schubert <MikkelSch@gmail.com>
311
#
412
# Permission is hereby granted, free of charge, to any person obtaining a copy

tests/regression/meson.build

+15-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
regression_test_runner = find_program(meson.project_source_root() / 'scripts' / 'regression_test_runner.py')
1+
test_runner_script = meson.project_source_root() / 'scripts' / 'regression_test_runner.py'
2+
3+
regression_test_exe = find_program('uv', required: false, version: '>=0.5.17')
4+
if regression_test_exe.found()
5+
regression_test_args = ['run', test_runner_script]
6+
else
7+
regression_test_exe = find_program(test_runner_script)
8+
regression_test_args = []
9+
endif
210

311
regression_tests = [
412
'adapter_trimming' / 'excl_adapter' / 'pe' / 'non_overlapping',
@@ -93,8 +101,9 @@ regression_tests = [
93101
foreach test : regression_tests
94102
test(
95103
test.replace('/', ' / '),
96-
regression_test_runner,
97-
args: [
104+
regression_test_exe,
105+
args: regression_test_args
106+
+ [
98107
meson.current_build_dir(),
99108
meson.current_source_dir() / test,
100109
'--threads', '1',
@@ -110,8 +119,9 @@ endforeach
110119

111120
custom_target(
112121
'update-regression',
113-
command: [
114-
regression_test_runner,
122+
command: [regression_test_exe]
123+
+ regression_test_args
124+
+ [
115125
meson.current_build_dir(),
116126
meson.current_source_dir(),
117127
'--create-updated-reference',

0 commit comments

Comments
 (0)