Skip to content

Commit

Permalink
Merge branch 'main' into update-submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Dec 18, 2024
2 parents b735d41 + d1e0aef commit eebd3e3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 12 additions & 1 deletion regtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,7 @@ def test_suite(argv):
#----------------------------------------------------------------------
suite.log.log("archiving the output...")
match_count = 0
archived_file_list = []
for pfile in os.listdir(output_dir):

if (os.path.isdir(pfile) and
Expand All @@ -1198,9 +1199,11 @@ def test_suite(argv):
elif suite.archive_output == 1:
# tar it up
try:
tar = tarfile.open(f"{pfile}.tgz", "w:gz")
tarfilename = f"{pfile}.tgz"
tar = tarfile.open(tarfilename, "w:gz")
tar.add(f"{pfile}")
tar.close()
archived_file_list.append(tarfilename)

except:
suite.log.warn(f"unable to tar output file {pfile}")
Expand Down Expand Up @@ -1228,11 +1231,19 @@ def test_suite(argv):
test_successful = (test.return_code == 0 and test.analysis_successful and test.compare_successful)
if (test.ignore_return_code == 1 or test_successful):
if args.clean_testdir:
# remove subdirectories
suite.log.log("removing subdirectories from test directory...")
for file_name in os.listdir(output_dir):
file_path = os.path.join(output_dir, file_name)
if os.path.isdir(file_path):
shutil.rmtree(file_path)

# remove archived plotfiles
suite.log.log("removing compressed plotfiles from test directory...")
for file_name in archived_file_list:
file_path = os.path.join(output_dir, file_name)
os.remove(file_path)

# switch to the full test directory
os.chdir(suite.full_test_dir)

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ sphinx_rtd_theme
Sphinx
nbsphinx>=0.3.1
pillow
bokeh

0 comments on commit eebd3e3

Please sign in to comment.