Commit fbf40c07 authored by Andrea Valassi's avatar Andrea Valassi
Browse files

Fix the workaround for stderr checks in qmtest on Mac (CORALCOOL-2889)


git-svn-id: file:///git/lcgcool.svndb/cool/trunk@19973 4525493e-7705-40b1-a816-d608a930855b
parent 696bfa29
...@@ -629,27 +629,34 @@ class StandardTest(ShellCommandTest): ...@@ -629,27 +629,34 @@ class StandardTest(ShellCommandTest):
result.Fail("Program did not terminate normally.") result.Fail("Program did not terminate normally.")
def ValidateOutput(self, stdout, stderr, result): def ValidateOutput(self, stdout, stderr, result):
"""Overload ExectTestBase.ValidateOutput to skip the stdout check. """Copy of ExectTestBase.ValidateOutput, modified to skip stdout check.
This was previously achieved by modifying the ExecTestBase class in Replaces previous version ovearloading base class (see CORALCOOL-2114).
the qmtest installation: this patch allows the use of the default Needed to call private __CompareText for Mac 10.11 (CORALCOOL-2889).
qmtest (fixing bug #70804). It is enough to overload the method for Validate the output of the program.
this class StandardTest because it is the only class in COOL that 'stdout' -- A string containing the data written to the standard output
inherits from ExecTestBase or from one of its three derived classes stream.
ExecTest, ShellCommandTest and ShellScriptTest.""" 'stderr' -- A string containing the data written to the standard error
causes = ExecTestBase.ValidateOutput(self, stdout, stderr, result) stream.
if "standard output" in causes: causes.remove("standard output") 'result' -- A 'Result' object. It may be used to annotate
the outcome according to the content of stderr.
returns -- A list of strings giving causes of failure."""
causes = []
# Check to see if the standard output matches.
###if not self.__CompareText(stdout, self.stdout):
### causes.append("standard output")
### result["ExecTest.expected_stdout"] = result.Quote(self.stdout)
# Check to see if the standard error matches.
if not self.__CompareText(stderr, self.stderr):
causes.append("standard error")
result["ExecTest.expected_stderr"] = result.Quote(self.stderr)
return causes return causes
def __CompareText(self, s1, s2): # Called by ExecTestBase.ValidateOutput def __CompareText(self, s1, s2): # Called by ValidateOutput
"""Compare 's1' and 's2', ignoring line endings. """Compare 's1' and 's2', ignoring line endings.
's1' -- A string. 's1' -- A string.
's2' -- A string. 's2' -- A string.
returns -- True if 's1' and 's2' are the same, ignoring returns -- True if 's1' and 's2' are the same, ignoring
differences in line endings. differences in line endings.
This is the standard mode in which QMTest works """ This is the standard mode in which QMTest works """
# The "splitlines" method works independently of the line ending # The "splitlines" method works independently of the line ending
# convention in use. # convention in use.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment