[all-commits] [llvm/llvm-project] 221e41: [lit] Make internal diff work in pipelines

Joel E. Denny via All-commits all-commits at lists.llvm.org
Thu Oct 17 07:01:32 PDT 2019

  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 221e418f0c56d6b4a8b188fb4d8e75e21f7b0c8d
  Author: Joel E. Denny <jdenny.ornl at gmail.com>
  Date:   2019-10-17 (Thu, 17 Oct 2019)

  Changed paths:
    M llvm/utils/lit/lit/TestRunner.py
    A llvm/utils/lit/lit/builtin_commands/diff.py
    R llvm/utils/lit/tests/Inputs/shtest-shell/diff-error-0.txt
    A llvm/utils/lit/tests/Inputs/shtest-shell/diff-pipes.txt
    R llvm/utils/lit/tests/Inputs/shtest-shell/diff-unified-error-0.txt
    R llvm/utils/lit/tests/Inputs/shtest-shell/diff-unified-error-1.txt
    M llvm/utils/lit/tests/Inputs/shtest-shell/diff-unified.txt
    M llvm/utils/lit/tests/max-failures.py
    M llvm/utils/lit/tests/shtest-shell.py

  Log Message:
  [lit] Make internal diff work in pipelines

When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal

 # RUN: program | diff file -
 # RUN: not diff file1 file2 | FileCheck %s

Such cases exist now, in `clang/test/Analysis` for example.  We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` cannot
currently be used in pipelines and doesn't recognize `-` as a
command-line option.

To enable pipelines, this patch moves lit's `diff` implementation into
an out-of-process script, similar to lit's `cat` implementation.  A
follow-up patch will implement `-` to mean stdin.

Reviewed By: probinson, stella.stamenova

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

llvm-svn: 375114

More information about the All-commits mailing list