diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index cf7576257..2a2f5b437 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -586,6 +586,8 @@ int dummy; cmd = [ sys.executable, self.environment.get_build_command(), '--internal', 'test' ] if not self.environment.coredata.get_builtin_option('stdsplit'): cmd += ['--no-stdsplit'] + if self.environment.coredata.get_builtin_option('errorlogs'): + cmd += ['--print-errorlogs'] cmd += [ test_data ] elem = NinjaBuildElement(self.all_outputs, 'test', 'CUSTOM_COMMAND', ['all', 'PHONY']) elem.add_item('COMMAND', cmd) diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index 03e43551f..ff45db5e2 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -211,6 +211,7 @@ builtin_options = { 'default_library' : [ UserComboOption, 'Default library type.', [ 'shared', 'static' ], 'shared' ], 'backend' : [ UserComboOption, 'Backend to use.', [ 'ninja', 'vs2010', 'xcode' ], 'ninja' ], 'stdsplit' : [ UserBooleanOption, 'Split stdout and stderr in test logs.', True ], + 'errorlogs' : [ UserBooleanOption, "Whether to print the logs from failing tests.", False ], } forbidden_target_names = {'clean': None,