01_Exception.py 1.0 KB

12345678910111213141516171819202122232425
  1. import os, sys, mmap
  2. from regression import Regression
  3. loader = os.environ['PAL_LOADER']
  4. regression = Regression(loader, "Exception")
  5. regression.add_check(name="Exception Handling (Div-by-Zero)",
  6. check=lambda res: any([line.startswith("Arithmetic Exception Handler") for line in res[0].log]))
  7. regression.add_check(name="Exception Handling (Memory Fault)",
  8. check=lambda res: any([line.startswith("Memory Fault Exception Handler") for line in res[0].log]))
  9. regression.add_check(name="Exception Handler Swap",
  10. check=lambda res: any([line.startswith("Arithmetic Exception Handler 1") for line in res[0].log]) and
  11. any([line.startswith("Arithmetic Exception Handler 2") for line in res[0].log]))
  12. regression.add_check(name="Exception Handling (Set Context)",
  13. check=lambda res: any([line.startswith("Arithmetic Exception Handler 1") for line in res[0].log]))
  14. regression.add_check(name="Exception Handling (Red zone)",
  15. check=lambda res: "Red zone test ok." in res[0].log)
  16. rv = regression.run_checks()
  17. if rv: sys.exit(rv)