- Timestamp:
- 06/02/21 11:03:35 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/xios_test_suite/TEST_SUITE/step2.py
r1915 r2139 18 18 def OSinfo(runthis): 19 19 red = lambda text: '\033[0;31m' + text + '\033[0m' 20 osstdout = subprocess.Popen(runthis, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True) 21 theInfo = osstdout.communicate()[0].strip() 22 if osstdout.returncode!=0: 20 osstdout = subprocess.Popen(runthis, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True) 21 theInfo, theErr = osstdout.communicate() 22 #print(theInfo) 23 if theErr: 23 24 print(red(runthis+" FAILED")) 24 print(the Info)25 print(theErr) 25 26 sys.exit() 27 28 #def OSinfo(runthis): 29 # red = lambda text: '\033[0;31m' + text + '\033[0m' 30 # osstdout = subprocess.Popen(runthis, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True) 31 # theInfo = osstdout.communicate()[0].strip() 32 # if osstdout.returncode!=0: 33 # print(red(runthis+" FAILED")) 34 # print(theInfo) 35 # sys.exit() 26 36 27 37 … … 72 82 for checkfile in checkfiles: 73 83 if os.path.exists(config+"/"+checkfile) and os.path.exists("reference/ref_"+config+"/"+checkfile): 74 OSinfo("cdo -W diffn "+config+"/"+checkfile+" "+"reference/ref_"+config+"/"+checkfile+" | > diff.txt")75 if os.stat("diff .txt").st_size==0:84 OSinfo("cdo -W diffn "+config+"/"+checkfile+" "+"reference/ref_"+config+"/"+checkfile+" 2>&1 |grep -v 'Found more than one time variable'|grep -v 'cdo diffn: Processed'|grep -v 'dimensional variables are not supported'|grep -v 'Time variable >time_counter< not found!' > diff_"+checkfile+".txt") 85 if os.stat("diff_"+checkfile+".txt").st_size==0: # if no diff -> set 0 76 86 report.write(folder_name+" "+folder_name+"@"+config_name+" "+folder_name+"@"+config_name+"@"+checkfile+" "+str(1)+"\n") 77 elif os.path.exists(config+"/"+checkfile): 87 else: # if cdo diffn returns diff -> set -1 88 report.write(folder_name+" "+folder_name+"@"+config_name+" "+folder_name+"@"+config_name+"@"+checkfile+" "+str(-1)+"\n") 89 90 elif os.path.exists(config+"/"+checkfile): # if no ref file -> set 0 78 91 report.write(folder_name+" "+folder_name+"@"+config_name+" "+folder_name+"@"+config_name+"@"+checkfile+" "+str(0)+"\n") 92 elif os.path.exists("reference/ref_"+config+"/"+checkfile): # if no output file -> set -2 93 report.write(folder_name+" "+folder_name+"@"+config_name+" "+folder_name+"@"+config_name+"@"+checkfile+" "+str(-2)+"\n") 94 79 95 80 96
Note: See TracChangeset
for help on using the changeset viewer.