[llvm] r359690 - [lit][tests][AIX] Update expected form of diagnostic messages; use `not` to normalize non-zero exit values

Hubert Tong via llvm-commits llvm-commits at lists.llvm.org
Wed May 1 08:47:16 PDT 2019


Author: hubert.reinterpretcast
Date: Wed May  1 08:47:16 2019
New Revision: 359690

URL: http://llvm.org/viewvc/llvm-project?rev=359690&view=rev
Log:
[lit][tests][AIX] Update expected form of diagnostic messages; use `not` to normalize non-zero exit values

Summary:
Various tests in the `lit` testing suite expect specific return codes
and forms of diagnostic message from utility programs. As per
POSIX.1-2017 XCU Section 1.4, Utility Description Defaults, "[the]
format of diagnostic messages for most utilities is unspecified".
The STDERR subsections of the `cat` and `wc` utilities merely indicate
that "[the] standard error shall be used only for diagnostic messages".
The corresponding EXIT STATUS subsections merely indicate, with regard
to errors, an exit value of >0.

The affected tests are updated to accept the applicable diagnostic
message as produced by the utilities on AIX. The exit value is
normalized using `not` as necessary.

Reviewers: xingxue, sfertile, jasonliu

Reviewed By: xingxue

Subscribers: delcypher, jsji, llvm-commits

Tags: #llvm

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

Modified:
    llvm/trunk/utils/lit/tests/Inputs/shtest-output-printing/basic.txt
    llvm/trunk/utils/lit/tests/shtest-format.py
    llvm/trunk/utils/lit/tests/shtest-output-printing.py

Modified: llvm/trunk/utils/lit/tests/Inputs/shtest-output-printing/basic.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/tests/Inputs/shtest-output-printing/basic.txt?rev=359690&r1=359689&r2=359690&view=diff
==============================================================================
--- llvm/trunk/utils/lit/tests/Inputs/shtest-output-printing/basic.txt (original)
+++ llvm/trunk/utils/lit/tests/Inputs/shtest-output-printing/basic.txt Wed May  1 08:47:16 2019
@@ -1,3 +1,3 @@
 # RUN: true
 # RUN: echo hi
-# RUN: wc missing-file &> %t.out
+# RUN: not not wc missing-file &> %t.out

Modified: llvm/trunk/utils/lit/tests/shtest-format.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/tests/shtest-format.py?rev=359690&r1=359689&r2=359690&view=diff
==============================================================================
--- llvm/trunk/utils/lit/tests/shtest-format.py (original)
+++ llvm/trunk/utils/lit/tests/shtest-format.py Wed May  1 08:47:16 2019
@@ -18,7 +18,7 @@
 # CHECK-NEXT: line 2: failed test output on stdout
 # CHECK: Command Output (stderr):
 # CHECK-NEXT: --
-# CHECK-NEXT: cat{{(\.exe)?}}: does-not-exist: No such file or directory
+# CHECK-NEXT: cat{{(\.exe)?}}: {{cannot open does-not-exist|does-not-exist: No such file or directory}}
 # CHECK: --
 
 # CHECK: FAIL: shtest-format :: external_shell/fail_with_bad_encoding.txt

Modified: llvm/trunk/utils/lit/tests/shtest-output-printing.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/tests/shtest-output-printing.py?rev=359690&r1=359689&r2=359690&view=diff
==============================================================================
--- llvm/trunk/utils/lit/tests/shtest-output-printing.py (original)
+++ llvm/trunk/utils/lit/tests/shtest-output-printing.py Wed May  1 08:47:16 2019
@@ -24,8 +24,8 @@
 # CHECK-NEXT: hi
 #
 # CHECK:      $ ":" "RUN: at line 3"
-# CHECK-NEXT: $ "wc" "missing-file"
+# CHECK-NEXT: $ "not" "not" "wc" "missing-file"
 # CHECK-NEXT: # redirected output from '{{.*(/|\\\\)}}basic.txt.tmp.out':
-# CHECK-NEXT: missing-file{{.*}} No such file or directory
+# CHECK-NEXT: {{cannot open missing-file|missing-file.* No such file or directory}}
 # CHECK:      note: command had no output on stdout or stderr
 # CHECK-NEXT: error: command failed with exit status: 1




More information about the llvm-commits mailing list