# XXX bad practice: use of global variables
from soc.fu.cr.test.test_pipe_caller import get_cu_inputs
from soc.fu.cr.test.test_pipe_caller import CRTestCase
-from soc.fu.cr.test.test_pipe_caller import test_data
from soc.fu.compunits.compunits import CRFunctionUnit
from soc.fu.compunits.test.test_compunit import TestRunner
if __name__ == "__main__":
unittest.main(exit=False)
suite = unittest.TestSuite()
- suite.addTest(CRTestRunner(test_data))
+ suite.addTest(CRTestRunner(CRTestCase.test_data))
runner = unittest.TextTestRunner()
runner.run(suite)
# massively. Before, it took around 1 minute on my computer, now it
# takes around 3 seconds
-test_data = []
-
class CRTestCase(FHDLTestCase):
+ test_data = []
def __init__(self, name):
super().__init__(name)
self.test_name = name
initial_cr=0):
tc = TestCase(prog, self.test_name,
regs=initial_regs, sprs=initial_sprs, cr=initial_cr)
- test_data.append(tc)
+ self.test_data.append(tc)
def test_crop(self):
insns = ["crand", "cror", "crnand", "crnor", "crxor", "creqv",
if __name__ == "__main__":
unittest.main(exit=False)
suite = unittest.TestSuite()
- suite.addTest(TestRunner(test_data))
+ suite.addTest(TestRunner(CRTestCase.test_data))
runner = unittest.TextTestRunner()
runner.run(suite)
from soc.experiment.compalu_multi import find_ok # hack
# test with ALU data and Logical data
-from soc.fu.alu.test.test_pipe_caller import TestCase, ALUTestCase
+from soc.fu.alu.test.test_pipe_caller import ALUTestCase
from soc.fu.logical.test.test_pipe_caller import LogicalTestCase
from soc.fu.shift_rot.test.test_pipe_caller import ShiftRotTestCase
+from soc.fu.cr.test.test_pipe_caller import CRTestCase
def set_cu_input(cu, idx, data):
if __name__ == "__main__":
unittest.main(exit=False)
suite = unittest.TestSuite()
+ suite.addTest(TestRunner(CRTestCase.test_data))
suite.addTest(TestRunner(ShiftRotTestCase.test_data))
suite.addTest(TestRunner(LogicalTestCase.test_data))
suite.addTest(TestRunner(ALUTestCase.test_data))