diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2022-09-21 10:28:26 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2022-09-21 10:28:26 +0200 |
commit | 3a78298e6dee2032a943204f139c597062c00162 (patch) | |
tree | 0a81bce953c8e0d36ae3eee46cc236ec5fa4ebba | |
parent | 3ebf5b020e488297a61e4b02e06d34d5b3162cf2 (diff) |
explore-kconfig: --random: ignore failed builds
-rwxr-xr-x | bin/explore-kconfig.py | 11 |
1 files changed, 8 insertions, 3 deletions
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): |