Skip CMFD tests rather than excluding them.

This commit is contained in:
Paul Romano 2013-09-02 20:13:53 -04:00
parent c40b22fab1
commit a8f6d194f8
3 changed files with 41 additions and 14 deletions

View file

@ -28,7 +28,7 @@ def run_compile():
results.append(('compile', result))
def run_suite(name=None, mpi=False, cmfd=True):
def run_suite(name=None, mpi=False):
print('-'*(len(name) + 6))
print(name + ' tests')
print('-'*(len(name) + 6))
@ -44,10 +44,6 @@ def run_suite(name=None, mpi=False, cmfd=True):
else:
plugins = None
# Exclude CMFD
if not cmfd:
argv += ['--exclude', 'cmfd']
try:
os.chdir(pwd)
os.rename(pwd + '/../src/openmc-' + name, pwd + '/../src/openmc')
@ -81,11 +77,9 @@ for name in tests:
if name == 'compile':
run_compile()
elif name in ['gfortran', 'gfortran-dbg', 'gfortran-opt', 'gfortran-hdf5']:
run_suite(name=name, cmfd=False)
elif name in ['gfortran-mpi', 'gfortran-phdf5']:
run_suite(name=name, mpi=True, cmfd=False)
elif name in ['gfortran-petsc', 'gfortran-phdf5-petsc',
'gfortran-phdf5-petsc-opt']:
run_suite(name=name)
elif name in ['gfortran-mpi', 'gfortran-phdf5', 'gfortran-petsc',
'gfortran-phdf5-petsc', 'gfortran-phdf5-petsc-opt']:
run_suite(name=name, mpi=True)
# print out summary of results

View file

@ -3,11 +3,17 @@
import os
from subprocess import Popen, STDOUT, PIPE, call
import filecmp
from nose_mpi import NoseMPI
import glob
from nose.plugins.skip import SkipTest
from nose_mpi import NoseMPI
pwd = os.path.dirname(__file__)
skipAll = False
def setup():
os.putenv('PWD', pwd)
os.chdir(pwd)
@ -20,18 +26,29 @@ def test_run():
else:
proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE)
returncode = proc.wait()
print(proc.communicate()[0])
output = proc.communicate()[0]
print(output)
if 'CMFD is not available' in output:
global skipAll
skipAll = True
raise SkipTest
assert returncode == 0
def test_created_statepoint():
if skipAll:
raise SkipTest
statepoint = glob.glob(pwd + '/statepoint.20.*')
assert len(statepoint) == 1
assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5')
def test_output_exists():
if skipAll:
raise SkipTest
assert os.path.exists(pwd + '/tallies.out')
def test_results():
if skipAll:
raise SkipTest
statepoint = glob.glob(pwd + '/statepoint.20.*')
call(['python', 'results.py', statepoint[0]])
compare = filecmp.cmp('results_test.dat', 'results_true.dat')

View file

@ -3,11 +3,16 @@
import os
from subprocess import Popen, STDOUT, PIPE, call
import filecmp
from nose_mpi import NoseMPI
import glob
from nose.plugins.skip import SkipTest
from nose_mpi import NoseMPI
pwd = os.path.dirname(__file__)
skipAll = False
def setup():
os.putenv('PWD', pwd)
os.chdir(pwd)
@ -20,18 +25,29 @@ def test_run():
else:
proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE)
returncode = proc.wait()
print(proc.communicate()[0])
output = proc.communicate()[0]
print(output)
if 'CMFD is not available' in output:
global skipAll
skipAll = True
raise SkipTest
assert returncode == 0
def test_created_statepoint():
if skipAll:
raise SkipTest
statepoint = glob.glob(pwd + '/statepoint.20.*')
assert len(statepoint) == 1
assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5')
def test_output_exists():
if skipAll:
raise SkipTest
assert os.path.exists(pwd + '/tallies.out')
def test_results():
if skipAll:
raise SkipTest
statepoint = glob.glob(pwd + '/statepoint.20.*')
call(['python', 'results.py', statepoint[0]])
compare = filecmp.cmp('results_test.dat', 'results_true.dat')