Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kconfig: tests: support KCONFIG_SEED for the randconfig runner

This will help get consistent results for randconfig tests.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

+10 -6
+10 -6
scripts/kconfig/tests/conftest.py
··· 154 154 defconfig_path = os.path.join(self._test_dir, defconfig) 155 155 return self._run_conf('--defconfig={}'.format(defconfig_path)) 156 156 157 - def _allconfig(self, mode, all_config): 157 + def _allconfig(self, mode, all_config, extra_env={}): 158 158 if all_config: 159 159 all_config_path = os.path.join(self._test_dir, all_config) 160 - extra_env = {'KCONFIG_ALLCONFIG': all_config_path} 161 - else: 162 - extra_env = {} 160 + extra_env['KCONFIG_ALLCONFIG'] = all_config_path 163 161 164 162 return self._run_conf('--{}config'.format(mode), extra_env=extra_env) 165 163 ··· 193 195 """ 194 196 return self._allconfig('alldef', all_config) 195 197 196 - def randconfig(self, all_config=None): 198 + def randconfig(self, all_config=None, seed=None): 197 199 """Run randconfig. 198 200 199 201 all_config: fragment config file for KCONFIG_ALLCONFIG (optional) 202 + seed: the seed for randconfig (optional) 200 203 returncode: exit status of the Kconfig executable 201 204 """ 202 - return self._allconfig('rand', all_config) 205 + if seed is not None: 206 + extra_env = {'KCONFIG_SEED': hex(seed)} 207 + else: 208 + extra_env = {} 209 + 210 + return self._allconfig('rand', all_config, extra_env=extra_env) 203 211 204 212 def savedefconfig(self, dot_config): 205 213 """Run savedefconfig.