[libcxx-commits] [PATCH] D155262: [libc++][print] Adds stdout functions.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 18 09:58:03 PDT 2023


ldionne added inline comments.


================
Comment at: libcxx/test/std/input.output/iostream.format/print.fun/check-stdout.sh:5-6
+
+# The expected output for println has "...\n". The escaped newline needs
+# to be expanded before comparing the output with the expected output.
+echo -ne ${expected_stdout} > expected.log
----------------



================
Comment at: libcxx/test/std/input.output/iostream.format/print.fun/check-stdout.sh:9-14
+echo -n "out      ["
+cat stdout.log
+echo "]"
+echo -n "expected ["
+cat expected.log
+echo "]"
----------------



================
Comment at: libcxx/test/std/input.output/iostream.format/print.fun/print.sh.cpp:26
+//
+// So do minimal tests for this function and relay on the FILE* overload
+// to do more testing. (Note that function is also not easy to test.)
----------------



================
Comment at: libcxx/test/std/input.output/iostream.format/print.fun/print.sh.cpp:27
+// So do minimal tests for this function and relay on the FILE* overload
+// to do more testing. (Note that function is also not easy to test.)
+//
----------------



================
Comment at: libcxx/test/std/input.output/iostream.format/print.fun/print.sh.cpp:32-33
+// FILE_DEPENDENCIES: check-stdout.sh
+// RUN: %{build}
+// RUN: %{exec} bash check-stdout.sh "%t.exe" "1234 一二三四 true 0x0"
+
----------------
I think this would work, and it would be a bit simpler cause it would only use the Lit internal shell. We could also remove the dependency on `executor-has-no-bash` and the `FILE_DEPENDENCIES`.


================
Comment at: libcxx/test/std/input.output/iostream.format/print.fun/print.sh.cpp:38
+int main(int, char**) {
+  // The data is passes as-is so it does not depend on the encoding of the input.
+  std::print("{} {} ", 1234, "一二三四");
----------------



================
Comment at: libcxx/test/std/input.output/iostream.format/print.fun/println.sh.cpp:36
+// RUN: %{build}
+// RUN: %{exec} bash check-stdout.sh "%t.exe" "1234 一二三四\\ntrue 0x0\n"
+
----------------
Or the other way around, but IDK why the test passes even with that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155262



More information about the libcxx-commits mailing list