projects
/
soc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f7bd9cf
)
add common test base class for "accumulating" tests to run
author
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Sun, 26 Jul 2020 09:31:49 +0000
(10:31 +0100)
committer
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Sun, 26 Jul 2020 09:31:49 +0000
(10:31 +0100)
src/soc/fu/test/common.py
patch
|
blob
|
history
diff --git
a/src/soc/fu/test/common.py
b/src/soc/fu/test/common.py
index ce4f21fe3368eebd3f66e201faddab92a97db653..c7f87dd9597dc2f9764127105ec494ac3866331a 100644
(file)
--- a/
src/soc/fu/test/common.py
+++ b/
src/soc/fu/test/common.py
@@
-7,6
+7,17
@@
from soc.decoder.power_enums import XER_bits, CryIn, spr_dict
from soc.regfile.util import fast_reg_to_spr # HACK!
from soc.regfile.regfiles import FastRegs
from soc.regfile.util import fast_reg_to_spr # HACK!
from soc.regfile.regfiles import FastRegs
+class TestAccumulatorBase:
+
+ def __init__(self):
+ self.test_data = []
+ # automatically identifies anything starting with "case_" and
+ # runs it. very similar to unittest auto-identification except
+ # we need a different system
+ for n, v in self.__class__.__dict__.items():
+ if n.startswith("case_") and callable(v):
+ v(self)
+
class TestCase:
def __init__(self, program, name, regs=None, sprs=None, cr=0, mem=None,
class TestCase:
def __init__(self, program, name, regs=None, sprs=None, cr=0, mem=None,