Skip to content

[libc++] Simplify how the global stream tests are written #66842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
//
//===----------------------------------------------------------------------===//

// TODO: Investigate
// UNSUPPORTED: LIBCXX-AIX-FIXME

// <iostream>

// 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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
3 changes: 0 additions & 3 deletions libcxx/test/std/input.output/iostream.objects/send-stdin.sh

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@
//
//===----------------------------------------------------------------------===//

// TODO: Investigate
// UNSUPPORTED: LIBCXX-AIX-FIXME

// <iostream>

// wistream wcin;

// 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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@
//
//===----------------------------------------------------------------------===//

// TODO: Investigate
// UNSUPPORTED: LIBCXX-AIX-FIXME

// <iostream>

// wistream wcin;

// 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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down