01_Exception.py 943 B

1234567891011121314151617181920212223
  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. regression.run_checks()