Changeset 8565a42 in mainline for tools/checkers/stanse.py


Ignore:
Timestamp:
2018-03-02T20:34:50Z (7 years ago)
Author:
GitHub <noreply@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a1a81f69, d5e5fd1
Parents:
3061bc1 (diff), 34e1206 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:34:50)
git-committer:
GitHub <noreply@…> (2018-03-02 20:34:50)
Message:

Remove all trailing whitespace, everywhere.

See individual commit messages for details.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/checkers/stanse.py

    r3061bc1 r8565a42  
    4747def stanse(root, job):
    4848        "Run Stanse on a jobfile"
    49        
     49
    5050        # Convert generic jobfile to Stanse-specific jobfile format
    51        
     51
    5252        inname = os.path.join(root, job)
    5353        outname = os.path.join(root, "_%s" % os.path.basename(job))
    54        
     54
    5555        if (not os.path.isfile(inname)):
    5656                print("Unable to open %s" % inname)
    5757                print("Did you run \"make precheck\" on the source tree?")
    5858                return False
    59        
     59
    6060        inf = open(inname, "r")
    6161        records = inf.read().splitlines()
    6262        inf.close()
    63        
     63
    6464        output = []
    6565        for record in records:
     
    6767                if (not arg):
    6868                        return False
    69                
     69
    7070                if (len(arg) < 6):
    7171                        print("Not enough jobfile record arguments")
    7272                        return False
    73                
     73
    7474                srcfname = arg[0]
    7575                tgtfname = arg[1]
     
    7878                base = arg[4]
    7979                options = arg[5]
    80                
     80
    8181                srcfqname = os.path.join(base, srcfname)
    8282                if (not os.path.isfile(srcfqname)):
    8383                        print("Source %s not found" % srcfqname)
    8484                        return False
    85                
     85
    8686                # Only C files are interesting for us
    8787                if (tool != "cc"):
    8888                        continue
    89                
     89
    9090                output.append([srcfname, tgtfname, base, options])
    91        
     91
    9292        outf = open(outname, "w")
    9393        for record in output:
    9494                outf.write("{%s},{%s},{%s},{%s}\n" % (record[0], record[1], record[2], record[3]))
    9595        outf.close()
    96        
     96
    9797        # Run Stanse
    98        
     98
    9999        retval = subprocess.Popen(['stanse', '--checker', 'ReachabilityChecker', '--jobfile', outname]).wait()
    100        
     100
    101101        # Cleanup
    102        
     102
    103103        os.remove(outname)
    104104        for record in output:
     
    106106                if (os.path.isfile(tmpfile)):
    107107                        os.remove(tmpfile)
    108        
     108
    109109        if (retval == 0):
    110110                return True
    111        
     111
    112112        return False
    113113
     
    116116                usage(sys.argv[0])
    117117                return
    118        
     118
    119119        rootdir = os.path.abspath(sys.argv[1])
    120120        config = os.path.join(rootdir, "HelenOS.config")
    121        
     121
    122122        if (not os.path.isfile(config)):
    123123                print("%s not found." % config)
    124124                print("Please specify the path to HelenOS build tree root as the first argument.")
    125125                return
    126        
     126
    127127        for job in jobs:
    128128                if (not stanse(rootdir, job)):
     
    130130                        print("Failed job: %s" % job)
    131131                        return
    132        
     132
    133133        print
    134134        print("All jobs passed")
Note: See TracChangeset for help on using the changeset viewer.