summaryrefslogtreecommitdiff
path: root/run_project_tests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2024-04-09 22:51:49 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2024-04-10 21:32:17 +0300
commitdb1b8947f01667ca106510f8c7ff60d1e0d0c702 (patch)
tree54537cc59ec32b9c1093638740b0e54091c4b33b /run_project_tests.py
parent230097fb171faa1e4c0cd5d6a81b570d09af6293 (diff)
downloadmeson-db1b8947f01667ca106510f8c7ff60d1e0d0c702.tar.gz
Add a verbose output option to run_project_tests and default it to off.
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-xrun_project_tests.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/run_project_tests.py b/run_project_tests.py
index ce88170d0..37f428b7d 100755
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -72,6 +72,7 @@ if T.TYPE_CHECKING:
failfast: bool
no_unittests: bool
only: T.List[str]
+ v: bool
ALL_TESTS = ['cmake', 'common', 'native', 'warning-meson', 'failing-meson', 'failing-build', 'failing-test',
'keyval', 'platform-osx', 'platform-windows', 'platform-linux',
@@ -89,6 +90,7 @@ class BuildStep(Enum):
clean = 5
validate = 6
+verbose_output = False
class TestResult(BaseException):
def __init__(self, cicmds: T.List[str]) -> None:
@@ -1178,8 +1180,9 @@ class TestRunFuture:
return self.future.result() if self.future else None
def log(self) -> None:
- without_install = '' if install_commands else '(without install)'
- safe_print(self.status.value, without_install, *self.testdef.display_name())
+ if verbose_output or self.status.value != TestStatus.OK.value:
+ without_install = '' if install_commands else '(without install)'
+ safe_print(self.status.value, without_install, *self.testdef.display_name())
def update_log(self, new_status: TestStatus) -> None:
self.status = new_status
@@ -1606,10 +1609,13 @@ if __name__ == '__main__':
help='Not used, only here to simplify run_tests.py')
parser.add_argument('--only', default=[],
help='name of test(s) to run, in format "category[/name]" where category is one of: ' + ', '.join(ALL_TESTS), nargs='+')
+ parser.add_argument('-v', default=False, action='store_true',
+ help='Verbose mode')
parser.add_argument('--cross-file', action='store', help='File describing cross compilation environment.')
parser.add_argument('--native-file', action='store', help='File describing native compilation environment.')
parser.add_argument('--use-tmpdir', action='store_true', help='Use tmp directory for temporary files.')
options = T.cast('ArgumentType', parser.parse_args())
+ verbose_output = options.v
if options.cross_file:
options.extra_args += ['--cross-file', options.cross_file]