[all-commits] [llvm/llvm-project] 0d1a0f: Make test_symbols.py compare files line-by-line

kiranchandramohan via All-commits all-commits at lists.llvm.org
Fri Aug 20 10:28:59 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0d1a0f7e8de5a506c0bd409fc27e77fb733f7886
      https://github.com/llvm/llvm-project/commit/0d1a0f7e8de5a506c0bd409fc27e77fb733f7886
  Author: Ivan Zhechev <ivan.zhechev at arm.com>
  Date:   2021-08-20 (Fri, 20 Aug 2021)

  Changed paths:
    M flang/test/Semantics/test_symbols.py

  Log Message:
  -----------
  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 script.
Output before:

```
!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:

```
!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
```

Reviewed By: Meinersbur, awarzynski

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




More information about the All-commits mailing list