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