migen/test: if SimCase is a TestCase, it's run in every module that imports it
authorRobert Jordens <jordens@gmail.com>
Sat, 30 Nov 2013 13:51:24 +0000 (06:51 -0700)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Mon, 2 Dec 2013 11:43:14 +0000 (12:43 +0100)
migen/test/support.py
migen/test/test_coding.py
migen/test/test_fifo.py

index 913462acdd677ae4e608cced2c4cbcee03d9ce5c..e99cfb2c4cf7141f893d7c6fe6db2f76b9dbbb7d 100644 (file)
@@ -9,7 +9,7 @@ class SimBench(Module):
                if self.callback is not None:
                        return self.callback(self, s)
 
-class SimCase(unittest.TestCase):
+class SimCase:
        TestBench = SimBench
 
        def setUp(self, *args, **kwargs):
index de0980500db89159fca072ed9c0e63d248ee3280..2d0f53d9d1d491a689456526260d55d324bcee11 100644 (file)
@@ -5,7 +5,7 @@ from migen.genlib.coding import *
 
 from migen.test.support import SimCase, SimBench
 
-class EncCase(SimCase):
+class EncCase(SimCase, unittest.TestCase):
        class TestBench(SimBench):
                def __init__(self):
                        self.submodules.dut = Encoder(8)
@@ -29,7 +29,7 @@ class EncCase(SimCase):
                                self.assertEqual(i, 1<<o)
                self.run_with(cb, 256)
 
-class PrioEncCase(SimCase):
+class PrioEncCase(SimCase, unittest.TestCase):
        class TestBench(SimBench):
                def __init__(self):
                        self.submodules.dut = PriorityEncoder(8)
@@ -55,7 +55,7 @@ class PrioEncCase(SimCase):
                                self.assertGreaterEqual(i, 1<<o)
                self.run_with(cb, 256)
 
-class DecCase(SimCase):
+class DecCase(SimCase, unittest.TestCase):
        class TestBench(SimBench):
                def __init__(self):
                        self.submodules.dut = Decoder(8)
index c66f8d5dad96bd25dd4a0de8f0b445f392b8887b..f9b789d51bc98bbabdf11e719c214870f5c0425d 100644 (file)
@@ -5,7 +5,7 @@ from migen.genlib.fifo import SyncFIFO, AsyncFIFO
 
 from migen.test.support import SimCase, SimBench
 
-class SyncFIFOCase(SimCase):
+class SyncFIFOCase(SimCase, unittest.TestCase):
        class TestBench(SimBench):
                def __init__(self):
                        self.submodules.dut = SyncFIFO([("a", 32), ("b", 32)], 2)