def regression(args): '''Run complete regression suite''' ret = 0 maker = builder.PETScMaker() maker.setup() args.retain = False args.testnum = None walker = builder.DirectoryTreeWalker(maker.argDB, maker.log, maker.configInfo, allowExamples=True) #dirs = map(lambda d: os.path.join(maker.petscDir, 'src', d), ['inline', 'sys', 'vec', 'mat', 'dm', 'ksp', 'snes', 'ts', 'docs', 'tops']) dirs = map(lambda d: os.path.join(maker.petscDir, 'src', d), ['vec']) for d in dirs: print 'Dir', d for root, files in walker.walk(d): baseDir = os.path.basename(root) if not baseDir == 'tests' and not baseDir == 'tutorials': continue for f in files: basename, ext = os.path.splitext(f) if not basename.startswith('ex'): continue if not ext in ['.c', '.F']: continue ex = os.path.join(root, f) ret = checkSingleRun(maker, ex) if ret: break if ret: break if ret: break if not ret: print('All regression tests pass') maker.cleanup() return ret
def regression(args): '''Run complete regression suite''' ret = 0 gret = 0 maker = builder.PETScMaker('regression.log') maker.setup() haltOnError = False args.retain = False args.testnum = None if len(args.dirs): regdirs = args.dirs else: regdirs = map(lambda d: os.path.join('src', d), [ 'inline', 'sys', 'vec', 'mat', 'dm', 'ksp', 'snes', 'ts', 'docs', 'tops' ]) walker = builder.DirectoryTreeWalker(maker.argDB, maker.log, maker.configInfo, allowExamples=True) dirs = map(lambda d: os.path.join(maker.petscDir, d), regdirs) for d in dirs: for root, files in walker.walk(d): baseDir = os.path.basename(root) if not baseDir == 'tests' and not baseDir == 'tutorials': continue maker.logPrint('Running regression tests in %s\n' % (baseDir, ), debugSection='screen', forceScroll=True) for f in files: basename, ext = os.path.splitext(f) if not basename.startswith('ex'): continue if not ext in ['.c', '.F']: continue ex = os.path.join(root, f) ret = checkSingleRun(maker, ex, False, isRegression=True) if ret: gret = ret if haltOnError: break if ret and haltOnError: break if ret and haltOnError: break if not gret: maker.logPrint('All regression tests pass\n', debugSection='screen', forceScroll=True) maker.cleanup() return gret