mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
updated test cases to work with MPI and HDF5, all run from run_tests script
This commit is contained in:
parent
1ba465b4fc
commit
f22adabf15
130 changed files with 1447 additions and 496 deletions
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
from subprocess import Popen, STDOUT, PIPE
|
||||
from subprocess import Popen, STDOUT, PIPE, call
|
||||
import filecmp
|
||||
from nose_mpi import NoseMPI
|
||||
import glob
|
||||
|
|
@ -24,21 +24,21 @@ def test_run():
|
|||
assert returncode == 0
|
||||
|
||||
def test_created_statepoint():
|
||||
statepoint = glob.glob('statepoint.10.*')
|
||||
statepoint = glob.glob(pwd + '/statepoint.10.*')
|
||||
assert len(statepoint) == 1
|
||||
assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5')
|
||||
|
||||
def test_results():
|
||||
statepoint = glob.glob('statepoint.10.*')
|
||||
os.system('python results.py {0}'.format(statepoint[0]))
|
||||
statepoint = glob.glob(pwd + '/statepoint.10.*')
|
||||
call(['python', 'results.py', statepoint[0]])
|
||||
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
|
||||
if not compare:
|
||||
os.rename('results_test.dat', 'results_error.dat')
|
||||
assert compare
|
||||
|
||||
def teardown():
|
||||
statepoint = glob.glob('statepoint.10.*')
|
||||
output = [pwd + '/{0}'.format(statepoint[0]), pwd + '/results_test.dat']
|
||||
output = glob.glob(pwd + '/statepoint.10.*')
|
||||
output.append(pwd + '/results_test.dat')
|
||||
for f in output:
|
||||
if os.path.exists(f):
|
||||
os.remove(f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue