mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
now compiles fine if mcpl is indeed installed
This commit is contained in:
parent
c6c876d835
commit
8719a539f9
1 changed files with 14 additions and 7 deletions
|
|
@ -3,16 +3,13 @@ import os
|
|||
import shutil
|
||||
import subprocess
|
||||
import textwrap
|
||||
|
||||
import glob
|
||||
import openmc
|
||||
import pytest
|
||||
|
||||
from tests.testing_harness import TestHarness
|
||||
|
||||
def model():
|
||||
subprocess.run(['gcc','-o gen_dummt_mcpl.out','-lm','-lmcpl','gen_dummy_mcpl.c'] )
|
||||
subprocess.run(['./gen_dummy_mcpl.out'])
|
||||
|
||||
|
||||
class SourceMCPLFileTestHarness(TestHarness):
|
||||
def execute_test(self):
|
||||
"""Run OpenMC with the appropriate arguments and check the outputs."""
|
||||
|
|
@ -26,6 +23,10 @@ class SourceMCPLFileTestHarness(TestHarness):
|
|||
finally:
|
||||
self._cleanup()
|
||||
|
||||
def _create_input(self):
|
||||
subprocess.run(['gcc','-o','gen_dummy_mcpl.out','gen_dummy_mcpl.c','-lm','-lmcpl'])
|
||||
subprocess.run(['./gen_dummy_mcpl.out'])
|
||||
|
||||
def update_results(self):
|
||||
"""Update the results_true using the current version of OpenMC."""
|
||||
try:
|
||||
|
|
@ -40,13 +41,19 @@ class SourceMCPLFileTestHarness(TestHarness):
|
|||
|
||||
def _test_output_created(self):
|
||||
"""Check that the output files were created"""
|
||||
stat epoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))
|
||||
statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))
|
||||
assert len(statepoint) == 1, 'Either multiple or no statepoint files ' \
|
||||
'exist.'
|
||||
assert statepoint[0].endswith('h5'), \
|
||||
'statepoint file does not end with h5.'
|
||||
|
||||
def _cleanup(self):
|
||||
super()._cleanup()
|
||||
source_mcpl=glob.glob(os.path.join(os.getcwd(),'source*.mcpl'))
|
||||
for f in source_mcpl:
|
||||
if (os.path.exists(f)):
|
||||
os.remove(f)
|
||||
|
||||
def test_mcpl_source_file():
|
||||
harness = SourceMCPLFileTestHarness('statepoint.10.h5')
|
||||
harness.main()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue