from openpower.test.shift_rot.shift_rot_cases import ShiftRotTestCase
from openpower.test.cr.cr_cases import CRTestCase
from openpower.test.branch.branch_cases import BranchTestCase
-# from soc.fu.spr.test.test_pipe_caller import SPRTestCase
+from soc.fu.spr.test.test_pipe_caller import SPRTestCase
from openpower.test.ldst.ldst_cases import LDSTTestCase
from openpower.simulator.test_sim import (GeneralTestCases, AttnTestCase)
-# from openpower.simulator.test_helloworld_sim import HelloTestCases
+from openpower.simulator.test_helloworld_sim import HelloTestCases
if __name__ == "__main__":
svp64 = False
sys.argv.pop()
- print ("SVP64 test mode enabled", svp64)
+ # allow list of testing to be selected by command-line
+ testing = sys.argv[1:]
+ sys.argv = sys.argv[:1]
+
+ if not testing:
+ testing = ['general', 'ldst', 'cr', 'shiftrot', 'logical', 'alu',
+ 'branch', 'div']
+
+ print ("SVP64 test mode enabled", svp64, testing)
unittest.main(exit=False)
suite = unittest.TestSuite()
- # suite.addTest(TestRunner(HelloTestCases.test_data, svp64=svp64))
- suite.addTest(TestRunner(DivTestCases().test_data, svp64=svp64))
- # suite.addTest(TestRunner(AttnTestCase.test_data, svp64=svp64))
- suite.addTest(TestRunner(GeneralTestCases.test_data, svp64=svp64))
- suite.addTest(TestRunner(LDSTTestCase().test_data, svp64=svp64))
- suite.addTest(TestRunner(CRTestCase().test_data, svp64=svp64))
- suite.addTest(TestRunner(ShiftRotTestCase().test_data, svp64=svp64))
- suite.addTest(TestRunner(LogicalTestCase().test_data, svp64=svp64))
- suite.addTest(TestRunner(ALUTestCase().test_data, svp64=svp64))
- suite.addTest(TestRunner(BranchTestCase().test_data, svp64=svp64))
- # suite.addTest(TestRunner(SPRTestCase.test_data, svp64=svp64))
+
+ # dictionary of data for tests
+ tests = {'hello': HelloTestCases.test_data,
+ 'div': DivTestCases().test_data,
+ 'attn': AttnTestCase.test_data,
+ 'general': GeneralTestCases.test_data,
+ 'ldst': LDSTTestCase().test_data,
+ 'cr': CRTestCase().test_data,
+ 'shiftrot': ShiftRotTestCase().test_data,
+ 'logical': LogicalTestCase().test_data,
+ 'alu': ALUTestCase().test_data,
+ 'branch': BranchTestCase().test_data,
+ 'spr': SPRTestCase().test_data
+ }
+
+ # walk through all tests, those requested get added
+ for tname, data in tests.items():
+ if tname in testing:
+ suite.addTest(TestRunner(data, svp64=svp64))
runner = unittest.TextTestRunner()
runner.run(suite)