Skip to content

Commit 1684586

Browse files
committedMay 1, 2015
test: add unittest for core device watchdog
1 parent 4d31194 commit 1684586

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
 

Diff for: ‎artiq/test/full_stack.py

+18
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ def run(self):
181181

182182

183183
class _RPCExceptions(AutoDB):
184+
class DBKeys:
185+
core = Device()
186+
184187
def build(self):
185188
self.success = False
186189

@@ -199,6 +202,17 @@ def catch(self):
199202
self.success = True
200203

201204

205+
class _Watchdog(AutoDB):
206+
class DBKeys:
207+
core = Device()
208+
209+
@kernel
210+
def run(self):
211+
with watchdog(50*ms):
212+
while True:
213+
pass
214+
215+
202216
@unittest.skipUnless(core_device, "no hardware")
203217
class ExecutionCase(unittest.TestCase):
204218
def test_primes(self):
@@ -259,6 +273,10 @@ def test_rpc_exceptions(self):
259273
finally:
260274
comm.close()
261275

276+
def test_watchdog(self):
277+
with self.assertRaises(IOError):
278+
_run_on_device(_Watchdog)
279+
262280

263281
class _RTIOLoopback(AutoDB):
264282
class DBKeys:

0 commit comments

Comments
 (0)
Please sign in to comment.