Changes in tools/checkers/clang.py [6582b36:a35b458] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/checkers/clang.py
r6582b36 ra35b458 46 46 def clang(root, job): 47 47 "Run Clang on a jobfile" 48 48 49 49 inname = os.path.join(root, job) 50 50 51 51 if (not os.path.isfile(inname)): 52 52 print("Unable to open %s" % inname) 53 53 print("Did you run \"make precheck\" on the source tree?") 54 54 return False 55 55 56 56 inf = open(inname, "r") 57 57 records = inf.read().splitlines() 58 58 inf.close() 59 59 60 60 for record in records: 61 61 arg = jobfile.parse_arg(record) 62 62 if (not arg): 63 63 return False 64 64 65 65 if (len(arg) < 6): 66 66 print("Not enough jobfile record arguments") 67 67 return False 68 68 69 69 srcfname = arg[0] 70 70 tgtfname = arg[1] … … 73 73 base = arg[4] 74 74 options = arg[5].split() 75 75 76 76 srcfqname = os.path.join(base, srcfname) 77 77 if (not os.path.isfile(srcfqname)): 78 78 print("Source %s not found" % srcfqname) 79 79 return False 80 80 81 81 # Only C files are interesting for us 82 82 if (tool != "cc"): 83 83 continue 84 84 85 85 args = ['clang', '-Qunused-arguments', '--analyze', 86 86 '-Xanalyzer', '-analyzer-opt-analyze-headers', … … 88 88 args.extend(options) 89 89 args.extend(['-o', tgtfname, srcfname]) 90 90 91 91 cwd = os.getcwd() 92 92 os.chdir(base) 93 93 retval = subprocess.Popen(args).wait() 94 94 os.chdir(cwd) 95 95 96 96 if (retval != 0): 97 97 return False 98 98 99 99 return True 100 100 … … 103 103 usage(sys.argv[0]) 104 104 return 105 105 106 106 rootdir = os.path.abspath(sys.argv[1]) 107 107 config = os.path.join(rootdir, "HelenOS.config") 108 108 109 109 if (not os.path.isfile(config)): 110 110 print("%s not found." % config) 111 111 print("Please specify the path to HelenOS build tree root as the first argument.") 112 112 return 113 113 114 114 for job in jobs: 115 115 if (not clang(rootdir, job)): … … 117 117 print("Failed job: %s" % job) 118 118 return 119 119 120 120 print 121 121 print("All jobs passed")
Note:
See TracChangeset
for help on using the changeset viewer.