[llvm] [llvm-lit] Resolve env subcommand required error (PR #98414)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 09:49:44 PDT 2024


https://github.com/Harini0924 updated https://github.com/llvm/llvm-project/pull/98414

>From bd4f8975b8374e8e242c66834f38f2a0099dcec0 Mon Sep 17 00:00:00 2001
From: Harini <harinidonthula at google.com>
Date: Wed, 10 Jul 2024 23:22:04 +0000
Subject: [PATCH 1/7] [llvm-lit]

When executing not --crash env without any arguments,
it fails with exit code 127 because env reuires a
subcommand. This path addresses the issue by encoding
the command to properly return environment variables
even when no arguments are provided.
---
 llvm/utils/lit/lit/TestRunner.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index da7fa86fd3917..8f0cd801ae9ff 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -743,7 +743,8 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
                     cmd_shenv = ShellEnvironment(shenv.cwd, shenv.env)
                 args = updateEnv(cmd_shenv, args)
                 if not args:
-                    raise InternalShellError(j, "Error: 'env' requires a" " subcommand")
+                    # Return the environment variables if no argument is provided 
+                    return {key: value for key, value in cmd_shenv.env.items()}
             elif args[0] == "not":
                 not_args.append(args.pop(0))
                 not_count += 1

>From a44f93b5579214d3269903e76ae3020e307f00f8 Mon Sep 17 00:00:00 2001
From: Harini <harinidonthula at google.com>
Date: Thu, 18 Jul 2024 07:13:21 +0000
Subject: [PATCH 2/7] [llvm-lit] Resolve env subcommand required error

This patch addresses an issue where calling env without any arguments incorrectly returns
a "requires subcommand" message. The patch modifies the env command to properly display
the current environment variables even when no arguments are provided. Additionally,
the test cases have been updated: instead of returning an error, the tests now pass
and check if the environment variables are output correctly.
---
 llvm/utils/lit/lit/TestRunner.py              |  4 ++-
 .../tests/Inputs/shtest-env/env-args-none.txt | 31 ++++++++++++++++++-
 llvm/utils/lit/tests/shtest-env.py            | 30 +++++++++---------
 3 files changed, 48 insertions(+), 17 deletions(-)

diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index 8f0cd801ae9ff..da541c6b742a3 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -744,7 +744,9 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
                 args = updateEnv(cmd_shenv, args)
                 if not args:
                     # Return the environment variables if no argument is provided 
-                    return {key: value for key, value in cmd_shenv.env.items()}
+                    env_str = "\n".join(f"{key}={value}" for key, value in cmd_shenv.env.items())
+                    results.append(ShellCommandResult(j, env_str, "", 0 , timeoutHelper.timeoutReached(), []))
+                    return 0
             elif args[0] == "not":
                 not_args.append(args.pop(0))
                 not_count += 1
diff --git a/llvm/utils/lit/tests/Inputs/shtest-env/env-args-none.txt b/llvm/utils/lit/tests/Inputs/shtest-env/env-args-none.txt
index dc5cdbad09afc..0eb724a2101c3 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-env/env-args-none.txt
+++ b/llvm/utils/lit/tests/Inputs/shtest-env/env-args-none.txt
@@ -1 +1,30 @@
-# RUN: env
+# Check Default Environment
+# RUN: env | FileCheck -check-prefix=CHECK-2-EMPTY %s
+#
+# CHECK-2-EMPTY: BAR = 2
+# CHECK-2-EMPTY: FOO = 1
+
+# Set Environment Variables
+# RUN: env FOO=2 BAR=1 | FileCheck -check-prefix=CHECK-2-VAL %s
+#
+# CHECK-2-VAL: BAR = 1
+# CHECK-2-VAL: FOO = 2
+
+# Unset Environment Variables
+# RUN: env -u FOO -u BAR | FileCheck -check-prefix=CHECK-2-U %s
+#
+# CHECK-2-U-NOT: BAR
+# CHECK-2-U-NOT: FOO
+
+# Mixed Set and Unset Environment Variables
+# RUN: env -u FOO BAR=1 -u BAR FOO=2 | FileCheck -check-prefix=CHECK-2-U-VAL %s
+#
+# CHECK-2-U-VAL-NOT: BAR
+# CHECK-2-U-VAL: FOO = 2
+ 
+# Mixed Set and Unset with Additional Variable
+# RUN: env -u FOO BAR=1 -u BAR FOO=2 BAZ=3 | FileCheck -check-prefix=CHECK-3 %s
+#
+# CHECK-3-NOT: BAR
+# CHECK-3: BAZ = 3
+# CHECK-3: FOO = 2
diff --git a/llvm/utils/lit/tests/shtest-env.py b/llvm/utils/lit/tests/shtest-env.py
index 03bb4a3cae7dd..61ee9bc7d21ac 100644
--- a/llvm/utils/lit/tests/shtest-env.py
+++ b/llvm/utils/lit/tests/shtest-env.py
@@ -9,35 +9,35 @@
 
 # CHECK: -- Testing: 16 tests{{.*}}
 
-# CHECK: FAIL: shtest-env :: env-args-last-is-assign.txt ({{[^)]*}})
+# CHECK: PASS: shtest-env :: env-args-last-is-assign.txt ({{[^)]*}})
 # CHECK: env FOO=1
 # CHECK: # executed command: env FOO=1
-# CHECK: # | Error: 'env' requires a subcommand
-# CHECK: # error: command failed with exit status: {{.*}}
+# CHECK-NOT: {{^[^#]}} 
+# CHECK: --
 
-# CHECK: FAIL: shtest-env :: env-args-last-is-u-arg.txt ({{[^)]*}})
+# CHECK: PASS: shtest-env :: env-args-last-is-u-arg.txt ({{[^)]*}})
 # CHECK: env -u FOO
 # CHECK: # executed command: env -u FOO
-# CHECK: # | Error: 'env' requires a subcommand
-# CHECK: # error: command failed with exit status: {{.*}}
+# CHECK-NOT: {{^[^#]}} 
+# CHECK: --
 
-# CHECK: FAIL: shtest-env :: env-args-last-is-u.txt ({{[^)]*}})
+# CHECK: PASS: shtest-env :: env-args-last-is-u.txt ({{[^)]*}})
 # CHECK: env -u
 # CHECK: # executed command: env -u
-# CHECK: # | Error: 'env' requires a subcommand
-# CHECK: # error: command failed with exit status: {{.*}}
+# CHECK-NOT: {{^[^#]}}
+# CHECK: --
 
-# CHECK: FAIL: shtest-env :: env-args-nested-none.txt ({{[^)]*}})
+# CHECK: PASS: shtest-env :: env-args-nested-none.txt ({{[^)]*}})
 # CHECK: env env env
 # CHECK: # executed command: env env env
-# CHECK: # | Error: 'env' requires a subcommand
-# CHECK: # error: command failed with exit status: {{.*}}
+# CHECK-NOT: {{^[^#]}}
+# CHECK: --
 
-# CHECK: FAIL: shtest-env :: env-args-none.txt ({{[^)]*}})
+# CHECK: PASS: shtest-env :: env-args-none.txt ({{[^)]*}})
 # CHECK: env
 # CHECK: # executed command: env
-# CHECK: # | Error: 'env' requires a subcommand
-# CHECK: # error: command failed with exit status: {{.*}}
+# CHECK-NOT: {{^[^#]}}
+# CHECK: --
 
 # CHECK: FAIL: shtest-env :: env-calls-cd.txt ({{[^)]*}})
 # CHECK: env -u FOO BAR=3 cd foobar

>From cded1a6df0b51d2206ca443a3f42a13392fa9de8 Mon Sep 17 00:00:00 2001
From: Harini <harinidonthula at google.com>
Date: Thu, 18 Jul 2024 07:16:05 +0000
Subject: [PATCH 3/7] [llvm-lit] Resolve env subcommand required error

This patch addresses an issue where calling env without any arguments incorrectly returns
a "requires subcommand" message. The patch modifies the env command to properly display
the current environment variables even when no arguments are provided. Additionally, the
test cases have been updated: instead of returning an error, the tests now pass and check
if the environment variables are output correctly.
---
 llvm/utils/lit/tests/shtest-env.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/utils/lit/tests/shtest-env.py b/llvm/utils/lit/tests/shtest-env.py
index 61ee9bc7d21ac..7e6ad751a7a3d 100644
--- a/llvm/utils/lit/tests/shtest-env.py
+++ b/llvm/utils/lit/tests/shtest-env.py
@@ -121,6 +121,6 @@
 # CHECK: --
 
 # CHECK: Total Discovered Tests: 16
-# CHECK: Passed:  4 {{\([0-9]*\.[0-9]*%\)}}
-# CHECK: Failed: 12 {{\([0-9]*\.[0-9]*%\)}}
+# CHECK: Passed:  9 {{\([0-9]*\.[0-9]*%\)}}
+# CHECK: Failed: 7 {{\([0-9]*\.[0-9]*%\)}}
 # CHECK-NOT: {{.}}

>From 94d958a1cec6dec59a3dfaa4797aa60900eee4b6 Mon Sep 17 00:00:00 2001
From: Harini <harinidonthula at google.com>
Date: Thu, 18 Jul 2024 07:20:00 +0000
Subject: [PATCH 4/7] hi

---
 llvm/utils/lit/lit/TestRunner.py   | 2 +-
 llvm/utils/lit/tests/shtest-env.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index da541c6b742a3..b98e92071508f 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+rom __future__ import absolute_import
 import errno
 import io
 import itertools
diff --git a/llvm/utils/lit/tests/shtest-env.py b/llvm/utils/lit/tests/shtest-env.py
index 7e6ad751a7a3d..96284c99fe5a1 100644
--- a/llvm/utils/lit/tests/shtest-env.py
+++ b/llvm/utils/lit/tests/shtest-env.py
@@ -1,4 +1,4 @@
-# Check the env command
+ Check the env command
 
 # RUN: not %{lit} -a -v %{inputs}/shtest-env \
 # RUN: | FileCheck -match-full-lines %s

>From e359516da66681e2050995e3df2f4318c139d6c2 Mon Sep 17 00:00:00 2001
From: Harini <harinidonthula at google.com>
Date: Thu, 18 Jul 2024 07:21:14 +0000
Subject: [PATCH 5/7] [llvm-lit] Resolve env subcommand required error

This patch addresses an issue where calling env without any arguments incorrectly returns a "requires subcommand" message. The patch modifies the env command to properly display the current environment variables even when no arguments are provided. Additionally, the test cases have been updated: instead of returning an error, the tests now pass and check if the environment variables are output correctly.
---
 llvm/utils/lit/lit/TestRunner.py   | 2 +-
 llvm/utils/lit/tests/shtest-env.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index b98e92071508f..da541c6b742a3 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -1,4 +1,4 @@
-rom __future__ import absolute_import
+from __future__ import absolute_import
 import errno
 import io
 import itertools
diff --git a/llvm/utils/lit/tests/shtest-env.py b/llvm/utils/lit/tests/shtest-env.py
index 96284c99fe5a1..7e6ad751a7a3d 100644
--- a/llvm/utils/lit/tests/shtest-env.py
+++ b/llvm/utils/lit/tests/shtest-env.py
@@ -1,4 +1,4 @@
- Check the env command
+# Check the env command
 
 # RUN: not %{lit} -a -v %{inputs}/shtest-env \
 # RUN: | FileCheck -match-full-lines %s

>From 3a9a91985236b91e9728d980b1fce0332af88f43 Mon Sep 17 00:00:00 2001
From: Harini <harinidonthula at google.com>
Date: Thu, 18 Jul 2024 07:43:16 +0000
Subject: [PATCH 6/7] [llvm-lit] Resolve env subcommand required error

This patch addresses an issue where calling env without any arguments incorrectly
returns a "requires subcommand" message. The patch modifies the env command to
properly display the current environment variables even when no arguments are provided.
Additionally, the test cases have been updated: instead of returning an error, the tests
now pass and check if the environment variables are output correctly.
---
 llvm/utils/lit/lit/TestRunner.py              |  4 +--
 .../tests/Inputs/shtest-env/env-args-none.txt | 31 +----------------
 llvm/utils/lit/tests/shtest-env.py            | 34 +++++++++----------
 3 files changed, 19 insertions(+), 50 deletions(-)

diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index da541c6b742a3..8f0cd801ae9ff 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -744,9 +744,7 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
                 args = updateEnv(cmd_shenv, args)
                 if not args:
                     # Return the environment variables if no argument is provided 
-                    env_str = "\n".join(f"{key}={value}" for key, value in cmd_shenv.env.items())
-                    results.append(ShellCommandResult(j, env_str, "", 0 , timeoutHelper.timeoutReached(), []))
-                    return 0
+                    return {key: value for key, value in cmd_shenv.env.items()}
             elif args[0] == "not":
                 not_args.append(args.pop(0))
                 not_count += 1
diff --git a/llvm/utils/lit/tests/Inputs/shtest-env/env-args-none.txt b/llvm/utils/lit/tests/Inputs/shtest-env/env-args-none.txt
index 0eb724a2101c3..dc5cdbad09afc 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-env/env-args-none.txt
+++ b/llvm/utils/lit/tests/Inputs/shtest-env/env-args-none.txt
@@ -1,30 +1 @@
-# Check Default Environment
-# RUN: env | FileCheck -check-prefix=CHECK-2-EMPTY %s
-#
-# CHECK-2-EMPTY: BAR = 2
-# CHECK-2-EMPTY: FOO = 1
-
-# Set Environment Variables
-# RUN: env FOO=2 BAR=1 | FileCheck -check-prefix=CHECK-2-VAL %s
-#
-# CHECK-2-VAL: BAR = 1
-# CHECK-2-VAL: FOO = 2
-
-# Unset Environment Variables
-# RUN: env -u FOO -u BAR | FileCheck -check-prefix=CHECK-2-U %s
-#
-# CHECK-2-U-NOT: BAR
-# CHECK-2-U-NOT: FOO
-
-# Mixed Set and Unset Environment Variables
-# RUN: env -u FOO BAR=1 -u BAR FOO=2 | FileCheck -check-prefix=CHECK-2-U-VAL %s
-#
-# CHECK-2-U-VAL-NOT: BAR
-# CHECK-2-U-VAL: FOO = 2
- 
-# Mixed Set and Unset with Additional Variable
-# RUN: env -u FOO BAR=1 -u BAR FOO=2 BAZ=3 | FileCheck -check-prefix=CHECK-3 %s
-#
-# CHECK-3-NOT: BAR
-# CHECK-3: BAZ = 3
-# CHECK-3: FOO = 2
+# RUN: env
diff --git a/llvm/utils/lit/tests/shtest-env.py b/llvm/utils/lit/tests/shtest-env.py
index 7e6ad751a7a3d..03bb4a3cae7dd 100644
--- a/llvm/utils/lit/tests/shtest-env.py
+++ b/llvm/utils/lit/tests/shtest-env.py
@@ -9,35 +9,35 @@
 
 # CHECK: -- Testing: 16 tests{{.*}}
 
-# CHECK: PASS: shtest-env :: env-args-last-is-assign.txt ({{[^)]*}})
+# CHECK: FAIL: shtest-env :: env-args-last-is-assign.txt ({{[^)]*}})
 # CHECK: env FOO=1
 # CHECK: # executed command: env FOO=1
-# CHECK-NOT: {{^[^#]}} 
-# CHECK: --
+# CHECK: # | Error: 'env' requires a subcommand
+# CHECK: # error: command failed with exit status: {{.*}}
 
-# CHECK: PASS: shtest-env :: env-args-last-is-u-arg.txt ({{[^)]*}})
+# CHECK: FAIL: shtest-env :: env-args-last-is-u-arg.txt ({{[^)]*}})
 # CHECK: env -u FOO
 # CHECK: # executed command: env -u FOO
-# CHECK-NOT: {{^[^#]}} 
-# CHECK: --
+# CHECK: # | Error: 'env' requires a subcommand
+# CHECK: # error: command failed with exit status: {{.*}}
 
-# CHECK: PASS: shtest-env :: env-args-last-is-u.txt ({{[^)]*}})
+# CHECK: FAIL: shtest-env :: env-args-last-is-u.txt ({{[^)]*}})
 # CHECK: env -u
 # CHECK: # executed command: env -u
-# CHECK-NOT: {{^[^#]}}
-# CHECK: --
+# CHECK: # | Error: 'env' requires a subcommand
+# CHECK: # error: command failed with exit status: {{.*}}
 
-# CHECK: PASS: shtest-env :: env-args-nested-none.txt ({{[^)]*}})
+# CHECK: FAIL: shtest-env :: env-args-nested-none.txt ({{[^)]*}})
 # CHECK: env env env
 # CHECK: # executed command: env env env
-# CHECK-NOT: {{^[^#]}}
-# CHECK: --
+# CHECK: # | Error: 'env' requires a subcommand
+# CHECK: # error: command failed with exit status: {{.*}}
 
-# CHECK: PASS: shtest-env :: env-args-none.txt ({{[^)]*}})
+# CHECK: FAIL: shtest-env :: env-args-none.txt ({{[^)]*}})
 # CHECK: env
 # CHECK: # executed command: env
-# CHECK-NOT: {{^[^#]}}
-# CHECK: --
+# CHECK: # | Error: 'env' requires a subcommand
+# CHECK: # error: command failed with exit status: {{.*}}
 
 # CHECK: FAIL: shtest-env :: env-calls-cd.txt ({{[^)]*}})
 # CHECK: env -u FOO BAR=3 cd foobar
@@ -121,6 +121,6 @@
 # CHECK: --
 
 # CHECK: Total Discovered Tests: 16
-# CHECK: Passed:  9 {{\([0-9]*\.[0-9]*%\)}}
-# CHECK: Failed: 7 {{\([0-9]*\.[0-9]*%\)}}
+# CHECK: Passed:  4 {{\([0-9]*\.[0-9]*%\)}}
+# CHECK: Failed: 12 {{\([0-9]*\.[0-9]*%\)}}
 # CHECK-NOT: {{.}}

>From 4990d398ca41a7d3efd4dc27630962125bbb0d5e Mon Sep 17 00:00:00 2001
From: Harini <harinidonthula at google.com>
Date: Thu, 18 Jul 2024 07:13:21 +0000
Subject: [PATCH 7/7] [llvm-lit] Resolve env subcommand required error

This patch addresses an issue where calling env without any arguments incorrectly returns
a "requires subcommand" message. The patch modifies the env command to properly display
the current environment variables even when no arguments are provided. Additionally,
the test cases have been updated: instead of returning an error, the tests now pass
and check if the environment variables are output correctly.
---
 llvm/utils/lit/lit/TestRunner.py              |  4 ++-
 .../tests/Inputs/shtest-env/env-args-none.txt | 31 ++++++++++++++++-
 llvm/utils/lit/tests/shtest-env.py            | 34 +++++++++----------
 3 files changed, 50 insertions(+), 19 deletions(-)

diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index 8f0cd801ae9ff..da541c6b742a3 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -744,7 +744,9 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
                 args = updateEnv(cmd_shenv, args)
                 if not args:
                     # Return the environment variables if no argument is provided 
-                    return {key: value for key, value in cmd_shenv.env.items()}
+                    env_str = "\n".join(f"{key}={value}" for key, value in cmd_shenv.env.items())
+                    results.append(ShellCommandResult(j, env_str, "", 0 , timeoutHelper.timeoutReached(), []))
+                    return 0
             elif args[0] == "not":
                 not_args.append(args.pop(0))
                 not_count += 1
diff --git a/llvm/utils/lit/tests/Inputs/shtest-env/env-args-none.txt b/llvm/utils/lit/tests/Inputs/shtest-env/env-args-none.txt
index dc5cdbad09afc..0eb724a2101c3 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-env/env-args-none.txt
+++ b/llvm/utils/lit/tests/Inputs/shtest-env/env-args-none.txt
@@ -1 +1,30 @@
-# RUN: env
+# Check Default Environment
+# RUN: env | FileCheck -check-prefix=CHECK-2-EMPTY %s
+#
+# CHECK-2-EMPTY: BAR = 2
+# CHECK-2-EMPTY: FOO = 1
+
+# Set Environment Variables
+# RUN: env FOO=2 BAR=1 | FileCheck -check-prefix=CHECK-2-VAL %s
+#
+# CHECK-2-VAL: BAR = 1
+# CHECK-2-VAL: FOO = 2
+
+# Unset Environment Variables
+# RUN: env -u FOO -u BAR | FileCheck -check-prefix=CHECK-2-U %s
+#
+# CHECK-2-U-NOT: BAR
+# CHECK-2-U-NOT: FOO
+
+# Mixed Set and Unset Environment Variables
+# RUN: env -u FOO BAR=1 -u BAR FOO=2 | FileCheck -check-prefix=CHECK-2-U-VAL %s
+#
+# CHECK-2-U-VAL-NOT: BAR
+# CHECK-2-U-VAL: FOO = 2
+ 
+# Mixed Set and Unset with Additional Variable
+# RUN: env -u FOO BAR=1 -u BAR FOO=2 BAZ=3 | FileCheck -check-prefix=CHECK-3 %s
+#
+# CHECK-3-NOT: BAR
+# CHECK-3: BAZ = 3
+# CHECK-3: FOO = 2
diff --git a/llvm/utils/lit/tests/shtest-env.py b/llvm/utils/lit/tests/shtest-env.py
index 03bb4a3cae7dd..7e6ad751a7a3d 100644
--- a/llvm/utils/lit/tests/shtest-env.py
+++ b/llvm/utils/lit/tests/shtest-env.py
@@ -9,35 +9,35 @@
 
 # CHECK: -- Testing: 16 tests{{.*}}
 
-# CHECK: FAIL: shtest-env :: env-args-last-is-assign.txt ({{[^)]*}})
+# CHECK: PASS: shtest-env :: env-args-last-is-assign.txt ({{[^)]*}})
 # CHECK: env FOO=1
 # CHECK: # executed command: env FOO=1
-# CHECK: # | Error: 'env' requires a subcommand
-# CHECK: # error: command failed with exit status: {{.*}}
+# CHECK-NOT: {{^[^#]}} 
+# CHECK: --
 
-# CHECK: FAIL: shtest-env :: env-args-last-is-u-arg.txt ({{[^)]*}})
+# CHECK: PASS: shtest-env :: env-args-last-is-u-arg.txt ({{[^)]*}})
 # CHECK: env -u FOO
 # CHECK: # executed command: env -u FOO
-# CHECK: # | Error: 'env' requires a subcommand
-# CHECK: # error: command failed with exit status: {{.*}}
+# CHECK-NOT: {{^[^#]}} 
+# CHECK: --
 
-# CHECK: FAIL: shtest-env :: env-args-last-is-u.txt ({{[^)]*}})
+# CHECK: PASS: shtest-env :: env-args-last-is-u.txt ({{[^)]*}})
 # CHECK: env -u
 # CHECK: # executed command: env -u
-# CHECK: # | Error: 'env' requires a subcommand
-# CHECK: # error: command failed with exit status: {{.*}}
+# CHECK-NOT: {{^[^#]}}
+# CHECK: --
 
-# CHECK: FAIL: shtest-env :: env-args-nested-none.txt ({{[^)]*}})
+# CHECK: PASS: shtest-env :: env-args-nested-none.txt ({{[^)]*}})
 # CHECK: env env env
 # CHECK: # executed command: env env env
-# CHECK: # | Error: 'env' requires a subcommand
-# CHECK: # error: command failed with exit status: {{.*}}
+# CHECK-NOT: {{^[^#]}}
+# CHECK: --
 
-# CHECK: FAIL: shtest-env :: env-args-none.txt ({{[^)]*}})
+# CHECK: PASS: shtest-env :: env-args-none.txt ({{[^)]*}})
 # CHECK: env
 # CHECK: # executed command: env
-# CHECK: # | Error: 'env' requires a subcommand
-# CHECK: # error: command failed with exit status: {{.*}}
+# CHECK-NOT: {{^[^#]}}
+# CHECK: --
 
 # CHECK: FAIL: shtest-env :: env-calls-cd.txt ({{[^)]*}})
 # CHECK: env -u FOO BAR=3 cd foobar
@@ -121,6 +121,6 @@
 # CHECK: --
 
 # CHECK: Total Discovered Tests: 16
-# CHECK: Passed:  4 {{\([0-9]*\.[0-9]*%\)}}
-# CHECK: Failed: 12 {{\([0-9]*\.[0-9]*%\)}}
+# CHECK: Passed:  9 {{\([0-9]*\.[0-9]*%\)}}
+# CHECK: Failed: 7 {{\([0-9]*\.[0-9]*%\)}}
 # CHECK-NOT: {{.}}



More information about the llvm-commits mailing list