Skip to content

Commit 28c7277

Browse files
authored
Merge branch 'main' into delete-exe
2 parents 9d33cdd + 6e28c54 commit 28c7277

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

regtest.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,7 @@ def test_suite(argv):
11801180
#----------------------------------------------------------------------
11811181
suite.log.log("archiving the output...")
11821182
match_count = 0
1183+
archived_file_list = []
11831184
for pfile in os.listdir(output_dir):
11841185

11851186
if (os.path.isdir(pfile) and
@@ -1198,9 +1199,11 @@ def test_suite(argv):
11981199
elif suite.archive_output == 1:
11991200
# tar it up
12001201
try:
1201-
tar = tarfile.open(f"{pfile}.tgz", "w:gz")
1202+
tarfilename = f"{pfile}.tgz"
1203+
tar = tarfile.open(tarfilename, "w:gz")
12021204
tar.add(f"{pfile}")
12031205
tar.close()
1206+
archived_file_list.append(tarfilename)
12041207

12051208
except:
12061209
suite.log.warn(f"unable to tar output file {pfile}")
@@ -1228,11 +1231,19 @@ def test_suite(argv):
12281231
test_successful = (test.return_code == 0 and test.analysis_successful and test.compare_successful)
12291232
if (test.ignore_return_code == 1 or test_successful):
12301233
if args.clean_testdir:
1234+
# remove subdirectories
12311235
suite.log.log("removing subdirectories from test directory...")
12321236
for file_name in os.listdir(output_dir):
12331237
file_path = os.path.join(output_dir, file_name)
12341238
if os.path.isdir(file_path):
12351239
shutil.rmtree(file_path)
1240+
1241+
# remove archived plotfiles
1242+
suite.log.log("removing compressed plotfiles from test directory...")
1243+
for file_name in archived_file_list:
1244+
file_path = os.path.join(output_dir, file_name)
1245+
os.remove(file_path)
1246+
12361247
# switch to the full test directory
12371248
os.chdir(suite.full_test_dir)
12381249
if args.delete_exe:

repo.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,15 @@ def git_update(self):
9898

9999
shutil.copy(f"git.{self.name}.out", self.suite.full_web_dir)
100100

101+
if self.suite.updateGitSubmodules == 1:
102+
# update submodules to those specified by the current commit
103+
# (--init is required because there may be new submodules since the last checkout)
104+
self.suite.log.log(f"git submodule update in {self.dir}")
105+
_, _, rc = test_util.run(f"git submodule update --init")
106+
107+
if rc != 0:
108+
self.suite.log.fail("ERROR: git submodule update was unsuccessful")
109+
101110
def save_head(self):
102111
"""Save the current head of the repo"""
103112

suite.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ def __init__(self, args):
419419
self.useCmake = 0
420420
self.isSuperbuild = 0
421421
self.use_ctools = 1
422-
422+
423423
self.reportCoverage = args.with_coverage
424424

425425
# set automatically
@@ -435,6 +435,8 @@ def __init__(self, args):
435435
self.amrex_install_dir = "" # Cmake installation dir
436436
self.amrex_cmake_opts = ""
437437

438+
self.updateGitSubmodules = 0
439+
438440
self.MPIcommand = ""
439441
self.MPIhost = ""
440442

test_util.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
isSuperbuild = < 0: pre-build AMReX and source (default)
2929
1: CMake downloads AMReX and needs separate configure & build >
3030
31+
updateGitSubmodules = < 0: don't update submodules when changing git branches (default)
32+
1: run `git submodule update --init` after changing git branches >
33+
3134
sourceTree = < C_Src or AMReX >
3235
3336
suiteName = < descriptive name (i.e. Castro) >

0 commit comments

Comments
 (0)