Mark Slee | 5299a95 | 2007-10-05 00:13:24 +0000 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | import subprocess |
| 4 | import sys |
| 5 | import os |
| 6 | import signal |
| 7 | |
David Reiss | 2a4bfd6 | 2008-04-07 23:45:00 +0000 | [diff] [blame^] | 8 | def relfile(fname): |
| 9 | return os.path.join(os.path.dirname(__file__), fname) |
| 10 | |
| 11 | serverproc = subprocess.Popen([sys.executable, relfile("TestServer.py")]) |
Mark Slee | 5299a95 | 2007-10-05 00:13:24 +0000 | [diff] [blame] | 12 | try: |
David Reiss | 0c90f6f | 2008-02-06 22:18:40 +0000 | [diff] [blame] | 13 | |
David Reiss | 2a4bfd6 | 2008-04-07 23:45:00 +0000 | [diff] [blame^] | 14 | ret = subprocess.call([sys.executable, relfile("TestClient.py")]) |
Mark Slee | 5299a95 | 2007-10-05 00:13:24 +0000 | [diff] [blame] | 15 | if ret != 0: |
| 16 | raise Exception("subprocess failed") |
| 17 | finally: |
| 18 | # fixme: should check that server didn't die |
| 19 | os.kill(serverproc.pid, signal.SIGKILL) |