[PATCH] Use Result.Quote in qmtc extensions
Nathaniel Smith
njs at pobox.com
Wed Mar 31 20:23:33 UTC 2004
Already committed.
-- Nathaniel
--
"...All of this suggests that if we wished to find a modern-day model
for British and American speech of the late eighteenth century, we could
probably do no better than Yosemite Sam."
-------------- next part --------------
Index: ChangeLog
===================================================================
RCS file: /home/qm/Repository/qmtc/ChangeLog,v
retrieving revision 1.24
diff -u -r1.24 ChangeLog
--- ChangeLog 7 Nov 2003 00:16:10 -0000 1.24
+++ ChangeLog 31 Mar 2004 20:22:33 -0000
@@ -1,3 +1,10 @@
+2004-03-31 Nathaniel Smith <njs at codesourcery.com>
+
+ * compiler_test.py (CompilerBase._QuoteForHTML): Remove.
+ (CompilerTest._RunExecutable): Use 'Result.Quote'.
+ (CompilerTest._CheckOutput): Use 'Result.Quote'.
+ (CompilerTest._DiagnosticsToString): Use 'Result.Quote'.
+
2003-11-06 Mark Mitchell <mark at codesourcery.com>
* compiler_test.py (CompilerTest._RunExecutable): Add support for
Index: compiler_test.py
===================================================================
RCS file: /home/qm/Repository/qmtc/compiler_test.py,v
retrieving revision 1.20
diff -u -r1.20 compiler_test.py
--- compiler_test.py 7 Nov 2003 00:16:02 -0000 1.20
+++ compiler_test.py 31 Mar 2004 20:22:33 -0000
@@ -186,18 +186,6 @@
return os.path.splitext(basename)[0] + object_extension
- def _QuoteForHTML(self, text):
-
- for t, h in (('&', '&'),
- ('<', '<'),
- ('>', '>'),
- ('"', """)):
- if text.find(t) >= 0:
- text = h.join(text.split(t))
-
- return text
-
-
class CompilerTest(Test, CompilerBase):
"""A 'CompilerTest' tests a compiler."""
@@ -374,8 +362,8 @@
environment = environment,
dir = self._GetDirectory())
# Remember the output streams.
- result[prefix + "stdout"] = "<pre>" + executable.stdout + "</pre>"
- result[prefix + "stderr"] = "<pre>" + executable.stderr + "</pre>"
+ result[prefix + "stdout"] = result.Quote(executable.stdout)
+ result[prefix + "stderr"] = result.Quote(executable.stderr)
# Check the output status.
self._CheckStatus(result, prefix, "Executable", status)
@@ -402,7 +390,7 @@
# Annotate the result with the output.
if output:
result[prefix + "output"] \
- = "<pre>" + self._QuoteForHTML(output) + "</pre>"
+ = result.Quote(output)
# Get the compiler to use to parse the output.
compiler = self._GetCompiler(context)
@@ -519,4 +507,4 @@
# Compute the string representation of each diagnostic.
diagnostic_strings = map(str, diagnostics)
# Insert a newline between each string.
- return "<pre>" + string.join(diagnostic_strings, '\n') + "</pre>"
+ return Result.Quote("\n".join(diagnostic_strings))
More information about the qmtest
mailing list