aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/log.cc
diff options
context:
space:
mode:
authorMarcelina Koƛcielnicka <mwk@0x04.net>2021-08-12 17:36:03 +0200
committerMarcelina Koƛcielnicka <mwk@0x04.net>2021-08-12 17:41:39 +0200
commitc58ac63c97183dde25b7a42c1a8e85ab0dd7fe96 (patch)
tree0a863e7c774f230f176d2217a8a249b2fc424cf9 /kernel/log.cc
parentbfcd08a323044e1856ca971ba942bd36ee979f8e (diff)
downloadyosys-c58ac63c97183dde25b7a42c1a8e85ab0dd7fe96.tar.gz
yosys-c58ac63c97183dde25b7a42c1a8e85ab0dd7fe96.tar.bz2
yosys-c58ac63c97183dde25b7a42c1a8e85ab0dd7fe96.zip
logger: Add -check-expected subcommand.
This allows us to have multiple "expect this warning" calls in a single long script, covering only as many passes as necessary.
Diffstat (limited to 'kernel/log.cc')
-rw-r--r--kernel/log.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/log.cc b/kernel/log.cc
index 8d3bdd15b..e7ce4cc46 100644
--- a/kernel/log.cc
+++ b/kernel/log.cc
@@ -71,7 +71,6 @@ int string_buf_index = -1;
static struct timeval initial_tv = { 0, 0 };
static bool next_print_log = false;
static int log_newline_count = 0;
-static bool check_expected_logs = true;
static bool display_error_log_msg = true;
static void log_id_cache_clear()
@@ -349,8 +348,7 @@ static void logv_error_with_prefix(const char *prefix,
if (YS_REGEX_NS::regex_search(log_last_error, item.second.pattern))
item.second.current_count++;
- if (check_expected_logs)
- log_check_expected();
+ log_check_expected();
if (log_error_atexit)
log_error_atexit();
@@ -667,8 +665,6 @@ void log_wire(RTLIL::Wire *wire, std::string indent)
void log_check_expected()
{
- check_expected_logs = false;
-
for (auto &item : log_expect_warning) {
if (item.second.current_count == 0) {
log_warn_regexes.clear();
@@ -709,6 +705,10 @@ void log_check_expected()
log_warn_regexes.clear();
log_error("Expected error pattern '%s' not found !\n", item.first.c_str());
}
+
+ log_expect_warning.clear();
+ log_expect_log.clear();
+ log_expect_error.clear();
}
// ---------------------------------------------------