Skip to content

Commit

Permalink
test: add unittest for core device watchdog
Browse files Browse the repository at this point in the history
sbourdeauducq committed May 1, 2015
1 parent 4d31194 commit 1684586
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions artiq/test/full_stack.py
Original file line number Diff line number Diff line change
@@ -181,6 +181,9 @@ def run(self):


class _RPCExceptions(AutoDB):
class DBKeys:
core = Device()

def build(self):
self.success = False

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


class _Watchdog(AutoDB):
class DBKeys:
core = Device()

@kernel
def run(self):
with watchdog(50*ms):
while True:
pass


@unittest.skipUnless(core_device, "no hardware")
class ExecutionCase(unittest.TestCase):
def test_primes(self):
@@ -259,6 +273,10 @@ def test_rpc_exceptions(self):
finally:
comm.close()

def test_watchdog(self):
with self.assertRaises(IOError):
_run_on_device(_Watchdog)


class _RTIOLoopback(AutoDB):
class DBKeys:

0 comments on commit 1684586

Please sign in to comment.