|
20 | 20 | from tools.toolchains.arm import ARM_STD, ARM_MICRO, ARMC6
|
21 | 21 | from tools.toolchains.gcc import GCC_ARM
|
22 | 22 | from tools.toolchains.iar import IAR
|
23 |
| -from tools.toolchains.mbed_toolchain import UNSUPPORTED_C_LIB_EXECPTION_STRING |
| 23 | +from tools.toolchains.mbed_toolchain import UNSUPPORTED_C_LIB_EXCEPTION_STRING |
24 | 24 | from tools.utils import NotSupportedException
|
25 | 25 |
|
26 | 26 | class TestArmToolchain(TestCase):
|
@@ -69,31 +69,31 @@ def test_arm_default_lib(self):
|
69 | 69 | self.assertIn("--library_type=microlib", arm_c6_obj.flags["asm"])
|
70 | 70 |
|
71 | 71 | def test_arm_default_lib_std_exception(self):
|
72 |
| - """Test that exception raised when default_lib is std but supported_c_libs parameter arm is not suppoted std lib.""" |
| 72 | + """Test that an exception raised if the default_lib is std but it is not listed in supported_c_libs.""" |
73 | 73 | mock_target = mock.MagicMock()
|
74 | 74 | mock_target.core = "Cortex-M4"
|
75 | 75 | mock_target.supported_toolchains = ["ARM", "uARM", "ARMC5"]
|
76 | 76 | mock_target.default_toolchain = "ARM"
|
77 | 77 | mock_target.default_lib = "std"
|
78 | 78 | mock_target.supported_c_libs = {"arm": ["small"]}
|
79 |
| - with self.assertRaisesRegexp(NotSupportedException, UNSUPPORTED_C_LIB_EXECPTION_STRING.format(mock_target.default_lib)): |
| 79 | + with self.assertRaisesRegexp(NotSupportedException, UNSUPPORTED_C_LIB_EXCEPTION_STRING.format(mock_target.default_lib)): |
80 | 80 | ARM_STD(mock_target)
|
81 |
| - with self.assertRaisesRegexp(NotSupportedException, UNSUPPORTED_C_LIB_EXECPTION_STRING.format(mock_target.default_lib)): |
| 81 | + with self.assertRaisesRegexp(NotSupportedException, UNSUPPORTED_C_LIB_EXCEPTION_STRING.format(mock_target.default_lib)): |
82 | 82 | ARMC6(mock_target)
|
83 | 83 |
|
84 | 84 |
|
85 | 85 | def test_arm_default_lib_small_exception(self):
|
86 |
| - """Test that exception raised when default_lib is small but supported_c_libs parameter arm is not suppoted small lib.""" |
| 86 | + """Test that an exception raised if the default_lib is small but it is not listed in supported_c_libs.""" |
87 | 87 | mock_target = mock.MagicMock()
|
88 | 88 | mock_target.core = "Cortex-M4"
|
89 | 89 | mock_target.default_lib = "small"
|
90 | 90 | mock_target.supported_c_libs = {"arm": ["std"]}
|
91 | 91 | mock_target.default_toolchain = "ARM"
|
92 | 92 | mock_target.supported_toolchains = ["ARM", "uARM", "ARMC5"]
|
93 |
| - with self.assertRaisesRegexp(NotSupportedException, UNSUPPORTED_C_LIB_EXECPTION_STRING.format(mock_target.default_lib)): |
| 93 | + with self.assertRaisesRegexp(NotSupportedException, UNSUPPORTED_C_LIB_EXCEPTION_STRING.format(mock_target.default_lib)): |
94 | 94 | ARM_STD(mock_target)
|
95 | 95 | mock_target.default_toolchain = "ARMC6"
|
96 |
| - with self.assertRaisesRegexp(NotSupportedException, UNSUPPORTED_C_LIB_EXECPTION_STRING.format(mock_target.default_lib)): |
| 96 | + with self.assertRaisesRegexp(NotSupportedException, UNSUPPORTED_C_LIB_EXCEPTION_STRING.format(mock_target.default_lib)): |
97 | 97 | ARMC6(mock_target)
|
98 | 98 |
|
99 | 99 | class TestGccToolchain(TestCase):
|
@@ -141,24 +141,24 @@ def test_gcc_arm_default_lib(self):
|
141 | 141 | self.assertIn("--specs=nano.specs", gcc_arm_obj.flags["ld"])
|
142 | 142 |
|
143 | 143 | def test_gcc_arm_default_lib_std_exception(self):
|
144 |
| - """Test that exception raised when default_lib is std but supported_c_libs parameter arm is not suppoted std lib.""" |
| 144 | + """Test that an exception raised if the default_lib is std but it is not listed in supported_c_libs.""" |
145 | 145 | mock_target = mock.MagicMock()
|
146 | 146 | mock_target.core = "Cortex-M4"
|
147 | 147 | mock_target.default_toolchain = "ARM"
|
148 | 148 | mock_target.default_lib = "std"
|
149 | 149 | mock_target.supported_c_libs = {"arm": ["small"]}
|
150 |
| - with self.assertRaisesRegexp(NotSupportedException, UNSUPPORTED_C_LIB_EXECPTION_STRING.format(mock_target.default_lib)): |
| 150 | + with self.assertRaisesRegexp(NotSupportedException, UNSUPPORTED_C_LIB_EXCEPTION_STRING.format(mock_target.default_lib)): |
151 | 151 | GCC_ARM(mock_target)
|
152 | 152 |
|
153 | 153 | def test_gcc_arm_default_lib_small_exception(self):
|
154 |
| - """Test that exception raised when default_lib is small but supported_c_libs parameter arm is not suppoted small lib.""" |
| 154 | + """Test that an exception raised if the default_lib is small but it is not listed in supported_c_libs.""" |
155 | 155 | mock_target = mock.MagicMock()
|
156 | 156 | mock_target.core = "Cortex-M4"
|
157 | 157 | mock_target.default_lib = "small"
|
158 | 158 | mock_target.supported_c_libs = {"arm": ["std"]}
|
159 | 159 | mock_target.default_toolchain = "ARM"
|
160 | 160 | mock_target.supported_toolchains = ["ARM", "uARM", "ARMC5"]
|
161 |
| - with self.assertRaisesRegexp(NotSupportedException, UNSUPPORTED_C_LIB_EXECPTION_STRING.format(mock_target.default_lib)): |
| 161 | + with self.assertRaisesRegexp(NotSupportedException, UNSUPPORTED_C_LIB_EXCEPTION_STRING.format(mock_target.default_lib)): |
162 | 162 | GCC_ARM(mock_target)
|
163 | 163 |
|
164 | 164 | class TestIarToolchain(TestCase):
|
@@ -189,26 +189,26 @@ def test_iar_default_lib(self):
|
189 | 189 | try:
|
190 | 190 | IAR(mock_target)
|
191 | 191 | except NotSupportedException:
|
192 |
| - self.fail(UNSUPPORTED_C_LIB_EXECPTION_STRING.format(mock_target.default_lib)) |
| 192 | + self.fail(UNSUPPORTED_C_LIB_EXCEPTION_STRING.format(mock_target.default_lib)) |
193 | 193 |
|
194 | 194 | def test_iar_default_lib_std_exception(self):
|
195 |
| - """Test that exception raised when default_lib is small but supported_c_libs parameter iar is not supported small lib.""" |
| 195 | + """Test that an exception raised if the default_lib is std but it is not listed in supported_c_libs.""" |
196 | 196 | mock_target = mock.MagicMock()
|
197 | 197 | mock_target.core = "Cortex-M4"
|
198 | 198 | mock_target.microlib_supported = False
|
199 | 199 | mock_target.default_lib = "std"
|
200 | 200 | mock_target.supported_c_libs = {"iar": ["small"]}
|
201 | 201 | mock_target.supported_toolchains = ["IAR"]
|
202 |
| - with self.assertRaisesRegexp(NotSupportedException, UNSUPPORTED_C_LIB_EXECPTION_STRING.format(mock_target.default_lib)): |
| 202 | + with self.assertRaisesRegexp(NotSupportedException, UNSUPPORTED_C_LIB_EXCEPTION_STRING.format(mock_target.default_lib)): |
203 | 203 | IAR(mock_target)
|
204 | 204 |
|
205 | 205 | def test_iar_default_lib_small_exception(self):
|
206 |
| - """Test that exception raised when default_lib is small but supported_c_libs parameter iar is not supported small lib.""" |
| 206 | + """Test that an exception raised if the default_lib is small but it is not listed in supported_c_libs.""" |
207 | 207 | mock_target = mock.MagicMock()
|
208 | 208 | mock_target.core = "Cortex-M4"
|
209 | 209 | mock_target.microlib_supported = False
|
210 | 210 | mock_target.default_lib = "small"
|
211 | 211 | mock_target.supported_c_libs = {"iar": ["std"]}
|
212 | 212 | mock_target.supported_toolchains = ["IAR"]
|
213 |
| - with self.assertRaisesRegexp(NotSupportedException, UNSUPPORTED_C_LIB_EXECPTION_STRING.format(mock_target.default_lib)): |
| 213 | + with self.assertRaisesRegexp(NotSupportedException, UNSUPPORTED_C_LIB_EXCEPTION_STRING.format(mock_target.default_lib)): |
214 | 214 | IAR(mock_target)
|
0 commit comments