Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion pytools/idfx_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ def compareDump(self, file1, file2, tolerance=0):
)
sys.stdout.flush()

def makeReference(self, filename):
def makeReference(self, filename, done: list = None):
# log and in fake mode do not execute.
self.addLog(
{
Expand All @@ -674,6 +674,13 @@ def makeReference(self, filename):
print("Creating reference directory")
os.makedirs(targetDir, exist_ok=True)
fileout = os.path.join(targetDir, self._getReferenceFilename())
if done is not None and fileout in done:
print(
bcolors.WARNING
+ "Reference creation skipped, already done by previous specific config"
+ bcolors.ENDC
)
return
if os.path.exists(fileout):
ans = input(
bcolors.WARNING
Expand All @@ -690,6 +697,10 @@ def makeReference(self, filename):
print(bcolors.OKGREEN + "Reference file " + fileout + " created" + bcolors.ENDC)
sys.stdout.flush()

# append
if done is not None:
done.append(fileout)

def _showConfig(self):
print("**************************************************************")
if self.cuda:
Expand Down
3 changes: 2 additions & 1 deletion pytools/idfx_test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def __init__(self, parentScriptFile: str):
self.parentScritFile = parentScriptFile
self.filterSubdir = os.environ.get("IDEFIX_TEST_FILTER_SUBDIR", "./test/")
self.testmeSchema = self._loadTestmeSchema()
self.makeReferencesDone: list[str] = []

def _loadTestmeSchema(self) -> dict:
scriptDir = os.path.dirname(__file__)
Expand Down Expand Up @@ -456,7 +457,7 @@ def _runNonRegSingleRun(

# regen ref if needed
if idefixTest.init:
idefixTest.makeReference(filename=dumpname)
idefixTest.makeReference(filename=dumpname, done=self.makeReferencesDone)

# check outputs
if standardTest:
Expand Down
Loading