Changeset 679c361 in mainline
- Timestamp:
- 2010-01-05T12:57:32Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ed63298
- Parents:
- 04c3a21f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/checkers/vcc.py
r04c3a21f r679c361 45 45 print prname + " <ROOT>" 46 46 47 def cygpath(upath): 48 "Convert Unix (Cygwin) path to Windows path" 49 50 return subprocess.Popen(['cygpath', '--windows', '--absolute', upath], stdout = subprocess.PIPE).communicate()[0].strip() 51 52 def preprocess(srcfname, tmpfname, base, options): 53 "Preprocess source using GCC preprocessor" 54 55 args = ['gcc', '-E'] 56 args.extend(options.split()) 57 args.extend(['-o', tmpfname, srcfname]) 58 59 cwd = os.getcwd() 60 os.chdir(base) 61 retval = subprocess.Popen(args).wait() 62 os.chdir(cwd) 63 64 if (retval != 0): 65 return False 66 67 return True 68 47 69 def vcc(root, job): 48 70 "Run Vcc on a jobfile" … … 80 102 return False 81 103 104 tmpfname = "%s.preproc" % srcfname 105 tmpfqname = os.path.join(base, tmpfname) 106 82 107 # Only C files are interesting for us 83 108 if (arg[2] != "cc"): 84 109 continue 85 110 86 # Run Stanse111 # Preprocess sources 87 112 88 retval = subprocess.Popen(['vcc', srcfqname]).wait() 113 if (not preprocess(srcfname, tmpfname, base, options)): 114 return False 115 116 # Run Vcc 117 118 retval = subprocess.Popen(['vcc', cygpath(tmpfqname)]).wait() 119 120 # Cleanup 121 122 if (os.path.isfile(tmpfqname)): 123 os.remove(tmpfqname) 89 124 90 125 if (retval != 0): 91 126 return False 92 127 93 return False128 return True 94 129 95 130 def main():
Note:
See TracChangeset
for help on using the changeset viewer.