partial work on adding travis event-based functionality via command line argument

This commit is contained in:
John Tramm 2020-01-23 23:12:18 +00:00
parent 05e39fb9e4
commit 1a806cd654
5 changed files with 14 additions and 8 deletions

View file

@ -6,6 +6,7 @@
<batches>100</batches>
<inactive>10</inactive>
<particles>1000</particles>
<event_based>true</event_based>
<!-- The starting source is a uniform distribution over the entire pin
cell. Note that since this is effectively a 2D model, the z coordinates

View file

@ -67,7 +67,7 @@ bool ufs_on {false};
bool urr_ptables_on {true};
bool write_all_tracks {false};
bool write_initial_source {false};
bool event_based; {false};
bool event_based {false};
std::string path_cross_sections;
std::string path_input;

View file

@ -10,10 +10,11 @@ def pytest_addoption(parser):
parser.addoption('--mpi-np')
parser.addoption('--update', action='store_true')
parser.addoption('--build-inputs', action='store_true')
parser.addoption('--event', action='store_true')
def pytest_configure(config):
opts = ['exe', 'mpi', 'mpiexec', 'mpi_np', 'update', 'build_inputs']
opts = ['exe', 'mpi', 'mpiexec', 'mpi_np', 'update', 'build_inputs', 'event']
for opt in opts:
if config.getoption(opt) is not None:
regression_config[opt] = config.getoption(opt)

View file

@ -19,7 +19,7 @@ def which(program):
return None
def install(omp=False, mpi=False, phdf5=False, dagmc=False, event=False):
def install(omp=False, mpi=False, phdf5=False, dagmc=False):
# Create build directory and change to it
shutil.rmtree('build', ignore_errors=True)
os.mkdir('build')
@ -47,9 +47,6 @@ def install(omp=False, mpi=False, phdf5=False, dagmc=False, event=False):
if dagmc:
cmake_cmd.append('-Ddagmc=ON')
if event:
cmake_cmd.append('-Devent=ON')
# Build in coverage mode for coverage testing
cmake_cmd.append('-Dcoverage=on')
@ -67,10 +64,9 @@ def main():
mpi = (os.environ.get('MPI') == 'y')
phdf5 = (os.environ.get('PHDF5') == 'y')
dagmc = (os.environ.get('DAGMC') == 'y')
event = (os.environ.get('EVENT') == 'y')
# Build and install
install(omp, mpi, phdf5, dagmc, event)
install(omp, mpi, phdf5, dagmc)
if __name__ == '__main__':
main()

View file

@ -3,7 +3,15 @@ set -ex
# Run regression and unit tests
if [[ $MPI == 'y' ]]; then
if [[ $EVENT == 'y' ]]; then
pytest --cov=openmc -v --mpi --event tests
else
pytest --cov=openmc -v --mpi tests
fi
else
if [[ $EVENT == 'y' ]]; then
pytest --cov=openmc -v --event tests
else
pytest --cov=openmc -v tests
fi
fi