summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-16 14:00:14 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-02 14:23:49 +0300
commit2a4b30ef0802589aa2c646229bd9f83f41c398c8 (patch)
tree1597fa96ab30ac50bdfc918683fc4c6e0357cbcc /tools
parent16ef092d770f78637f336d926865c3f86eafc365 (diff)
downloadhercules-2a4b30ef0802589aa2c646229bd9f83f41c398c8.tar.gz
hercules-2a4b30ef0802589aa2c646229bd9f83f41c398c8.tar.bz2
hercules-2a4b30ef0802589aa2c646229bd9f83f41c398c8.tar.xz
hercules-2a4b30ef0802589aa2c646229bd9f83f41c398c8.zip
Add different command line actions to validateinterfaces.py.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/validateinterfaces.py52
1 files changed, 36 insertions, 16 deletions
diff --git a/tools/validateinterfaces.py b/tools/validateinterfaces.py
index a26e30ad2..c9a86979c 100755
--- a/tools/validateinterfaces.py
+++ b/tools/validateinterfaces.py
@@ -186,33 +186,53 @@ def processLostDir(tracker, srcDir):
elif file1[-2:] == ".c":
checkLostFile(tracker, cPath)
-tracker = Tracker()
-tracker.arr = dict()
-tracker.methods = Set()
-tracker.fullmethods = Set()
-tracker.interfaces = Set()
-tracker.retCode = 0
-
-if len(sys.argv) > 1 and sys.argv[1] == "silent":
+def runIf():
processIfDir(tracker, "../src/char");
processIfDir(tracker, "../src/map");
processIfDir(tracker, "../src/login");
processIfDir(tracker, "../src/common");
-else:
- print "Checking initerfaces initialisation"
- processIfDir(tracker, "../src/char");
- processIfDir(tracker, "../src/map");
- processIfDir(tracker, "../src/login");
- processIfDir(tracker, "../src/common");
- print "Checking not added functions to initerfaces"
+
+def runLost():
processLostDir(tracker, "../src/char");
processLostDir(tracker, "../src/map");
processLostDir(tracker, "../src/login");
processLostDir(tracker, "../src/common");
- print "Checking interfaces usage"
+
+def runLong():
processDir(tracker, "../src/char");
processDir(tracker, "../src/map");
processDir(tracker, "../src/login");
processDir(tracker, "../src/common");
reportMethods(tracker)
+
+tracker = Tracker()
+tracker.arr = dict()
+tracker.methods = Set()
+tracker.fullmethods = Set()
+tracker.interfaces = Set()
+tracker.retCode = 0
+
+if len(sys.argv) > 1:
+ cmd = sys.argv[1]
+else:
+ cmd = "default"
+
+if cmd == "silent":
+ runIf()
+elif cmd == "init":
+ print "Checking interfaces initialisation"
+ runIf()
+elif cmd == "lost":
+ print "Checking not added functions to interfaces"
+ runLost();
+elif cmd == "long":
+ print "Checking interfaces usage"
+ runLong();
+else:
+ print "Checking interfaces initialisation"
+ runIf()
+ print "Checking not added functions to interfaces"
+ runLost();
+ print "Checking interfaces usage"
+ runLong();
exit(tracker.retCode)