From 2a4b30ef0802589aa2c646229bd9f83f41c398c8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 16 Nov 2014 14:00:14 +0300 Subject: Add different command line actions to validateinterfaces.py. --- tools/validateinterfaces.py | 52 +++++++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 16 deletions(-) (limited to 'tools') 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) -- cgit v1.2.3-60-g2f50