[lit] Fix internal diff newlines for -w/-b
authorJoel E. Denny <jdenny.ornl@gmail.com>
Tue, 17 Dec 2019 15:23:11 +0000 (10:23 -0500)
committerJoel E. Denny <jdenny.ornl@gmail.com>
Tue, 17 Dec 2019 15:49:34 +0000 (10:49 -0500)
commit9658e77e27fa2a93667f840d230086d783fed6dc
tree317dc5a1d7e4a289df48635f87c76179d5257036
parentfbaf835c5c515bf00dccd880b8afe0b2e0a10e06
[lit] Fix internal diff newlines for -w/-b

For example, without this patch:

```
$ python $LIT_BUILTINS/diff.py -b foo.txt bar.txt
*** /tmp/foo.txt
--- /tmp/bar.txt
***************
*** 1,2 ****
  1! 2--- 1,2 ----
  1! 20
```

With this patch:

```
$ python $LIT_BUILTINS/diff.py -b foo.txt bar.txt
*** /tmp/foo.txt
--- /tmp/bar.txt
***************
*** 1,2 ****
  1
! 2
--- 1,2 ----
  1
! 20
```

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D71577
llvm/utils/lit/lit/builtin_commands/diff.py
llvm/utils/lit/tests/Inputs/shtest-shell/diff-b.txt [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/shtest-shell/diff-w.txt [new file with mode: 0644]
llvm/utils/lit/tests/max-failures.py
llvm/utils/lit/tests/shtest-shell.py