Commit a78cf618 authored by Al Muthanna Athamina's avatar Al Muthanna Athamina Committed by V8 LUCI CQ

Add D8 flag --no-fail that ignores exceptions on exit.

The NumFuzz fuzzers need to make use of this flag to ignore
Mjsunit exceptions and other exceptions. The flag ignores
the exit code 1.

R=​clemensb@chromium.org
R=cbruni@chromium.org

Bug: v8:11826
Change-Id: Ic0878078edec7292e43cdb18dd6fb32f7bbad12c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3103310
Commit-Queue: Almothana Athamneh <almuthanna@chromium.org>
Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76376}
parent f2da7ce0
......@@ -4265,6 +4265,9 @@ bool Shell::SetOptions(int argc, char* argv[]) {
} else if (strcmp(argv[i], "--throws") == 0) {
options.expected_to_throw = true;
argv[i] = nullptr;
} else if (strcmp(argv[i], "--no-fail") == 0) {
options.no_fail = true;
argv[i] = nullptr;
} else if (strncmp(argv[i], "--icu-data-file=", 16) == 0) {
options.icu_data_file = argv[i] + 16;
argv[i] = nullptr;
......@@ -4514,7 +4517,8 @@ int Shell::RunMain(Isolate* isolate, bool last_run) {
Shell::unhandled_promise_rejections_.store(0);
}
// In order to finish successfully, success must be != expected_to_throw.
return success == Shell::options.expected_to_throw ? 1 : 0;
if (Shell::options.no_fail) return 0;
return (success == Shell::options.expected_to_throw ? 1 : 0);
}
void Shell::CollectGarbage(Isolate* isolate) {
......
......@@ -385,6 +385,7 @@ class ShellOptions {
DisallowReassignment<bool> interactive_shell = {"shell", false};
bool test_shell = false;
DisallowReassignment<bool> expected_to_throw = {"throws", false};
DisallowReassignment<bool> no_fail = {"no-fail", false};
DisallowReassignment<bool> ignore_unhandled_promises = {
"ignore-unhandled-promises", false};
DisallowReassignment<bool> mock_arraybuffer_allocator = {
......
// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --no-fail
assertTrue(false);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment