3
# loading an environment
7
pexec = Runner.exec_command
9
Params.set_trace(0, 0, 0)
14
bld.set_bdir('_build_')
16
from Common import dummy
44
def runscript(scriptname):
45
# clean before building
46
pexec('rm -rf runtest/ && mkdir -p runtest/src/')
49
dest = open('./runtest/sconstruct', 'w')
50
dest.write(sconstruct_x)
53
dest = open('./runtest/src/sconscript', 'w')
54
dest.write(scriptname)
57
dest = open('./runtest/src/dummy.h', 'w')
61
# now that the files are there, run the app
62
Params.set_trace(0,0,0)
74
Params.set_trace(1,1,1)
78
#t=runscript(sconscript_1)
79
#print "* posting 1000 objects ",t," seconds (1000 times the same)"
80
#t=runscript(sconscript_2)
81
#print "* posting 10000 objects ",t," seconds (10000 times the same)"
84
def runscript2(scriptname, howmany):
85
# clean before building
86
pexec('rm -rf runtest/ && mkdir -p runtest/src/')
88
sc = open('./runtest/sconstruct', 'w')
91
bld.set_bdir('_build_')
96
if i<1: sc.write('src'+str(i))
97
else: sc.write(' src'+str(i))
101
from Common import dummy
106
sc.write('add_subdir("src'+str(i)+'")\n')
111
#Params.set_trace(0,0,0)""")
117
pexec('mkdir -p runtest/src'+str(i))
119
dest = open('./runtest/src'+str(i)+'/sconscript', 'w')
120
dest.write(scriptname)
123
dest = open('./runtest/src'+str(i)+'/dummy.h', 'w')
124
dest.write('content')
128
# now that the files are there, run the app
130
#Params.set_trace(0,0,0)
134
sys.path.append('..')
147
runscript2(sconscript_0, val)
149
print "* posted %d objects in %.2f seconds (%d different ones)" % (val, t, val)
155
print "* posted %d objects in %.2f seconds (%d different ones, second run)" % (val, t, val)
159
print "* posted %d objects in %.2f seconds (%d different ones, third run)" % (val, t, val)
163
info("stress test end")
164
#pexec('rm -rf runtest/')