[all-commits] [llvm/llvm-project] e14447: Fix opt-viewer tests failing after move from cgi.e...

James Nagurne via All-commits all-commits at lists.llvm.org
Thu Apr 16 23:38:14 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e144474448b1e1b980ae219659824c61b1decdd7
      https://github.com/llvm/llvm-project/commit/e144474448b1e1b980ae219659824c61b1decdd7
  Author: James Nagurne <j-nagurne at ti.com>
  Date:   2020-04-17 (Fri, 17 Apr 2020)

  Changed paths:
    M llvm/test/tools/opt-viewer/Outputs/suppress/s.swift.html
    M llvm/test/tools/opt-viewer/Outputs/unicode-function-name/s.swift.html

  Log Message:
  -----------
  Fix opt-viewer tests failing after move from cgi.escape to html.escape

These two tests utilize pre-generated opt-viewer output to diff against
a run of opt-viewer over a known yaml file.

In commit 4b428e8f (D76126), the escape function used for rendering was changed
from cgi.escape to html.escape. This modification causes a behavioral
difference with regards to quote characters.

cgi will not escape quotes by default, but html will.

Therefore, these tests were failing because they expected the old behavior
of "string", but was instead seeing "string&quot.

This solution modifies the known test outputs to use the escaped quotes
rather than not escaping quotes during rendering for no particular reason.

It is notable that when testing the optimization records generated by
LLVM, there was never quotes in the remarks I could find, specifically in
the Callee field where they exist in the pre-generated yaml for testing.

Differential Revision: https://reviews.llvm.org/D78241




More information about the All-commits mailing list