123456789101112131415161718192021222324252627282930 |
- #!/usr/bin/python
- import os, sys, mmap
- from regression import Regression
- loader = '../src/pal'
- regression = Regression(loader, "SendHandle")
- def check_times(target, lines, times):
- count = 0
- for line in lines:
- if target == line:
- count += 1
- return count == times
- regression.add_check(name="Send and Receive Handles across Processes",
- check=lambda res: check_times("Send Handle OK", res[0].log, 3) and
- check_times("Receive Handle OK", res[0].log, 3))
- regression.add_check(name="Send Pipe Handle",
- check=lambda res: check_times("Receive Pipe Handle: Hello World", res[0].log, 1))
- regression.add_check(name="Send Socket Handle",
- check=lambda res: check_times("Receive Socket Handle: Hello World", res[0].log, 1))
- regression.add_check(name="Send File Handle",
- check=lambda res: check_times("Receive File Handle: Hello World", res[0].log, 1))
- regression.run_checks()
|