mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
Added test suite based on nosetests. Closes #27.
This commit is contained in:
parent
43ae900e7c
commit
358b7ca7bb
282 changed files with 15270 additions and 0 deletions
8
tests/test_fixed_source/geometry.xml
Normal file
8
tests/test_fixed_source/geometry.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<geometry>
|
||||
|
||||
<!-- Sphere with radius 10 -->
|
||||
<surface id="1" type="sphere" coeffs="0 0 0 10" boundary="vacuum"/>
|
||||
<cell id="1" material="1" surfaces="-1" />
|
||||
|
||||
</geometry>
|
||||
9
tests/test_fixed_source/materials.xml
Normal file
9
tests/test_fixed_source/materials.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0"?>
|
||||
<materials>
|
||||
|
||||
<material id="1">
|
||||
<density value="7.5" units="g/cc" />
|
||||
<nuclide name="O-16" xs="70c" ao="1.0" />
|
||||
</material>
|
||||
|
||||
</materials>
|
||||
13
tests/test_fixed_source/settings.xml
Normal file
13
tests/test_fixed_source/settings.xml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0"?>
|
||||
<settings>
|
||||
|
||||
<fixed_source>
|
||||
<batches>10</batches>
|
||||
<particles>100</particles>
|
||||
</fixed_source>
|
||||
|
||||
<source>
|
||||
<space type="point" parameters="0 0 0" />
|
||||
</source>
|
||||
|
||||
</settings>
|
||||
25
tests/test_fixed_source/test_fixed_source.py
Normal file
25
tests/test_fixed_source/test_fixed_source.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
from subprocess import Popen, STDOUT, PIPE
|
||||
|
||||
pwd = os.path.dirname(__file__)
|
||||
|
||||
def setup():
|
||||
os.putenv('PWD', pwd)
|
||||
os.chdir(pwd)
|
||||
|
||||
def test_run():
|
||||
proc = Popen([pwd + '/../../src/openmc'], stderr=STDOUT, stdout=PIPE)
|
||||
returncode = proc.wait()
|
||||
print(proc.communicate()[0])
|
||||
assert returncode == 0
|
||||
|
||||
def test_created_statepoint():
|
||||
assert os.path.exists(pwd + '/statepoint.10.binary')
|
||||
|
||||
def teardown():
|
||||
output = [pwd + '/statepoint.10.binary']
|
||||
for f in output:
|
||||
if os.path.exists(f):
|
||||
os.remove(f)
|
||||
Loading…
Add table
Add a link
Reference in a new issue