mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
ctest script executed from python script
This commit is contained in:
parent
7c34f5c109
commit
160569cced
1 changed files with 8 additions and 2 deletions
|
|
@ -66,10 +66,13 @@ class Test(object):
|
|||
self.build_opts = build_str
|
||||
return self.build_opts
|
||||
|
||||
def run_ctest(self, ctest_vars):
|
||||
def create_ctest_script(self, ctest_vars):
|
||||
with open('ctestscript.run', 'w') as fh:
|
||||
fh.write(ctest_str.format(**ctest_vars))
|
||||
|
||||
def run_ctest(self):
|
||||
call(['ctest', '-S', 'ctestscript.run','-V'])
|
||||
|
||||
def add_test(name, debug=False, optimize=False, mpi=False, openmp=False,\
|
||||
hdf5=False, petsc=False, valgrind=False):
|
||||
tests.update({name:Test(name, debug, optimize, mpi, openmp, hdf5, petsc, valgrind)})
|
||||
|
|
@ -126,8 +129,11 @@ for key in iter(tests):
|
|||
ctest_vars.update({'build_name' : test.get_build_name()})
|
||||
ctest_vars.update({'build_opts' : test.get_build_opts()})
|
||||
|
||||
# Create ctest script
|
||||
test.create_ctest_script(ctest_vars)
|
||||
|
||||
# Run test
|
||||
test.run_ctest(ctest_vars)
|
||||
test.run_ctest()
|
||||
|
||||
# Clear build directory
|
||||
call(['rm', '-rf', 'build'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue