Commit b17598d5 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

worked on python unittest framework

parent 1d0e055f
......@@ -75,13 +75,17 @@ class Mpp:
run_parameters = self.chain_run_parameters(1, None, executable=file)
return self.run_subprocess(run_parameters, cwd=PROJECT_BUILD_DIR)
def chain_run_parameters(self, kernels, args, executable=None):
def chain_run_parameters(self, kernels, config, kwargs, executable=None):
executable = self.executable if executable is None else executable
if args is None:
args = []
run_parameters = ['mpirun', '-np', str(kernels), executable]
for arg in args:
run_parameters.append(arg)
if kwargs is None:
kwargs = {}
if config is None:
run_parameters = ['mpirun', '-np', str(kernels), executable]
else:
run_parameters = ['mpirun', '-np', str(kernels), executable, config]
for key, arg in kwargs.items():
kwarg = key + '=' + str(arg)
run_parameters.append(kwarg)
return run_parameters
def build(self):
......@@ -123,13 +127,14 @@ class Mpp:
if os.path.isdir(PROJECT_BUILD_DIR):
self.clean_directory(PROJECT_BUILD_DIR, True)
def run(self, kernels, args=None):
run_parameters = self.chain_run_parameters(kernels, args)
def run(self, kernels, config=None, kwargs=None):
run_parameters = self.chain_run_parameters(kernels, config, kwargs)
return self.run_subprocess(run_parameters, cwd=PROJECT_BUILD_DIR)
@staticmethod
def read_log(log_file=None):
log_file = PROJECT_LOG_DIR + '/log' if log_file is None else PROJECT_LOG_DIR + log_file
log_file = PROJECT_LOG_DIR + '/log' if log_file is None else \
PROJECT_LOG_DIR + log_file
if os.path.isfile(log_file):
with open(log_file) as file:
content = file.readlines()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment