• Home
  • Raw
  • Download

Lines Matching +full:dir +full:- +full:glob

12    - ProjectMap file
13 - Historical Performance Data
14 - Project Dir1
15 - ReferenceOutput
16 - Project Dir2
17 - ReferenceOutput
19 Note that the build tree must be inside the project dir.
22 - Copy over a copy of the Repository Directory. (TODO: Prefer to ensure that
24 - Build all projects, until error. Produce logs to report errors.
25 - Compare results.
33 The compiler for scan-build and scan-build are in the PATH.
49 import glob
57 #------------------------------------------------------------------------------
59 #------------------------------------------------------------------------------
73 return int(capture(['sysctl', '-n', 'hw.ncpu']))
82 """which(command, [paths]) - Look up the given command in the paths string
128 sys.exit(-1)
140 #------------------------------------------------------------------------------
142 #------------------------------------------------------------------------------
148 sys.exit(-1)
161 # This is a file containing commands for scan-build.
167 # Summary file - contains the summary of the failures. Ex: This info can be be
174 # The scan-build result directory.
194 # Currently, consists of all the non-experimental checkers, plus a few alpha
200 #------------------------------------------------------------------------------
202 #------------------------------------------------------------------------------
204 # Run pre-processing script if any.
205 def runCleanupScript(Dir, PBuildLogFile): argument
206 Cwd = os.path.join(Dir, PatchedSourceDirName)
207 ScriptPath = os.path.join(Dir, CleanupScript)
211 def runDownloadScript(Dir, PBuildLogFile): argument
212 ScriptPath = os.path.join(Dir, DownloadScript)
213 runScript(ScriptPath, PBuildLogFile, Dir)
231 sys.exit(-1)
234 def downloadAndPatch(Dir, PBuildLogFile): argument
235 CachedSourceDirPath = os.path.join(Dir, CachedSourceDirName)
240 runDownloadScript(Dir, PBuildLogFile)
243 exit(-1)
245 PatchedSourceDirPath = os.path.join(Dir, PatchedSourceDirName)
253 applyPatch(Dir, PBuildLogFile)
255 def applyPatch(Dir, PBuildLogFile): argument
256 PatchfilePath = os.path.join(Dir, PatchfileName)
257 PatchedSourceDirPath = os.path.join(Dir, PatchedSourceDirName)
264 check_call("patch -p1 < '%s'" % (PatchfilePath),
271 sys.exit(-1)
273 # Build the project with scan-build by reading in the commands and
274 # prefixing them with the scan-build options.
275 def runScanBuild(Dir, SBOutputDir, PBuildLogFile): argument
276 BuildScriptPath = os.path.join(Dir, BuildScript)
279 sys.exit(-1)
285 # Run scan-build from within the patched source directory.
286 SBCwd = os.path.join(Dir, PatchedSourceDirName)
288 SBOptions = "--use-analyzer '%s' " % Clang
289 SBOptions += "-plist-html -o '%s' " % SBOutputDir
290 SBOptions += "-enable-checker " + AllCheckers + " "
291 SBOptions += "--keep-empty "
292 # Always use ccc-analyze to ensure that we can locate the failures
294 SBOptions += "--override-compiler "
297 SBPrefix = "scan-build " + SBOptions + " "
302 # If using 'make', auto imply a -jX argument
306 "-j" not in Command:
307 Command += " -j%d" % Jobs
315 print "Error: scan-build failed. See ",PBuildLogFile.name,\
339 Cmd = "xcrun --sdk " + SDKName + " --show-sdk-path"
343 def runAnalyzePreprocessed(Dir, SBOutputDir, Mode): argument
344 if os.path.exists(os.path.join(Dir, BuildScript)):
349 CmdPrefix = Clang + " -cc1 "
355 CmdPrefix += "-isysroot " + SDKPath + " "
357 CmdPrefix += "-analyze -analyzer-output=plist -w "
358 CmdPrefix += "-analyzer-checker=" + Checkers +" -fcxx-exceptions -fblocks "
361 CmdPrefix += "-std=c++11 "
363 PlistPath = os.path.join(Dir, SBOutputDir, "date")
367 for FullFileName in glob.glob(Dir + "/*"):
379 OutputOption = "-o '%s.plist' " % os.path.join(PlistPath, FileName)
385 check_call(Command, cwd = Dir, stderr=LogFile,
412 def buildProject(Dir, SBOutputDir, ProjectBuildMode, IsReferenceBuild): argument
423 RmCommand = "rm -r '%s'" % SBOutputDir
436 downloadAndPatch(Dir, PBuildLogFile)
437 runCleanupScript(Dir, PBuildLogFile)
438 runScanBuild(Dir, SBOutputDir, PBuildLogFile)
440 runAnalyzePreprocessed(Dir, SBOutputDir, ProjectBuildMode)
443 runCleanupScript(Dir, PBuildLogFile)
452 PathPrefix = Dir
454 PathPrefix = os.path.join(Dir, PatchedSourceDirName)
465 ((time.time()-TBegin), BuildLogPath)
470 for F in glob.glob(SBOutputDir + "/*/*.plist"):
479 # Given the scan-build output directory, checks if the build failed
484 Failures = glob.glob(SBOutputDir + "/*/failures/*.stderr.txt")
488 Plists = glob.glob(SBOutputDir + "/*/*.plist")
489 print "Number of bug reports (non-empty plist files) produced: %d" %\
512 SummaryLog.write("\n-- Error #%d -----------\n" % (Idx,));
522 sys.exit(-1)
529 # Compare the warnings produced by scan-build.
531 # 0 - success if there are no crashes or analyzer failure.
532 # 1 - success if there are no difference in the number of reported bugs.
533 # 2 - success if all the bug reports are identical.
534 def runCmpResults(Dir, Strictness = 0): argument
537 RefDir = os.path.join(Dir, SBOutputDirReferencePrefix + SBOutputDirName)
538 NewDir = os.path.join(Dir, SBOutputDirName)
541 RefList = glob.glob(RefDir + "/*")
542 NewList = glob.glob(NewDir + "/*")
544 # Log folders are also located in the results dir, so ignore them.
554 # There might be more then one folder underneath - one per each scan-build
573 PatchedSourceDirPath = os.path.join(Dir, PatchedSourceDirName)
587 sys.exit(-1)
590 sys.exit(-1)
592 print "Diagnostic comparison complete (time: %.2f)." % (time.time()-TBegin)
600 for F in glob.glob("%s/*/*.%s" % (SBOutputDir, E)):
625 CommitCommand = "svn commit -m \"[analyzer tests] Remove " \
628 CommitCommand = "svn commit -m \"[analyzer tests] Add new " \
635 sys.exit(-1)
637 def testProject(ID, ProjectBuildMode, IsReferenceBuild=False, Dir=None, Strictness = 0): argument
638 print " \n\n--- Building project %s" % (ID,)
642 if Dir is None :
643 Dir = getProjectDir(ID)
645 print " Build directory: %s." % (Dir,)
649 SBOutputDir = os.path.join(Dir, RelOutputDir)
651 buildProject(Dir, SBOutputDir, ProjectBuildMode, IsReferenceBuild)
656 runCmpResults(Dir, Strictness)
661 (ID, (time.time()-TBegin))
700 Parser.add_argument('--strictness', dest='strictness', type=int, default=0,
704 Parser.add_argument('-r', dest='regenerate', action='store_true', default=False,
706 Parser.add_argument('-rs', dest='update_reference', action='store_true',