summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-10 23:03:31 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-10 23:07:19 +0300
commit24481e228f0d64f878b34b028c0dc03d2a4a5f7e (patch)
tree9bedb09bc3f05c89e0fba463f554aeccc7e08609
parente56747c574e3956504f0c62dd89a27e74bddb83d (diff)
downloadhercules-24481e228f0d64f878b34b028c0dc03d2a4a5f7e.tar.gz
hercules-24481e228f0d64f878b34b028c0dc03d2a4a5f7e.tar.bz2
hercules-24481e228f0d64f878b34b028c0dc03d2a4a5f7e.tar.xz
hercules-24481e228f0d64f878b34b028c0dc03d2a4a5f7e.zip
Add support for return error code if any error found.
-rwxr-xr-xtools/validateinterfaces.py5
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)