Debian Codegraph @

tests/riscv-official/code/selftesting.py

raw
1 import testing as ts
2 import constants as cn
3
4 def self_test(sim_bin, params, src_path, tests):
5 sh_pass = []
6 sh_fail = []
7 error = []
8 for test in tests:
9 test_res, test_reg_dump = ts.check_reg_dump(
10 ts.run_test(sim_bin, params, src_path + cn.SELF_ELF_PATH+"/", test))
11 if (test_res == 1 and str(test).__contains__("fail")):
12 sh_fail.append(test)
13 if (test_res == 0 and str(test).__contains__("pass")):
14 sh_pass.append(test)
15 if(test_res == 2):
16 error.append(test)
17 print("Test passed but was expected to fail:{0}".format(sh_fail))
18 print("Test failed but was expected to pass:{0}".format(sh_pass))
19 print("Test ended in error :{0}\n".format(error))