[PATCH] D139592: [llvm-lit] Keep start/end part of the output when truncating

Andrei Elovikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 9 12:00:33 PST 2022


a.elovikov added a comment.

I have troubles making it work... I'm adding `truncate.txt` next to `Inputs/shtest-output-printing/basic.txt` with content like this:

  # Verify that truncated output preserves both begin/end. The command needs to
  # fail.
  # RUN: not echo "Start             other output                             \n\
  # RUN: ---------------------------------------------------------------------\n\
  # RUN: ---------------------------------------------------------------------\n\
  # RUN: ---------------------------------------------------------------------\n\
  # RUN: ---------------------------------------------------------------------\n\
  # RUN: ---------------------------------------------------------------------\n\
  # RUN: ---------------------------------------------------------------------\n\
  # RUN: ---------------------------------------------------------------------\n\
  # RUN: ---------------------------------------------------------------------\n\
  # RUN: ---------------------------------------------------------------------\n\
  # RUN: ---------------------------------------------------------------------\n\
  # RUN: ---------------------------------------------------------------------\n\
  # RUN: ---------------------------------------------------------------------\n\
  # RUN: ---------------------------------------------------------------------\n\
  # RUN: ---------------------------------------------------------------------\n\
  # RUN: ---------------------------------------------------------------------\n\
  # RUN: ------------------------------------------------------End" >%t.out 2>&1

but then the output in `build/utils/lit/tests/Output/shtest-output-printing.py.tmp.out` is (long lines truncated with "$" symbol)

  ******************** TEST 'shtest-output-printing :: truncate.txt' FAILED ********************
  Script:
  --
  : 'RUN: at line 3';   not echo "Start             other output                             \n ---------------------------------------------------------------------\n -------------$
  --
  Exit Code: 127
  
  Command Output (stdout):
  --
  $ ":" "RUN: at line 3"
  $ "echo" "Start             other output                             \n ---------------------------------------------------------------------\n -----------------------------------$
  # command stderr:
  stdin and stderr redirects not supported for echo
  error: command failed with exit status: 127



  I think it might be due to "stdin and stderr redirects not supported for echo" but not sure...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139592



More information about the llvm-commits mailing list