Skip to content

Commit 8c17a31

Browse files
committed
Test IAR version check
1 parent c174ca3 commit 8c17a31

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tools/test/toolchains/api_test.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
ALPHABET = [char for char in printable if char not in [u'.', u'/', u'\\']]
2020

21+
2122
@patch('tools.toolchains.arm.run_cmd')
2223
def test_arm_version_check(_run_cmd):
2324
_run_cmd.return_value = ("""
@@ -37,6 +38,28 @@ def test_arm_version_check(_run_cmd):
3738
toolchain.version_check()
3839
assert len(notifier.messages) == 1
3940

41+
42+
@patch('tools.toolchains.iar.run_cmd')
43+
def test_iar_version_check(_run_cmd):
44+
_run_cmd.return_value = ("""
45+
IAR ANSI C/C++ Compiler V7.80.1.28/LNX for ARM
46+
""", "", 0)
47+
notifier = MockNotifier()
48+
toolchain = TOOLCHAIN_CLASSES["IAR"](TARGET_MAP["K64F"], notify=notifier)
49+
toolchain.version_check()
50+
assert notifier.messages == []
51+
_run_cmd.return_value = ("""
52+
IAR ANSI C/C++ Compiler V/LNX for ARM
53+
""", "", 0)
54+
toolchain.version_check()
55+
assert len(notifier.messages) == 1
56+
_run_cmd.return_value = ("""
57+
IAR ANSI C/C++ Compiler V/8.80LNX for ARM
58+
""", "", 0)
59+
toolchain.version_check()
60+
assert len(notifier.messages) == 2
61+
62+
4063
@given(fixed_dictionaries({
4164
'common': lists(text()),
4265
'c': lists(text()),

0 commit comments

Comments
 (0)