diff --git a/.gitignore b/.gitignore index 4f3aa9f..766b823 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ *.pyc testcases.html +doc_footer.html +doc_header.html +*.swp diff --git a/pbs2slurm_tests.py b/pbs2slurm_tests.py index 72ae2e8..6abbef0 100644 --- a/pbs2slurm_tests.py +++ b/pbs2slurm_tests.py @@ -8,14 +8,12 @@ html = open("testcases.html", "w") - def html_out(fh, ok, pbs, slurm, desc): pbss = pbs.replace(">", ">").replace("<", "<") slurms = slurm.replace(">", ">").replace("<", "<") fh.write(""" - {desc} - {ok} - + {desc}{ok} +
{pbss}
@@ -25,49 +23,20 @@ def html_out(fh, ok, pbs, slurm, desc): """.format(**locals())) def html_header(fh): - fh.write(""" - -pbs2slurm test cases - - - + fh.write("""
- - - +
PBS script
+ """) -def html_footer(fh): - fh.write(""" -
PBS script SLURM script
-
- -""") - fh.close() - html_header(html) -atexit.register(html_footer, html) def check(input, exp, obs, desc): if exp != obs: - pf = """

FAIL

""" + pf = """FAIL""" html_out(html, pf, input, exp, desc) d = difflib.Differ() sys.stdout.writelines(d.compare( @@ -75,7 +44,7 @@ def check(input, exp, obs, desc): obs.splitlines(1))) assert False else: - pf = """

OK

""" + pf = """OK""" html_out(html, pf, input, exp, desc)