Fixed test scripts 73/48373/3
authorPawel Kubik <p.kubik@samsung.com>
Fri, 18 Sep 2015 12:41:31 +0000 (14:41 +0200)
committerPawel Kubik <p.kubik@samsung.com>
Fri, 18 Sep 2015 13:56:00 +0000 (15:56 +0200)
[Feature]       N/A
[Cause]         Unit tests using fixtures can't be run separately,
                because their names contains bash special characters.
[Solution]      Put test names inside quotes.
[Verification]  Install, launch single test case with fixture.

Change-Id: I61e426957e080b1a145bd901c155677775d571ba

tests/scripts/vsm_launch_test.py
tests/scripts/vsm_test_parser.py

index 038ba30..dd5831f 100755 (executable)
@@ -5,6 +5,7 @@ from vsm_test_parser import Logger, Parser
 import subprocess
 import argparse
 import os
+import re
 
 _defLaunchArgs = ["--report_format=XML",
                   "--catch_system_errors=no",
@@ -38,6 +39,10 @@ def launchTest(cmd=[], externalToolCmd=[], parsing=True):
     if externalToolCmd and not _checkIfBinExists(externalToolCmd[0]):
         return
 
+    cmd[1:] = ["'{0}'".format(arg) if re.search("^\s*[^']*/.*<.*>\s*$", arg)
+               else arg
+               for arg in cmd[1:]]
+
     log.info("Starting " + cmd[0] + " ...")
 
     if parsing:
index d0d4fa7..fc0eae6 100644 (file)
@@ -80,7 +80,7 @@ class Logger(object):
         commandPrefix = "vsm_launch_test.py " + bin + " -t "
         self.infoTitle("Some tests failed. Use following command(s) to launch them explicitly:")
         for test in self.__failedTests:
-            self.error(self.__indentChar + commandPrefix + test)
+            self.error(self.__indentChar + commandPrefix + "'{0}'".format(test))
 
     def terminatedBySignal(self, bin, signum):
         self.error("\n=========== FAILED ===========\n")