File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 18
18
19
19
ALPHABET = [char for char in printable if char not in [u'.' , u'/' , u'\\ ' ]]
20
20
21
+ @patch ('tools.toolchains.arm.run_cmd' )
22
+ def test_arm_version_check (_run_cmd ):
23
+ _run_cmd .return_value = ("""
24
+ Product: ARM Compiler 5.06
25
+ Component: ARM Compiler 5.06 update 5 (build 528)
26
+ Tool: armcc [4d3621]
27
+ """ , "" , 0 )
28
+ notifier = MockNotifier ()
29
+ toolchain = TOOLCHAIN_CLASSES ["ARM" ](TARGET_MAP ["K64F" ], notify = notifier )
30
+ toolchain .version_check ()
31
+ assert notifier .messages == []
32
+ _run_cmd .return_value = ("""
33
+ Product: ARM Compiler
34
+ Component: ARM Compiler
35
+ Tool: armcc [4d3621]
36
+ """ , "" , 0 )
37
+ toolchain .version_check ()
38
+ assert len (notifier .messages ) == 1
39
+
21
40
@given (fixed_dictionaries ({
22
41
'common' : lists (text ()),
23
42
'c' : lists (text ()),
Original file line number Diff line number Diff line change @@ -99,8 +99,8 @@ def version_check(self):
99
99
msg = None
100
100
min_ver , max_ver = self .ARMCC_RANGE
101
101
match = self .ARMCC_VERSION_RE .search (stdout )
102
- found_version = LooseVersion (match .group (0 )) if match else None
103
- min_ver , max_ver = self .ARM_RANGE
102
+ found_version = LooseVersion (match .group (1 )) if match else None
103
+ min_ver , max_ver = self .ARMCC_RANGE
104
104
if found_version and (found_version < min_ver or found_version >= max_ver ):
105
105
msg = ("Compiler version mismatch: Have {}; "
106
106
"expected version >= {} and < {}"
You can’t perform that action at this time.
0 commit comments