From 465d7c66fbe88d27571da78e7972552e5765cde9 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 31 Jul 2014 20:35:40 -0400 Subject: [PATCH] Have update_results.py run OpenMC twice when generating results for test_source_file. Closes #288 on github. --- tests/update_results.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/update_results.py b/tests/update_results.py index c9c0be85dc..64d72d3f27 100755 --- a/tests/update_results.py +++ b/tests/update_results.py @@ -56,6 +56,20 @@ for adir in sorted(folders): for i in range(35 - sz): print('.', end="") + if adir == 'test_source_file': + # Handle source file test separately since it requires running OpenMC + # twice + if os.path.exists('results_error.dat'): + os.remove('results_error.dat') + proc = Popen(['python', 'test_source_file.py', '--exe', openmc_exe], + stderr=STDOUT, stdout=PIPE) + returncode = proc.wait() + if os.path.exists('results_error.dat'): + os.rename('results_error.dat', 'results_true.dat') + print(BOLD + OKGREEN + "[OK]" + ENDC) + os.chdir('..') + continue + # Run openmc proc = Popen([openmc_exe], stderr=STDOUT, stdout=PIPE) returncode = proc.wait()