Skip to content
Snippets Groups Projects
Commit 50916857 authored by Karl-Hermann Wieners's avatar Karl-Hermann Wieners
Browse files

mkexp: add list of removed jobs to template namespace

parent c604d6df
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@ Config
------
* Add option to allow scripts to be non-executable
* Add list of removed jobs to template namespace
Tools
-----
......
......@@ -572,6 +572,7 @@ for subjob, subconfig in jobs_config.items():
var_format = job_config['JOB'].get('.var_format', '${%s}')
var_list = set()
job_config['jobs'] = {}
job_config['jobs']['.remove'] = (remove_list[1:] if remove_list else [])
job_config['jobs'].merge(expconfig.odict(jobs_config))
expconfig.merge_comments(job_config['jobs'], jobs_config)
job_config.walk(format_vars, log=var_list, fmt=var_format)
......
......@@ -1723,6 +1723,38 @@ class JobSiblingsTestCase(MkexpSimpleTestCase):
result = align(result)
self.assertMultiLineEqual(expected, result)
class DisabledJobsTestCase(MkexpSimpleTestCase):
def test_removed_job_in_template(self):
writeconfig(self.exp_id, u"""
[jobs]
.remove = job1
[[job1]]
[[job2]]
""")
writetemplate(self.exp_id, 'job2', u"""
#% for job in jobs.sections:
%{job}
#% endfor
---
#% for job in jobs.sections:
#% if job is not in jobs['.remove']:
%{job}
#% endif
#% endfor
""")
expected = align(u"""
job1
job2
---
job2
""")
ignore = output(script("mkexp "+self.exp_id+".config"))
result = readfile(join("test", "experiments", self.exp_id,
self.exp_id+".job2"))
result = align(result)
self.assertMultiLineEqual(expected, result)
class NativeVariableTestCase(MkexpSimpleTestCase):
def test_var_statement(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment