Skip to content

Commit

Permalink
fuzz: Add option to ignore errors
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Aug 3, 2020
1 parent cdd3dbd commit 8b2c0df
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/fuzzer/parser_fuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// SPDX-License-Identifier: Apache-2.0

#include "parser.hpp"
#include <cstdlib>
#include <iomanip>
#include <iostream>

Expand Down Expand Up @@ -36,7 +37,14 @@ Stats stats;

void handle_unexpected_errors() noexcept
{
__builtin_trap();
static const bool ignore_errors = [] {
const auto options = std::getenv("OPTIONS");
if (!options)
return false;
return std::string{options}.find("ignore_errors") != std::string::npos;
}();
if (!ignore_errors)
__builtin_trap();
}

constexpr auto wabt_ignored_errors = {
Expand Down

0 comments on commit 8b2c0df

Please sign in to comment.