01_Exception.py 968 B

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