diff --git a/repo.py b/repo.py index 0b26657..d5eb18d 100644 --- a/repo.py +++ b/repo.py @@ -98,6 +98,15 @@ def git_update(self): shutil.copy(f"git.{self.name}.out", self.suite.full_web_dir) + if self.suite.updateGitSubmodules == 1: + # update submodules to those specified by the current commit + # (--init is required because there may be new submodules since the last checkout) + self.suite.log.log(f"git submodule update in {self.dir}") + _, _, rc = test_util.run(f"git submodule update --init") + + if rc != 0: + self.suite.log.fail("ERROR: git submodule update was unsuccessful") + def save_head(self): """Save the current head of the repo""" diff --git a/suite.py b/suite.py index 5a5bd81..bebe5cf 100644 --- a/suite.py +++ b/suite.py @@ -419,7 +419,7 @@ def __init__(self, args): self.useCmake = 0 self.isSuperbuild = 0 self.use_ctools = 1 - + self.reportCoverage = args.with_coverage # set automatically @@ -435,6 +435,8 @@ def __init__(self, args): self.amrex_install_dir = "" # Cmake installation dir self.amrex_cmake_opts = "" + self.updateGitSubmodules = 0 + self.MPIcommand = "" self.MPIhost = "" diff --git a/test_util.py b/test_util.py index d0ba0ab..0da1da8 100644 --- a/test_util.py +++ b/test_util.py @@ -28,6 +28,9 @@ isSuperbuild = < 0: pre-build AMReX and source (default) 1: CMake downloads AMReX and needs separate configure & build > + updateGitSubmodules = < 0: don't update submodules when changing git branches (default) + 1: run `git submodule update --init` after changing git branches > + sourceTree = < C_Src or AMReX > suiteName = < descriptive name (i.e. Castro) >