01_Exception.py 945 B

12345678910111213141516171819202122
  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. rv = regression.run_checks()
  15. if rv: sys.exit(rv)