[PATCH] D107954: [Flang] test_symbols.py formatting fix

Andrzej Warzynski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 12 05:39:30 PDT 2021


awarzynski added a comment.

Makes a lot of sense, but I would rephrase the summary a bit. Basically, you are making sure here that you are comparing the files line by line rather than the whole thing at a time. By making sure that the comparison is done line-by-line, you also make the output much nicer. Perhaps:

  Make test_symbols.py compare files line-by-line
  
  We currently feed full files to Python's unified_diff. It's not quite what we want though - line-by-line comparison makes more sense (we want to be able to identify missing/unnecessary lines) and is also easier to parse for humans. This patch makes sure that we compare one line at a time.
  
  This change pretties up the output formatting in the following way:
  Output before:
  
  --- after
  +++ before
  @@ -6,13 +6,13 @@
  !DEF:/m/s/xINTENT(IN)(Implicit)ObjectEntityREAL(4)
  !DEF:/m/s/yINTENT(INOUT)(Implicit)ObjectEntityREAL(4)
  -!-D-E-F-:-f-o-o-b-a-r-
  puresubroutines(x,y)bind(c)
  !REF:/m/s/x
  intent(in)::x
  
  Proposed output after:
  
  --- after
  +++ before
  @@ -6,13 +6,13 @@
  !DEF:/m/s/xINTENT(IN)(Implicit)ObjectEntityREAL(4)
  !DEF:/m/s/yINTENT(INOUT)(Implicit)ObjectEntityREAL(4)
  -!DEF:foobar
  puresubroutines(x,y)bind(c)
  !REF:/m/s/x
  intent(in)::x

What do you think? (btw, line numbers ^^^ need tweaking)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107954/new/

https://reviews.llvm.org/D107954



More information about the llvm-commits mailing list