|
|
@ -48,30 +48,30 @@ plugins = sorted(glob.glob('tools/buildgen/plugins/*.py')) |
|
|
|
|
|
|
|
|
|
|
|
jobs = [] |
|
|
|
jobs = [] |
|
|
|
for root, dirs, files in os.walk('templates'): |
|
|
|
for root, dirs, files in os.walk('templates'): |
|
|
|
for f in files: |
|
|
|
for f in files: |
|
|
|
if os.path.splitext(f)[1] == '.template': |
|
|
|
if os.path.splitext(f)[1] == '.template': |
|
|
|
out = '.' + root[len('templates'):] + '/' + os.path.splitext(f)[0] |
|
|
|
out = '.' + root[len('templates'):] + '/' + os.path.splitext(f)[0] |
|
|
|
cmd = ['tools/buildgen/mako_renderer.py'] |
|
|
|
cmd = ['tools/buildgen/mako_renderer.py'] |
|
|
|
for plugin in plugins: |
|
|
|
for plugin in plugins: |
|
|
|
cmd.append('-p') |
|
|
|
cmd.append('-p') |
|
|
|
cmd.append(plugin) |
|
|
|
cmd.append(plugin) |
|
|
|
for js in json: |
|
|
|
for js in json: |
|
|
|
cmd.append('-d') |
|
|
|
cmd.append('-d') |
|
|
|
cmd.append(js) |
|
|
|
cmd.append(js) |
|
|
|
cmd.append('-o') |
|
|
|
cmd.append('-o') |
|
|
|
if test is None: |
|
|
|
if test is None: |
|
|
|
cmd.append(out) |
|
|
|
cmd.append(out) |
|
|
|
else: |
|
|
|
else: |
|
|
|
tf = tempfile.mkstemp() |
|
|
|
tf = tempfile.mkstemp() |
|
|
|
test[out] = tf[1] |
|
|
|
test[out] = tf[1] |
|
|
|
os.close(tf[0]) |
|
|
|
os.close(tf[0]) |
|
|
|
cmd.append(test[out]) |
|
|
|
cmd.append(test[out]) |
|
|
|
cmd.append(root + '/' + f) |
|
|
|
cmd.append(root + '/' + f) |
|
|
|
jobs.append(jobset.JobSpec(cmd, shortname=out)) |
|
|
|
jobs.append(jobset.JobSpec(cmd, shortname=out)) |
|
|
|
|
|
|
|
|
|
|
|
jobset.run(jobs) |
|
|
|
jobset.run(jobs) |
|
|
|
|
|
|
|
|
|
|
|
if test is not None: |
|
|
|
if test is not None: |
|
|
|
for s, g in test.iteritems(): |
|
|
|
for s, g in test.iteritems(): |
|
|
|
assert(0 == os.system('diff %s %s' % (s, g))) |
|
|
|
assert(0 == os.system('diff %s %s' % (s, g))) |
|
|
|
os.unlink(g) |
|
|
|
os.unlink(g) |
|
|
|