Skip to content

Commit 7e256a1

Browse files
authored
Merge pull request #14 from sysprog21/improve-quality
Improve code quality across test suite
2 parents 5ddc79e + 3c8d22b commit 7e256a1

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

allnoconfig.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ def main():
3232
# accept 0/1/2, for n/m/y). The assignments will be ignored for other
3333
# symbol types, which is what we want.
3434
kconf.warn = False
35-
for sym in kconf.unique_defined_syms:
36-
sym.set_value(2 if sym.is_allnoconfig_y else 0)
37-
kconf.warn = True
35+
try:
36+
for sym in kconf.unique_defined_syms:
37+
sym.set_value(2 if sym.is_allnoconfig_y else 0)
38+
finally:
39+
kconf.warn = True
3840

3941
kconf.load_allconfig("allno.config")
4042

genconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def main():
138138
if args.env_list is not None:
139139
with _open_write(args.env_list) as f:
140140
for env_var in kconf.env_vars:
141-
f.write("{}={}\n".format(env_var, os.environ[env_var]))
141+
f.write("{}={}\n".format(env_var, os.environ.get(env_var, "")))
142142

143143

144144
def _open_write(path):

menuconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ def parse_color(color_def):
555555
color_def = color_def.split(":", 1)[1]
556556

557557
# HTML format, #RRGGBB
558-
if re.match("#[A-Fa-f0-9]{6}", color_def):
558+
if re.match("^#[A-Fa-f0-9]{6}$", color_def):
559559
return _color_from_rgb((
560560
int(color_def[1:3], 16),
561561
int(color_def[3:5], 16),

testsuite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def verify_equal(x, y):
8989

9090

9191
def run_tests():
92-
global obsessive, log
92+
global obsessive, obsessive_min_config, log
9393
for s in sys.argv[1:]:
9494
if s == "obsessive":
9595
obsessive = True
@@ -2379,7 +2379,7 @@ def verify_props(desc, props, prop_names):
23792379
verify_props("select", c.syms["MULTIDEF"].selects,
23802380
"AA BB CC DD EE FF GG HH II JJ")
23812381

2382-
verify_props("imply", c.syms["MULTIDEF"].selects,
2382+
verify_props("imply", c.syms["MULTIDEF"].implies,
23832383
"AA BB CC DD EE FF GG HH II JJ")
23842384

23852385
verify_props("select", c.syms["MULTIDEF_CHOICE"].selects,

0 commit comments

Comments
 (0)