diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-11-10 23:03:31 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-11-10 23:07:19 +0300 |
commit | 24481e228f0d64f878b34b028c0dc03d2a4a5f7e (patch) | |
tree | 9bedb09bc3f05c89e0fba463f554aeccc7e08609 /tools/validateinterfaces.py | |
parent | e56747c574e3956504f0c62dd89a27e74bddb83d (diff) | |
download | hercules-24481e228f0d64f878b34b028c0dc03d2a4a5f7e.tar.gz hercules-24481e228f0d64f878b34b028c0dc03d2a4a5f7e.tar.bz2 hercules-24481e228f0d64f878b34b028c0dc03d2a4a5f7e.tar.xz hercules-24481e228f0d64f878b34b028c0dc03d2a4a5f7e.zip |
Add support for return error code if any error found.
Diffstat (limited to 'tools/validateinterfaces.py')
-rwxr-xr-x | tools/validateinterfaces.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/validateinterfaces.py b/tools/validateinterfaces.py index 6061b358b..8c794cb7c 100755 --- a/tools/validateinterfaces.py +++ b/tools/validateinterfaces.py @@ -9,7 +9,6 @@ import sys from sets import Set interfaceRe = re.compile("struct (?P<name1>[a-z_]+)_interface (?P<name2>[a-z_]+)_s;") -silent = False class Tracker: pass @@ -90,6 +89,7 @@ def checkIfFile(tracker, cFile, hFile): tracker.methods.add(ifname + "_" + method) if method not in cMethods: print "Missing initialisation in file {0}: {1}".format(cFile, method) + tracker.retCode = 1 # for method in cMethods: # if method not in hMethods: # print "Extra method in file {0}: {1}".format(cFile, method) @@ -157,8 +157,8 @@ def reportMethods(tracker): tracker = Tracker() tracker.arr = dict() tracker.methods = Set() +tracker.retCode = 0 if len(sys.argv) > 1 and sys.argv[1] == "silent": - silent = True processIfDir(tracker, "../src/char"); processIfDir(tracker, "../src/map"); processIfDir(tracker, "../src/login"); @@ -175,3 +175,4 @@ else: processDir(tracker, "../src/login"); processDir(tracker, "../src/common"); reportMethods(tracker) +exit(tracker.retCode) |