Skip to content

Commit

Permalink
switch test chdir location
Browse files Browse the repository at this point in the history
  • Loading branch information
bolliger32 committed Jun 17, 2019
1 parent 47a3b9f commit 4147443
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/python/clawutil/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,22 +215,24 @@ def write_rundata_objects(self, path=None):

if path is None:
path = self.temp_path
# need to cwd b/c setrun.py files contain
# relative paths to topofiles and fgmax files
cwd = os.getcwd()
os.chdir(path)
self.rundata.write(out_dir=path)
os.chdir(cwd)


def run_code(self):
r"""Run test code given an already compiled executable"""

cwd = os.getcwd()
os.chdir(self.temp_path)

runclaw.runclaw(xclawcmd=os.path.join(self.temp_path,self.executable_name),
rundir=self.temp_path,
outdir=self.temp_path,
overwrite=True,
restart=False,
xclawout=self.stdout,
xclawerr=self.stderr)
os.chdir(cwd)

self.stdout.flush()
self.stderr.flush()
Expand All @@ -251,14 +253,11 @@ def runTest(self, save=False, indices=(2, 3)):
"""

# Write out data files
cwd = os.getcwd()
os.chdir(self.temp_path)
self.load_rundata()
self.write_rundata_objects()

# Run code
self.run_code()
os.chdir(cwd)

# Perform tests
# Override this class to perform data checks, as is this class will
Expand Down

0 comments on commit 4147443

Please sign in to comment.