JSSpecCompiler: Add option to silence all diagnostics and use in tests
In the future, we will probably want to test regressions in diagnostics too but let's not do that for now.
This commit is contained in:
parent
0e7c33b1be
commit
ec16556fea
Notes:
sideshowbarker
2024-07-18 00:34:07 +09:00
Author: https://github.com/DanShaders Commit: https://github.com/SerenityOS/serenity/commit/ec16556fea Pull-request: https://github.com/SerenityOS/serenity/pull/23647 Reviewed-by: https://github.com/ADKaster ✅
2 changed files with 7 additions and 1 deletions
|
@ -116,6 +116,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
StringView passes_to_dump_cfg;
|
||||
args_parser.add_option(passes_to_dump_cfg, "Dump CFG after specified passes.", "dump-cfg", 0, "{all|last|<pass-name>|-<pass-name>[,...]}");
|
||||
|
||||
bool silence_diagnostics = false;
|
||||
args_parser.add_option(silence_diagnostics, "Silence all diagnostics.", "silence-diagnostics", 0);
|
||||
|
||||
args_parser.parse(arguments);
|
||||
|
||||
CompilationPipeline pipeline;
|
||||
|
@ -163,7 +166,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
}
|
||||
}
|
||||
|
||||
translation_unit.diag().print_diagnostics();
|
||||
if (!silence_diagnostics)
|
||||
translation_unit.diag().print_diagnostics();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -92,6 +92,8 @@ Vector<ByteString> build_command_line_arguments(LexicalPath const& test_source,
|
|||
if (test_source.has_extension(".cpp"sv))
|
||||
result.append("-xc++"sv);
|
||||
|
||||
result.append("--silence-diagnostics"sv);
|
||||
|
||||
result.append(test_source.string());
|
||||
|
||||
return result;
|
||||
|
|
Loading…
Add table
Reference in a new issue