Changeset 4e9151f for src/tests/test.py
- Timestamp:
- Apr 24, 2017, 12:55:22 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 00303d50
- Parents:
- b3d70eba
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/test.py
rb3d70eba r4e9151f 13 13 import stat 14 14 import sys 15 import multiprocessing 15 16 16 17 ################################################################################ … … 115 116 # find the output file based on the test name and options flag 116 117 out_file = (".out/%s.log" % test.name) if not generate else (".expect/%s.txt" % test.path) 118 err_file = ".err/%s.log" % test.name 117 119 118 120 # remove any outputs from the previous tests to prevent side effects … … 137 139 sh("cat %s > %s" % (test.name, out_file), dry_run) 138 140 141 else : 142 # command failed save the log to less temporary file 143 sh("mv %s %s" % (err_file, out_file), dry_run) 144 139 145 retcode = 0 140 146 error = None 141 147 142 # fix output to prevent make depth to cause issues143 fix_MakeLevel(out_file)148 # # fix output to prevent make depth to cause issues 149 # fix_MakeLevel(out_file) 144 150 145 151 if generate : … … 152 158 else : 153 159 # diff the output of the files 154 diff_cmd = ("diff --old-group-format='\t\tmissing lines :\n" 160 diff_cmd = ("diff --ignore-all-space " 161 "--ignore-blank-lines " 162 "--old-group-format='\t\tmissing lines :\n" 155 163 "%%<' \\\n" 156 164 "--new-group-format='\t\tnew lines :\n" … … 212 220 213 221 #make sure the required folder are present 214 sh('mkdir -p .out .expect ', dry_run)222 sh('mkdir -p .out .expect .err', dry_run) 215 223 216 224 if generate : … … 309 317 # check if the user already passed in a number of jobs for multi-threading 310 318 make_flags = environ.get('MAKEFLAGS') 311 make_jobs_fds = re.search("--jobserver- fds=\s*([0-9]+),([0-9]+)", make_flags) if make_flags else None319 make_jobs_fds = re.search("--jobserver-(auth|fds)=\s*([0-9]+),([0-9]+)", make_flags) if make_flags else None 312 320 if make_jobs_fds : 313 tokens = os.read(int(make_jobs_fds.group( 1)), 1024)321 tokens = os.read(int(make_jobs_fds.group(2)), 1024) 314 322 options.jobs = len(tokens) 315 os.write(int(make_jobs_fds.group(2)), tokens) 323 os.write(int(make_jobs_fds.group(3)), tokens) 324 else : 325 options.jobs = multiprocessing.cpu_count() 316 326 317 327 # make sure we have a valid number of jobs that corresponds to user input … … 320 330 sys.exit(1) 321 331 332 options.jobs = min( options.jobs, len(tests) ) 333 322 334 print('Running (%s) on %i cores' % ("debug" if options.debug else "no debug", options.jobs)) 323 335 make_cmd = "make" if make_flags else ("make -j%i" % options.jobs)
Note: See TracChangeset
for help on using the changeset viewer.