From 4267b196189990c9f3c9a483c8251e1635a426c1 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Tue, 6 Feb 2018 16:44:50 +0100 Subject: Fixed JS exception test failure (ICE-8640) Removed getCommandLineWithArgs from Util.py. It was introduced with the Matlab mapping but doesn't appear to be needed anymore. --- scripts/Util.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'scripts/Util.py') diff --git a/scripts/Util.py b/scripts/Util.py index 927350737a3..1ba1f80f452 100644 --- a/scripts/Util.py +++ b/scripts/Util.py @@ -916,9 +916,6 @@ class Mapping: else: return exe - def getCommandLineWithArgs(self, current, process, exe, args): - return self.getCommandLine(current, process, exe) + " " + args - def getProps(self, process, current): props = {} if isinstance(process, IceProcess): @@ -1215,9 +1212,6 @@ class Process(Runnable): def getCommandLine(self, current): return self.getMapping(current).getCommandLine(current, self, self.getExe(current)) - def getCommandLineWithArgs(self, current, args): - return self.getMapping(current).getCommandLineWithArgs(current, self, self.getExe(current), args) - # # A simple client (used to run Slice/IceUtil clients for example) # @@ -1926,8 +1920,8 @@ class LocalProcessController(ProcessController): if current.driver.valgrind: cmd += "valgrind -q --child-silent-after-fork=yes --leak-check=full --suppressions=\"{0}\" ".format( os.path.join(toplevel, "config", "valgrind.sup")) - exe = process.getCommandLineWithArgs(current, (" " + " ".join(args) if len(args) > 0 else "").format(**kargs)) - cmd += exe + exe = process.getCommandLine(current) + cmd += (exe + (" " + " ".join(args) if len(args) > 0 else "")).format(**kargs) if current.driver.debug: if len(envs) > 0: @@ -3352,12 +3346,11 @@ class MatlabMapping(CppBasedClientMapping): mappingName = "matlab" mappingDesc = "MATLAB" - def getCommandLineWithArgs(self, current, process, exe, args): - return "matlab -nodesktop -nosplash -wait -log -minimize -r \"cd '{0}', runTest {1} {2} {3}\"".format( + def getCommandLine(self, current, process, exe): + return "matlab -nodesktop -nosplash -wait -log -minimize -r \"cd '{0}', runTest {1} {2}\"".format( os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "matlab", "test", "lib")), self.getTestCwd(process, current), - os.path.join(current.config.buildPlatform, current.config.buildConfig), - args) + os.path.join(current.config.buildPlatform, current.config.buildConfig)) def getDefaultSource(self, processType): return { "client" : "client.m" }[processType] -- cgit v1.2.3 From 16e9a9e2981212a34f7f6b0c65ab7e3e4976899a Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Wed, 7 Feb 2018 09:00:30 +0100 Subject: Added support for ./allTests.py --rlanguages to exclude some language mappings from testing --- scripts/Util.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'scripts/Util.py') diff --git a/scripts/Util.py b/scripts/Util.py index 1ba1f80f452..90b36512364 100644 --- a/scripts/Util.py +++ b/scripts/Util.py @@ -2622,7 +2622,7 @@ class Driver: @classmethod def getSupportedArgs(self): return ("dlrR", ["debug", "driver=", "filter=", "rfilter=", "host=", "host-ipv6=", "host-bt=", "interface=", - "controller-app", "valgrind", "languages="]) + "controller-app", "valgrind", "languages=", "rlanguages="]) @classmethod def usage(self): @@ -2637,6 +2637,7 @@ class Driver: print("--filter= Run all the tests that match the given regex.") print("--rfilter= Run all the tests that do not match the given regex.") print("--languages=l1,l2,... List of comma-separated language mappings to test.") + print("--rlanguages=l1,l2,.. List of comma-separated language mappings to not test.") print("--host= The IPv4 address to use for Ice.Default.Host.") print("--host-ipv6= The IPv6 address to use for Ice.Default.Host.") print("--host-bt= The Bluetooth address to use for Ice.Default.Host.") @@ -2654,6 +2655,7 @@ class Driver: self.controllerApp = False self.valgrind = False self.languages = [] + self.rlanguages = [] self.failures = [] parseOptions(self, options, { "d": "debug", @@ -2669,6 +2671,8 @@ class Driver: self.rfilters = [re.compile(a) for a in self.rfilters] if self.languages: self.languages = [i for sublist in [l.split(",") for l in self.languages] for i in sublist] + if self.rlanguages: + self.rlanguages = [i for sublist in [l.split(",") for l in self.rlanguages] for i in sublist] self.communicator = None self.interface = "" @@ -2724,8 +2728,12 @@ class Driver: ### Return additional mappings to load required by the driver return [] - def getLanguages(self): - return self.languages + def matchLanguage(self, language): + if self.languages and language not in self.languages: + return False + if self.rlanguages and language in self.rlanguages: + return False + return True def getCommunicator(self): self.initCommunicator() @@ -3357,11 +3365,10 @@ class MatlabMapping(CppBasedClientMapping): def getOptions(self, current): # - # Metrics tests configuration not supported with MATLAB - # they use the Admin adapter. + # Metrics tests configuration not supported with MATLAB they use the Admin adapter. # options = CppBasedClientMapping.getOptions(self, current) - options["mx"] = [False] + options["mx"] = [ False ] return options class JavaScriptMapping(Mapping): @@ -3554,8 +3561,7 @@ def runTests(mappings=None, drivers=None): driver = Driver.create(opts) # - # Create the configurations for each mapping (we always parse the configuration for the - # python mapping because we might use the local IcePy build to initialize a communicator). + # Create the configurations for each mapping. # configs = {} for mapping in Mapping.getAll(): @@ -3563,10 +3569,9 @@ def runTests(mappings=None, drivers=None): configs[mapping] = mapping.createConfig(opts[:]) # - # If the user specified --languages, only run matching mappings. + # If the user specified --languages/rlanguages, only run matching mappings. # - if driver.getLanguages(): - mappings = [Mapping.getByName(l) for l in driver.getLanguages()] + mappings = [m for m in mappings if driver.matchLanguage(str(m))] # # Provide the configurations to the driver and load the test suites for each mapping. -- cgit v1.2.3 From ce4b7fd5d14875d7dabd5121f2b35cd99dfd13ec Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Thu, 8 Feb 2018 10:01:56 +0100 Subject: Add Matlab mapping only if matlab is installed --- scripts/Util.py | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'scripts/Util.py') diff --git a/scripts/Util.py b/scripts/Util.py index 90b36512364..ec651ef6f1e 100644 --- a/scripts/Util.py +++ b/scripts/Util.py @@ -3474,16 +3474,6 @@ except ImportError: from LocalDriver import * -# -# Check if the Android SDK is installed by looking for adb -# -hasAndroidSDK=False -try: - run("adb version") - hasAndroidSDK=True -except: - pass - # # Supported mappings # @@ -3500,8 +3490,6 @@ for m in filter(lambda x: os.path.isdir(os.path.join(toplevel, x)), os.listdir(t Mapping.add(m, RubyMapping()) elif m == "php" or re.match("php-.*", m): Mapping.add(m, PhpMapping()) - elif m == "matlab" or re.match("matlab-.*", m): - Mapping.add(m, MatlabMapping()) elif m == "js" or re.match("js-.*", m): Mapping.add(m, JavaScriptMapping()) elif m == "csharp" or re.match("csharp-.*", m): @@ -3509,9 +3497,24 @@ for m in filter(lambda x: os.path.isdir(os.path.join(toplevel, x)), os.listdir(t elif m == "objective-c" or re.match("objective-c-*", m): Mapping.add(m, ObjCMapping()) -if hasAndroidSDK: +# +# Check if the Android SDK is installed and eventually add the Android mappings +# +try: + run("adb version") Mapping.add(os.path.join("java-compat", "android"), AndroidCompatMapping()) Mapping.add(os.path.join("java", "android"), AndroidMapping()) +except: + pass + +# +# Check if Matlab is installed and eventually add the Matlab mapping +# +try: + run("matlab -help") + Mapping.add("matlab", MatlabMapping()) +except: + pass def runTestsWithPath(path): runTests([Mapping.getByPath(path)]) -- cgit v1.2.3 From d4bf91f364f65869102419205879117e6469aafe Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Thu, 8 Feb 2018 17:01:51 +0100 Subject: Fixed matlab check for testing --- scripts/Util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/Util.py') diff --git a/scripts/Util.py b/scripts/Util.py index ec651ef6f1e..21f86b5beff 100644 --- a/scripts/Util.py +++ b/scripts/Util.py @@ -3511,7 +3511,7 @@ except: # Check if Matlab is installed and eventually add the Matlab mapping # try: - run("matlab -help") + run("where matlab" if isinstance(platform, Windows) else "which matlab") Mapping.add("matlab", MatlabMapping()) except: pass -- cgit v1.2.3