Changeset a35b458 in mainline for tools/checkers/stanse.py
- Timestamp:
- 2018-03-02T20:10:49Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/checkers/stanse.py
r3061bc1 ra35b458 47 47 def stanse(root, job): 48 48 "Run Stanse on a jobfile" 49 49 50 50 # Convert generic jobfile to Stanse-specific jobfile format 51 51 52 52 inname = os.path.join(root, job) 53 53 outname = os.path.join(root, "_%s" % os.path.basename(job)) 54 54 55 55 if (not os.path.isfile(inname)): 56 56 print("Unable to open %s" % inname) 57 57 print("Did you run \"make precheck\" on the source tree?") 58 58 return False 59 59 60 60 inf = open(inname, "r") 61 61 records = inf.read().splitlines() 62 62 inf.close() 63 63 64 64 output = [] 65 65 for record in records: … … 67 67 if (not arg): 68 68 return False 69 69 70 70 if (len(arg) < 6): 71 71 print("Not enough jobfile record arguments") 72 72 return False 73 73 74 74 srcfname = arg[0] 75 75 tgtfname = arg[1] … … 78 78 base = arg[4] 79 79 options = arg[5] 80 80 81 81 srcfqname = os.path.join(base, srcfname) 82 82 if (not os.path.isfile(srcfqname)): 83 83 print("Source %s not found" % srcfqname) 84 84 return False 85 85 86 86 # Only C files are interesting for us 87 87 if (tool != "cc"): 88 88 continue 89 89 90 90 output.append([srcfname, tgtfname, base, options]) 91 91 92 92 outf = open(outname, "w") 93 93 for record in output: 94 94 outf.write("{%s},{%s},{%s},{%s}\n" % (record[0], record[1], record[2], record[3])) 95 95 outf.close() 96 96 97 97 # Run Stanse 98 98 99 99 retval = subprocess.Popen(['stanse', '--checker', 'ReachabilityChecker', '--jobfile', outname]).wait() 100 100 101 101 # Cleanup 102 102 103 103 os.remove(outname) 104 104 for record in output: … … 106 106 if (os.path.isfile(tmpfile)): 107 107 os.remove(tmpfile) 108 108 109 109 if (retval == 0): 110 110 return True 111 111 112 112 return False 113 113 … … 116 116 usage(sys.argv[0]) 117 117 return 118 118 119 119 rootdir = os.path.abspath(sys.argv[1]) 120 120 config = os.path.join(rootdir, "HelenOS.config") 121 121 122 122 if (not os.path.isfile(config)): 123 123 print("%s not found." % config) 124 124 print("Please specify the path to HelenOS build tree root as the first argument.") 125 125 return 126 126 127 127 for job in jobs: 128 128 if (not stanse(rootdir, job)): … … 130 130 print("Failed job: %s" % job) 131 131 return 132 132 133 133 print 134 134 print("All jobs passed")
Note:
See TracChangeset
for help on using the changeset viewer.