From 3a78298e6dee2032a943204f139c597062c00162 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 21 Sep 2022 10:28:26 +0200 Subject: explore-kconfig: --random: ignore failed builds --- bin/explore-kconfig.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/explore-kconfig.py b/bin/explore-kconfig.py index 7b20c89..95d251b 100755 --- a/bin/explore-kconfig.py +++ b/bin/explore-kconfig.py @@ -101,18 +101,23 @@ def main(): kconf.enumerate() if args.random: - for i in range(args.random): - logging.info(f"Running randconfig {i+1} of {args.random}") + num_successful = 0 + # Assumption: At least 1% of builds are successful + for i in range(args.random * 100): + logging.info(f"Running randconfig {num_successful+1} of {args.random}") status = kconf.run_randconfig() + if status["success"]: + num_successful += 1 if args.with_neighbourhood and status["success"]: config_filename = status["config_path"] logging.info(f"Exploring neighbourhood of {config_filename}") kconf.run_exploration_from_file( config_filename, with_initial_config=False ) + if num_successful + 1 == args.random: + break if args.neighbourhood: - # TODO also explore range of numeric options if os.path.isfile(args.neighbourhood): kconf.run_exploration_from_file(args.neighbourhood) elif os.path.isdir(args.neighbourhood): -- cgit v1.2.3