author | morphbr |
Fri Jun 01 13:48:21 2007 +0100 (2007-06-01) | |
branch | trunk |
changeset 736 | 1bc4c47e4ad8 |
parent 597 | 945d3f5da6fc |
permissions | -rwxr-xr-x |
1 #!/usr/bin/python
3 #doc: dummy test that relinks all test programs. Should be the first to run
5 from testing_tools import relink_name
6 import sys
7 import os
8 import popen2
9 import signal
10 import time
12 def relink_all():
13 for i in os.listdir('.'):
14 p = os.popen('file ' + i)
15 d = p.read()
16 p.close()
17 if 'shell script' in d:
18 relink(i)
20 def relink(exe):
21 rname = relink_name(exe)
22 if not os.path.exists(rname):
23 p = popen2.Popen3('./' + exe, capturestderr = True)
24 time.sleep(1)
25 os.kill(p.pid, signal.SIGKILL)
26 p.wait()
27 print "Name of the relinked executable script: %s" % rname
28 #assert os.path.exists(rname)
30 relink_all()
31 sys.exit(0)