objectionary / eo

EOLANG, an Experimental Pure Object-Oriented Programming Language Based on 𝜑-calculus
https://www.eolang.org
MIT License
1.01k stars 127 forks source link

feat(#3251): implemented `stdout` via syscalls on unix and windows #3328

Closed maxonfjvipon closed 3 months ago

maxonfjvipon commented 3 months ago

Ref: #3251

What's done:

  1. console.write object is implemented in pure EO via syscalls
  2. win32 FileWrite function call is implemented
  3. all stdout occurrences are removed from EO tests so there are no conflicts with outputs redirecting

PR-Codex overview

This PR removes unnecessary test files, updates test cases, refactors package aliases, and improves error handling in various EO language modules.

Detailed summary

The following files were skipped due to too many changes: eo-runtime/src/main/eo/org/eolang/sys/posix.eo, eo-runtime/src/test/eo/org/eolang/txt/text-tests.eo, eo-runtime/src/test/java/EOorg/EOeolang/EOsys/EOposixTest.java, eo-runtime/src/main/java/EOorg/EOeolang/EOsys/DispatchedUnixSyscall.java, eo-runtime/src/main/java/EOorg/EOeolang/EOsys/Posix/package-info.java, eo-runtime/src/main/java/EOorg/EOeolang/EOsys/Win32/package-info.java, eo-runtime/src/main/java/EOorg/EOeolang/EOsys/Win32/Wincon.java, eo-runtime/src/test/eo/org/eolang/sys/posix-test.eo, eo-runtime/src/main/java/EOorg/EOeolang/EOsys/EOposix.java, eo-runtime/src/main/java/EOorg/EOeolang/EOsys/CStdLib.java, eo-runtime/src/main/java/EOorg/EOeolang/EOsys/Win32/BaseTSD.java, eo-runtime/src/main/java/EOorg/EOeolang/EOsys/Posix/ReadSyscall.java, eo-runtime/src/main/java/EOorg/EOeolang/EOsys/Posix/WriteSyscall.java, eo-runtime/src/test/java/EOorg/EOeolang/EOnumberTest.java, eo-runtime/src/main/java/EOorg/EOeolang/EOsys/Win32/WriteFileFuncCall.java, eo-runtime/src/main/java/EOorg/EOeolang/EOio/EOconsole$EOwrite$EOwritten_bytes.java, /eo-runtime/src/main/java/EOorg/EOeolang/EOsys/EOposix$EO\317\206.java", eo-runtime/src/main/java/EOorg/EOeolang/EOsys/Win32/WinDef.java, eo-runtime/src/main/java/EOorg/EOeolang/EOsys/Win32/WinBase.java, .codacy.yml, eo-runtime/src/main/java/EOorg/EOeolang/EOsys/Win32/WinNT.java, eo-runtime/src/main/java/EOorg/EOeolang/EOsys/Win32/Kernel32.java, eo-runtime/src/test/java/EOorg/EOeolang/EOio/InputOutputTest.java

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

maxonfjvipon commented 3 months ago

@yegor256 please check

maxonfjvipon commented 3 months ago

@yegor256 about stdout in EO tests. To print to console we use system call now. It means that we skip java System.out and writes data directly to operating system standard output (which is only one in whole operating system). To test that data is written successfully and objects work I redicrect standard output to temporary file. Since all our test run in parallel - there are may be collisions when output is redirected and two tests write to redirected output which leads to unexpected data written to output - test is failed. That's why all stdout occurrences are removed from EO tests and java tests from InputOutputTest class run in one thread

maxonfjvipon commented 3 months ago

@yegor256 please check one more time

yegor256 commented 3 months ago

@rultor merge

rultor commented 3 months ago

@rultor merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

rultor commented 3 months ago

@rultor merge

@yegor256 Done! FYI, the full log is here (took me 31min)

0crat commented 3 months ago

@yegor256 Thanks for your code review! You've earned +70 points for this contribution: +15 as a base reward; +30 for the substantial 3024 hits-of-code reviewed; -10 for having fewer than 6 comments; +5 for the 5 comments you made. We appreciate your effort, but please aim for more thorough reviews with at least 6 comments in the future. Your updated balance is now +228. Keep up the good work and remember that detailed feedback helps improve our code quality!

0crat commented 3 months ago

@maxonfjvipon 🎉 Great work on your contribution! You've earned +5 points, bringing your total to +239. While the code was a bit lengthy (3030 hits), we appreciate your effort. Keep refining and contributing – every submission helps us grow!