Changes in src/tests/test.py [7895d46:47f9422]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/tests/test.py ¶
r7895d46 r47f9422 13 13 import stat 14 14 import sys 15 import multiprocessing 15 16 16 17 ################################################################################ … … 26 27 def getMachineType(): 27 28 sh('echo "void ?{}(int*a,int b){}int main(){return 0;}" > .dummy.c') 28 sh("make .dummy", print2stdout=False) 29 ret, out = sh("make .dummy", print2stdout=False) 30 if ret != 0: 31 print("Failed to identify architecture:") 32 print(out) 33 print("Stopping") 34 sys.exit(1) 29 35 _, out = sh("file .dummy", print2stdout=False) 30 36 sh("rm -f .dummy.c > /dev/null 2>&1") … … 115 121 # find the output file based on the test name and options flag 116 122 out_file = (".out/%s.log" % test.name) if not generate else (".expect/%s.txt" % test.path) 123 err_file = ".err/%s.log" % test.name 117 124 118 125 # remove any outputs from the previous tests to prevent side effects … … 137 144 sh("cat %s > %s" % (test.name, out_file), dry_run) 138 145 146 else : 147 # command failed save the log to less temporary file 148 sh("mv %s %s" % (err_file, out_file), dry_run) 149 139 150 retcode = 0 140 151 error = None 141 152 142 # fix output to prevent make depth to cause issues143 fix_MakeLevel(out_file)153 # # fix output to prevent make depth to cause issues 154 # fix_MakeLevel(out_file) 144 155 145 156 if generate : … … 152 163 else : 153 164 # diff the output of the files 154 diff_cmd = ("diff --old-group-format='\t\tmissing lines :\n" 165 diff_cmd = ("diff --ignore-all-space " 166 "--ignore-blank-lines " 167 "--old-group-format='\t\tmissing lines :\n" 155 168 "%%<' \\\n" 156 169 "--new-group-format='\t\tnew lines :\n" … … 212 225 213 226 #make sure the required folder are present 214 sh('mkdir -p .out .expect ', dry_run)227 sh('mkdir -p .out .expect .err', dry_run) 215 228 216 229 if generate : … … 309 322 # check if the user already passed in a number of jobs for multi-threading 310 323 make_flags = environ.get('MAKEFLAGS') 311 make_jobs_fds = re.search("--jobserver- fds=\s*([0-9]+),([0-9]+)", make_flags) if make_flags else None324 make_jobs_fds = re.search("--jobserver-(auth|fds)=\s*([0-9]+),([0-9]+)", make_flags) if make_flags else None 312 325 if make_jobs_fds : 313 tokens = os.read(int(make_jobs_fds.group( 1)), 1024)326 tokens = os.read(int(make_jobs_fds.group(2)), 1024) 314 327 options.jobs = len(tokens) 315 os.write(int(make_jobs_fds.group(2)), tokens) 328 os.write(int(make_jobs_fds.group(3)), tokens) 329 else : 330 options.jobs = multiprocessing.cpu_count() 316 331 317 332 # make sure we have a valid number of jobs that corresponds to user input … … 320 335 sys.exit(1) 321 336 337 options.jobs = min( options.jobs, len(tests) ) 338 322 339 print('Running (%s) on %i cores' % ("debug" if options.debug else "no debug", options.jobs)) 323 340 make_cmd = "make" if make_flags else ("make -j%i" % options.jobs)
Note: See TracChangeset
for help on using the changeset viewer.