From c1090722157b531261a7cf0257f2dccb744bd93d Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Sun, 23 Apr 2023 01:23:38 +0300 Subject: [PATCH] engine: implement override_expected_value() --- kconfig_hardened_check/engine.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kconfig_hardened_check/engine.py b/kconfig_hardened_check/engine.py index e88781e..6791285 100644 --- a/kconfig_hardened_check/engine.py +++ b/kconfig_hardened_check/engine.py @@ -283,6 +283,14 @@ def populate_with_data(checklist, data, data_type): populate_opt_with_data(opt, data, data_type) +def override_expected_value(checklist, name, new_val): + for opt in checklist: + if opt.name == name: + assert(opt.type in ('kconfig', 'cmdline')), \ + f'overriding an expected value for "{opt.type}" checks is not supported yet' + opt.expected = new_val + + def perform_checks(checklist): for opt in checklist: opt.check() -- 2.31.1