[libcxx-commits] [libcxx] [libc++] Simplify how the global stream tests are written (PR #66842)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 19 18:03:42 PDT 2023


https://github.com/ldionne created https://github.com/llvm/llvm-project/pull/66842

Instead of relying on Bash, use the builtin Lit commands whenever possible. The motivation is to stop running %t.exe behind Bash, which breaks on macOS 13.5 with SIP enabled because DYLD_LIBRARY_PATH isn't forwarded to the underlying process when running through a protected process.

For more details, see [1].

[1]: https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/RuntimeProtections/RuntimeProtections.html

>From 4aef3ac6479e717a6ef70f3e8ade7e8035942e40 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Tue, 19 Sep 2023 20:59:45 -0400
Subject: [PATCH] [libc++] Simplify how the global stream tests are written

Instead of relying on Bash, use the builtin Lit commands whenever possible.
The motivation is to stop running %t.exe behind Bash, which breaks on
macOS 13.5 with SIP enabled because DYLD_LIBRARY_PATH isn't forwarded
to the underlying process when running through a protected process.

For more details, see [1].

[1]: https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/RuntimeProtections/RuntimeProtections.html
---
 .../input.output/iostream.format/print.fun/print.sh.cpp   | 8 ++------
 .../iostream.format/print.fun/vprint_nonunicode.sh.cpp    | 8 ++------
 .../iostream.format/print.fun/vprint_unicode.sh.cpp       | 8 ++------
 .../std/input.output/iostream.objects/check-stderr.sh     | 4 ----
 .../std/input.output/iostream.objects/check-stdout.sh     | 4 ----
 .../iostream.objects/narrow.stream.objects/cerr.sh.cpp    | 6 +++---
 .../iostream.objects/narrow.stream.objects/cin.sh.cpp     | 4 +---
 .../iostream.objects/narrow.stream.objects/clog.sh.cpp    | 6 +++---
 .../iostream.objects/narrow.stream.objects/cout.sh.cpp    | 6 +++---
 .../test/std/input.output/iostream.objects/send-stdin.sh  | 3 ---
 .../iostream.objects/wide.stream.objects/check-stderr.sh  | 5 -----
 .../iostream.objects/wide.stream.objects/check-stdout.sh  | 5 -----
 .../iostream.objects/wide.stream.objects/send-stdin.sh    | 4 ----
 .../wide.stream.objects/wcerr-imbue.sh.cpp                | 6 +++---
 .../wide.stream.objects/wcerr-wide-mode.sh.cpp            | 6 +++---
 .../iostream.objects/wide.stream.objects/wcerr.sh.cpp     | 6 +++---
 .../wide.stream.objects/wcin-imbue.sh.cpp                 | 4 +---
 .../wide.stream.objects/wcin-wide-mode.sh.cpp             | 5 ++---
 .../iostream.objects/wide.stream.objects/wcin.sh.cpp      | 4 +---
 .../iostream.objects/wide.stream.objects/wclog.sh.cpp     | 6 +++---
 .../wide.stream.objects/wcout-imbue.sh.cpp                | 6 +++---
 .../wide.stream.objects/wcout-wide-mode.sh.cpp            | 6 +++---
 .../iostream.objects/wide.stream.objects/wcout.sh.cpp     | 6 +++---
 23 files changed, 41 insertions(+), 85 deletions(-)
 delete mode 100644 libcxx/test/std/input.output/iostream.objects/check-stderr.sh
 delete mode 100644 libcxx/test/std/input.output/iostream.objects/check-stdout.sh
 delete mode 100644 libcxx/test/std/input.output/iostream.objects/send-stdin.sh
 delete mode 100644 libcxx/test/std/input.output/iostream.objects/wide.stream.objects/check-stderr.sh
 delete mode 100644 libcxx/test/std/input.output/iostream.objects/wide.stream.objects/check-stdout.sh
 delete mode 100644 libcxx/test/std/input.output/iostream.objects/wide.stream.objects/send-stdin.sh

diff --git a/libcxx/test/std/input.output/iostream.format/print.fun/print.sh.cpp b/libcxx/test/std/input.output/iostream.format/print.fun/print.sh.cpp
index 8c06050d6b41833..d348a3b530be316 100644
--- a/libcxx/test/std/input.output/iostream.format/print.fun/print.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.format/print.fun/print.sh.cpp
@@ -7,7 +7,6 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
 // UNSUPPORTED: no-filesystem
-// UNSUPPORTED: executor-has-no-bash
 // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
 
 // XFAIL: availability-fp_to_chars-missing
@@ -29,12 +28,9 @@
 //
 // The testing is based on the testing for std::cout.
 
-// TODO PRINT Use lit builtin echo
-
-// FILE_DEPENDENCIES: echo.sh
 // RUN: %{build}
-// RUN: %{exec} bash echo.sh -n "1234 一二三四 true 0x0" > %t.expected
-// RUN: %{exec} "%t.exe" > %t.actual
+// RUN: echo -n "1234 一二三四 true 0x0" > %t.expected
+// RUN: %{exec} %t.exe > %t.actual
 // RUN: diff -u %t.actual %t.expected
 
 #include <print>
diff --git a/libcxx/test/std/input.output/iostream.format/print.fun/vprint_nonunicode.sh.cpp b/libcxx/test/std/input.output/iostream.format/print.fun/vprint_nonunicode.sh.cpp
index ca7687150b94c2e..63e1d2ad82b74e2 100644
--- a/libcxx/test/std/input.output/iostream.format/print.fun/vprint_nonunicode.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.format/print.fun/vprint_nonunicode.sh.cpp
@@ -7,7 +7,6 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
 // UNSUPPORTED: no-filesystem
-// UNSUPPORTED: executor-has-no-bash
 // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
 
 // XFAIL: availability-fp_to_chars-missing
@@ -27,12 +26,9 @@
 //
 // The testing is based on the testing for std::cout.
 
-// TODO PRINT Use lit builtin echo
-
-// FILE_DEPENDENCIES: echo.sh
 // RUN: %{build}
-// RUN: %{exec} bash echo.sh -n "1234 一二三四 true 0x0" > %t.expected
-// RUN: %{exec} "%t.exe" > %t.actual
+// RUN: echo -n "1234 一二三四 true 0x0" > %t.expected
+// RUN: %{exec} %t.exe > %t.actual
 // RUN: diff -u %t.actual %t.expected
 
 #include <print>
diff --git a/libcxx/test/std/input.output/iostream.format/print.fun/vprint_unicode.sh.cpp b/libcxx/test/std/input.output/iostream.format/print.fun/vprint_unicode.sh.cpp
index 3582293e9e7540a..a9bcc33d2e014ac 100644
--- a/libcxx/test/std/input.output/iostream.format/print.fun/vprint_unicode.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.format/print.fun/vprint_unicode.sh.cpp
@@ -7,7 +7,6 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
 // UNSUPPORTED: no-filesystem
-// UNSUPPORTED: executor-has-no-bash
 // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
 
 // XFAIL: availability-fp_to_chars-missing
@@ -27,12 +26,9 @@
 //
 // The testing is based on the testing for std::cout.
 
-// TODO PRINT Use lit builtin echo
-
-// FILE_DEPENDENCIES: echo.sh
 // RUN: %{build}
-// RUN: %{exec} bash echo.sh -n "1234 一二三四 true 0x0" > %t.expected
-// RUN: %{exec} "%t.exe" > %t.actual
+// RUN: echo -n "1234 一二三四 true 0x0" > %t.expected
+// RUN: %{exec} %t.exe > %t.actual
 // RUN: diff -u %t.actual %t.expected
 
 #include <print>
diff --git a/libcxx/test/std/input.output/iostream.objects/check-stderr.sh b/libcxx/test/std/input.output/iostream.objects/check-stderr.sh
deleted file mode 100644
index bc800aa9a6bbad7..000000000000000
--- a/libcxx/test/std/input.output/iostream.objects/check-stderr.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-program=${1}
-expected_stderr=${2}
-${program} 2>stderr.log >stdout.log
-[ "${expected_stderr}" == "$(cat stderr.log)" ]
diff --git a/libcxx/test/std/input.output/iostream.objects/check-stdout.sh b/libcxx/test/std/input.output/iostream.objects/check-stdout.sh
deleted file mode 100644
index e86f8cc43a9292e..000000000000000
--- a/libcxx/test/std/input.output/iostream.objects/check-stdout.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-program=${1}
-expected_stdout=${2}
-${program} 2>stderr.log >stdout.log
-[ "${expected_stdout}" == "$(cat stdout.log)" ]
diff --git a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.sh.cpp b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.sh.cpp
index 4df76091e13b5e3..b9e274af7334111 100644
--- a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.sh.cpp
@@ -10,10 +10,10 @@
 
 // ostream cerr;
 
-// UNSUPPORTED: executor-has-no-bash
-// FILE_DEPENDENCIES: ../check-stderr.sh
 // RUN: %{build}
-// RUN: %{exec} bash check-stderr.sh "%t.exe" "1234"
+// RUN: %{exec} %t.exe 2> %t.actual
+// RUN: echo -n 1234 > %t.expected
+// RUN: diff %t.expected %t.actual
 
 #include <iostream>
 #include <cassert>
diff --git a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.sh.cpp b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.sh.cpp
index c394c1b00f3e809..533a7a07fa84764 100644
--- a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cin.sh.cpp
@@ -10,10 +10,8 @@
 
 // istream cin;
 
-// UNSUPPORTED: executor-has-no-bash
-// FILE_DEPENDENCIES: ../send-stdin.sh
 // RUN: %{build}
-// RUN: %{exec} bash send-stdin.sh "%t.exe" "1234"
+// RUN: echo -n 1234 | %{exec} %t.exe
 
 #include <iostream>
 #include <cassert>
diff --git a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/clog.sh.cpp b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/clog.sh.cpp
index 0ac99ba992565e4..476addba050d1c8 100644
--- a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/clog.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/clog.sh.cpp
@@ -10,10 +10,10 @@
 
 // ostream clog;
 
-// UNSUPPORTED: executor-has-no-bash
-// FILE_DEPENDENCIES: ../check-stderr.sh
 // RUN: %{build}
-// RUN: %{exec} bash check-stderr.sh "%t.exe" "1234"
+// RUN: %{exec} %t.exe 2> %t.actual
+// RUN: echo -n 1234 > %t.expected
+// RUN: diff %t.expected %t.actual
 
 #include <iostream>
 
diff --git a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.sh.cpp b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.sh.cpp
index 43388501d6f961d..b8d319385ca1f71 100644
--- a/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cout.sh.cpp
@@ -10,10 +10,10 @@
 
 // ostream cout;
 
-// UNSUPPORTED: executor-has-no-bash
-// FILE_DEPENDENCIES: ../check-stdout.sh
 // RUN: %{build}
-// RUN: %{exec} bash check-stdout.sh "%t.exe" "1234"
+// RUN: %{exec} %t.exe > %t.actual
+// RUN: echo -n 1234 > %t.expected
+// RUN: diff %t.expected %t.actual
 
 #include <iostream>
 
diff --git a/libcxx/test/std/input.output/iostream.objects/send-stdin.sh b/libcxx/test/std/input.output/iostream.objects/send-stdin.sh
deleted file mode 100644
index 2f93f2dfa422645..000000000000000
--- a/libcxx/test/std/input.output/iostream.objects/send-stdin.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-program=${1}
-input=${2}
-echo -n ${input} | ${program}
diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/check-stderr.sh b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/check-stderr.sh
deleted file mode 100644
index 7edd63be08bae2e..000000000000000
--- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/check-stderr.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Check that the stderr of the executed program matches a reference file.
-program=${1}
-expected_file=${2}
-${program} 2>stderr.log >stdout.log
-cmp stderr.log "${expected_file}"
diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/check-stdout.sh b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/check-stdout.sh
deleted file mode 100644
index 996cae539e727ab..000000000000000
--- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/check-stdout.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Check that the stdout of the executed program matches a reference file.
-program=${1}
-expected_file=${2}
-${program} 2>stderr.log >stdout.log
-cmp stdout.log "${expected_file}"
diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/send-stdin.sh b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/send-stdin.sh
deleted file mode 100644
index 70a2a6fafe3297e..000000000000000
--- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/send-stdin.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Pass a reference file as stdin to a test executable.
-program=${1}
-input=${2}
-cat ${input} | ${program}
diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr-imbue.sh.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr-imbue.sh.cpp
index 2b9802b9b304248..ec4c8a009ba0c09 100644
--- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr-imbue.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr-imbue.sh.cpp
@@ -12,10 +12,10 @@
 
 // UNSUPPORTED: no-wide-characters
 
-// UNSUPPORTED: executor-has-no-bash
-// FILE_DEPENDENCIES: ../check-stderr.sh
 // RUN: %{build}
-// RUN: %{exec} bash check-stderr.sh "%t.exe" "zzzz"
+// RUN: %{exec} %t.exe 2> %t.actual
+// RUN: echo -n zzzz > %t.expected
+// RUN: diff %t.expected %t.actual
 
 #include <iostream>
 
diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr-wide-mode.sh.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr-wide-mode.sh.cpp
index 0abb55fd205920e..f23fbee92afd8e8 100644
--- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr-wide-mode.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr-wide-mode.sh.cpp
@@ -13,10 +13,10 @@
 // UNSUPPORTED: no-wide-characters
 // REQUIRES: target={{.+}}-windows-{{.+}}
 
-// UNSUPPORTED: executor-has-no-bash
-// FILE_DEPENDENCIES: check-stderr.sh, test.dat
+// FILE_DEPENDENCIES: test.dat
 // RUN: %{build}
-// RUN: %{exec} bash check-stderr.sh "%t.exe" "test.dat"
+// RUN: %{exec} %t.exe 2> %t.actual
+// RUN: diff test.dat %t.actual
 
 // Check that wcerr works, preserving the unicode characters, after switching
 // stderr to wide mode.
diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr.sh.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr.sh.cpp
index d6e77614f94a678..db1917c635c3336 100644
--- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr.sh.cpp
@@ -12,10 +12,10 @@
 
 // XFAIL: no-wide-characters
 
-// UNSUPPORTED: executor-has-no-bash
-// FILE_DEPENDENCIES: ../check-stderr.sh
 // RUN: %{build}
-// RUN: %{exec} bash check-stderr.sh "%t.exe" "1234"
+// RUN: %{exec} %t.exe 2> %t.actual
+// RUN: echo -n 1234 > %t.expected
+// RUN: diff %t.expected %t.actual
 
 #include <iostream>
 #include <cassert>
diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin-imbue.sh.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin-imbue.sh.cpp
index 88b00840e64e216..74f0a88eaf8362c 100644
--- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin-imbue.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin-imbue.sh.cpp
@@ -12,10 +12,8 @@
 
 // UNSUPPORTED: no-wide-characters
 
-// UNSUPPORTED: executor-has-no-bash
-// FILE_DEPENDENCIES: ../send-stdin.sh
 // RUN: %{build}
-// RUN: %{exec} bash send-stdin.sh "%t.exe" "1234"
+// RUN: echo -n 1234 | %{exec} %t.exe
 
 #include <iostream>
 #include <cassert>
diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin-wide-mode.sh.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin-wide-mode.sh.cpp
index b7c45d686f835b7..e13d79605f118e0 100644
--- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin-wide-mode.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin-wide-mode.sh.cpp
@@ -13,10 +13,9 @@
 // UNSUPPORTED: no-wide-characters
 // REQUIRES: target={{.+}}-windows-{{.+}}
 
-// UNSUPPORTED: executor-has-no-bash
-// FILE_DEPENDENCIES: send-stdin.sh, test.dat
+// FILE_DEPENDENCIES: test.dat
 // RUN: %{build}
-// RUN: %{exec} bash send-stdin.sh "%t.exe" "test.dat"
+// RUN: cat test.dat | %{exec} %t.exe
 
 // Check that wcin works, preserving the unicode characters, after switching
 // stdin to wide mode.
diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.sh.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.sh.cpp
index 88147cfbe2e9eaa..474ea9c9f228236 100644
--- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.sh.cpp
@@ -12,10 +12,8 @@
 
 // XFAIL: no-wide-characters
 
-// UNSUPPORTED: executor-has-no-bash
-// FILE_DEPENDENCIES: ../send-stdin.sh
 // RUN: %{build}
-// RUN: %{exec} bash send-stdin.sh "%t.exe" "1234"
+// RUN: echo -n 1234 | %{exec} %t.exe
 
 #include <iostream>
 #include <cassert>
diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wclog.sh.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wclog.sh.cpp
index 03de942d447c476..89e178248ae5015 100644
--- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wclog.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wclog.sh.cpp
@@ -12,10 +12,10 @@
 
 // XFAIL: no-wide-characters
 
-// UNSUPPORTED: executor-has-no-bash
-// FILE_DEPENDENCIES: ../check-stderr.sh
 // RUN: %{build}
-// RUN: %{exec} bash check-stderr.sh "%t.exe" "1234"
+// RUN: %{exec} %t.exe 2> %t.actual
+// RUN: echo -n 1234 > %t.expected
+// RUN: diff %t.expected %t.actual
 
 #include <iostream>
 
diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout-imbue.sh.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout-imbue.sh.cpp
index 17de670e1bb3a0d..87fc167a20b31f6 100644
--- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout-imbue.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout-imbue.sh.cpp
@@ -12,10 +12,10 @@
 
 // UNSUPPORTED: no-wide-characters
 
-// UNSUPPORTED: executor-has-no-bash
-// FILE_DEPENDENCIES: ../check-stdout.sh
 // RUN: %{build}
-// RUN: %{exec} bash check-stdout.sh "%t.exe" "zzzz"
+// RUN: %{exec} %t.exe > %t.actual
+// RUN: echo -n zzzz > %t.expected
+// RUN: diff %t.expected %t.actual
 
 #include <iostream>
 
diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout-wide-mode.sh.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout-wide-mode.sh.cpp
index 16f2b329ad94873..9908ea0e64db1bb 100644
--- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout-wide-mode.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout-wide-mode.sh.cpp
@@ -13,10 +13,10 @@
 // UNSUPPORTED: no-wide-characters
 // REQUIRES: target={{.+}}-windows-{{.+}}
 
-// UNSUPPORTED: executor-has-no-bash
-// FILE_DEPENDENCIES: check-stdout.sh, test.dat
+// FILE_DEPENDENCIES: test.dat
 // RUN: %{build}
-// RUN: %{exec} bash check-stdout.sh "%t.exe" "test.dat"
+// RUN: %{exec} %t.exe > %t.actual
+// RUN: diff test.dat %t.actual
 
 // Check that wcout works, preserving the unicode characters, after switching
 // stdout to wide mode.
diff --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.sh.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.sh.cpp
index bfc6997224048af..1f7257abb47f1c2 100644
--- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.sh.cpp
@@ -12,10 +12,10 @@
 
 // XFAIL: no-wide-characters
 
-// UNSUPPORTED: executor-has-no-bash
-// FILE_DEPENDENCIES: ../check-stdout.sh
 // RUN: %{build}
-// RUN: %{exec} bash check-stdout.sh "%t.exe" "1234"
+// RUN: %{exec} %t.exe > %t.actual
+// RUN: echo -n 1234 > %t.expected
+// RUN: diff %t.expected %t.actual
 
 #include <iostream>
 



More information about the libcxx-commits mailing list