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):
result.Fail("Program did not terminate normally.")
def ValidateOutput(self, stdout, stderr, result):
"""Overload ExectTestBase.ValidateOutput to skip the stdout check.
This was previously achieved by modifying the ExecTestBase class in
the qmtest installation: this patch allows the use of the default
qmtest (fixing bug #70804). It is enough to overload the method for
this class StandardTest because it is the only class in COOL that
inherits from ExecTestBase or from one of its three derived classes
ExecTest, ShellCommandTest and ShellScriptTest."""
causes = ExecTestBase.ValidateOutput(self, stdout, stderr, result)
if "standard output" in causes: causes.remove("standard output")
"""Copy of ExectTestBase.ValidateOutput, modified to skip stdout check.
Replaces previous version ovearloading base class (see CORALCOOL-2114).
Needed to call private __CompareText for Mac 10.11 (CORALCOOL-2889).
Validate the output of the program.
'stdout' -- A string containing the data written to the standard output
stream.
'stderr' -- A string containing the data written to the standard error
stream.
'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
def __CompareText(self, s1, s2): # Called by ExecTestBase.ValidateOutput
def __CompareText(self, s1, s2): # Called by ValidateOutput
"""Compare 's1' and 's2', ignoring line endings.
's1' -- A string.
's2' -- A string.
returns -- True if 's1' and 's2' are the same, ignoring
differences in line endings.
This is the standard mode in which QMTest works """
# The "splitlines" method works independently of the line ending
# 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