Lines Matching refs:subst
354 subst = {key : testDict.get(key, '') for key in testparse.acceptedkeys if key != 'test'}
357 subst['env'] = '\n'.join('export '+cmd for cmd in shlex.split(subst['env']))
358 subst['execname']=testDict['execname']
359 subst['error']=''
362 subst['error']="Error"
363 subst['filter']=testDict['filter'].lstrip("Error:")
365 subst['filter']=testDict['filter']
368 subst['subargs']='' # Default. For variables override
369 subst['srcdir']=os.path.join(self.srcdir, rpath)
370 subst['label_suffix']=''
371 subst['comments']="\n#".join(subst['comments'].split("\n"))
372 if subst['comments']: subst['comments']="#"+subst['comments']
373 subst['executable']="../"+subst['execname']
374 subst['testroot']=self.testroot_dir
375 subst['testname']=testname
377 subst['datafilespath_line'] = 'DATAFILESPATH=${DATAFILESPATH:-"'+dp+'"}'
380 subst['petsc_index_size']=str(self.conf['PETSC_INDEX_SIZE'])
381 subst['petsc_scalar_size']=str(self.conf['PETSC_SCALAR_SIZE'])
383 subst['petsc_test_options']=self.conf['PETSC_TEST_OPTIONS']
387 subst['mpiexec']='petsc_mpiexec_valgrind ' + self.conf['MPIEXEC']
389 subst['mpiexec']=self.conf['MPIEXEC']
390 subst['mpiexec_tail']=self.conf['MPIEXEC_TAIL']
391 subst['pkg_name']=self.pkg_name
392 subst['pkg_dir']=self.pkg_dir
393 subst['pkg_arch']=self.pkg_arch
394 subst['CONFIG_DIR']=thisscriptdir
395 subst['PETSC_BINDIR']=os.path.join(self.petsc_dir,'lib','petsc','bin')
396 subst['diff']=self.conf['DIFF']
397 subst['rm']=self.conf['RM']
398 subst['grep']=self.conf['GREP']
399 subst['petsc_lib_dir']=self.conf['PETSC_LIB_DIR']
400 subst['wpetsc_dir']=self.conf['wPETSC_DIR']
405 subst['output_file']="output/"+defroot+".out"
406 subst['redirect_file']=defroot+".tmp"
407 subst['label']=nameSpace(defroot,self.srcrelpath(subst['srcdir']))
410 subst['output_file']=os.path.join(subst['srcdir'],subst['output_file'])
412 subst['regexes']={}
413 for subkey in subst:
415 if not isinstance(subst[subkey],str): continue
417 subst['regexes'][subkey]=re.compile(patt)
419 return subst
421 def _substVars(self,subst,origStr): argument
426 for subkey, subvalue in subst.items():
430 Str=subst['regexes'][subkey].sub(lambda x: subvalue,Str)
433 def getCmds(self,subst,i, debug=False): argument
443 if subst['temporaries']:
444 if '*' in subst['temporaries']:
445 …t of temporary files to remove may not include wildcards'.format(subst['srcdir'], subst['execname'…
446 cmd=cmdindnt+self._substVars(subst,example_template.preclean)
448 if not subst['command']:
449 cmd=cmdindnt+self._substVars(subst,example_template.mpitest)
451 cmd=cmdindnt+self._substVars(subst,example_template.commandtest)
458 if not os.path.isfile(os.path.join(self.petsc_dir,subst['output_file'])):
459 if not subst['TODO']:
460 print("Warning: "+subst['output_file']+" not found.")
461 altlist=self._getAltList(subst['output_file'], subst['srcdir'])
465 cmd=diffindnt+self._substVars(subst,example_template.difftest)
469 rf=subst['redirect_file']
479 cmd+=subst['label_suffix']+' ""' # Quotes are painful
561 subst=self.getSubstVars(testDict,rpath,testname)
562 loopVars = self._getLoopVars(subst,testname) # Alters subst as well
568 for lfile in subst.get('localrunfiles','').split():
572 for stest in subst.get("subtests",[]):
578 header=self._substVars(subst,example_template.header)
580 header=self._substVars(subst,header)
581 footer=re.sub('@TESTROOT@',subst['testroot'],example_template.footer)
601 substP=subst # Subtests can inherit args but be careful
604 subst=substP.copy()
605 subst.update(testDict[stest])
606 subst['label_suffix']='+'+string.ascii_letters[k]; k+=1
607 sLoopVars = self._getLoopVars(subst,testname,isSubtest=True)
612 fh.write(self.getCmds(subst,j)+"\n")
617 fh.write(self.getCmds(subst,j)+"\n")