@@ -60,6 +60,37 @@ def test_iar_version_check(_run_cmd):
60
60
assert len (notifier .messages ) == 2
61
61
62
62
63
+ @patch ('tools.toolchains.gcc.run_cmd' )
64
+ def test_gcc_version_check (_run_cmd ):
65
+ _run_cmd .return_value = ("""
66
+ arm-none-eabi-gcc (Arch Repository) 6.4.4
67
+ Copyright (C) 2018 Free Software Foundation, Inc.
68
+ This is free software; see the source for copying conditions. There is NO
69
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
70
+ """ , "" , 0 )
71
+ notifier = MockNotifier ()
72
+ toolchain = TOOLCHAIN_CLASSES ["GCC_ARM" ](
73
+ TARGET_MAP ["K64F" ], notify = notifier )
74
+ toolchain .version_check ()
75
+ assert notifier .messages == []
76
+ _run_cmd .return_value = ("""
77
+ arm-none-eabi-gcc (Arch Repository) 8.1.0
78
+ Copyright (C) 2018 Free Software Foundation, Inc.
79
+ This is free software; see the source for copying conditions. There is NO
80
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
81
+ """ , "" , 0 )
82
+ toolchain .version_check ()
83
+ assert len (notifier .messages ) == 1
84
+ _run_cmd .return_value = ("""
85
+ arm-none-eabi-gcc (Arch Repository)
86
+ Copyright (C) 2018 Free Software Foundation, Inc.
87
+ This is free software; see the source for copying conditions. There is NO
88
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
89
+ """ , "" , 0 )
90
+ toolchain .version_check ()
91
+ assert len (notifier .messages ) == 2
92
+
93
+
63
94
@given (fixed_dictionaries ({
64
95
'common' : lists (text ()),
65
96
'c' : lists (text ()),
0 commit comments