mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
partial work on adding travis event-based functionality via command line argument
This commit is contained in:
parent
05e39fb9e4
commit
1a806cd654
5 changed files with 14 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue