02_Thread.py 827 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, "Thread")
  6. regression.add_check(name="Thread Creation",
  7. check=lambda res: "Child Thread Created" in res[0].log and
  8. "Run in Child Thread: Hello World" in res[0].log)
  9. regression.add_check(name="Multiple Threads Run in Parallel",
  10. check=lambda res: "Threads Run in Parallel OK" in res[0].log)
  11. regression.add_check(name="Set Thread Private Segment Register",
  12. check=lambda res: "Private Message (FS Segment) 1: Hello World 1" in res[0].log and
  13. "Private Message (FS Segment) 2: Hello World 2" in res[0].log)
  14. regression.add_check(name="Thread Exit",
  15. check=lambda res: "Child Thread Exited" in res[0].log)
  16. regression.run_checks()