roast
roast copied to clipboard
Make spectest pass on Solaris
I wanted to mention the ksh reproducible case - $PWD is /
even though we are in /tmp
$ bash -c "set -x; cd /tmp; PWD=/ /bin/ksh -c 'echo \$PWD'"
+ cd /tmp
+ PWD=/
+ /bin/ksh -c 'echo $PWD'
/
So how about creating temporary file? Or using the one created few lines above? Just fill it with some data. That should conclude whether .eof works or not and should be platform independent, right? I'm happy to modify my change if it is acceptable.
On Fri, Jun 17, 2022 at 3:42 PM Vadim Belman @.***> wrote:
@.**** commented on this pull request.
In S16-io/eof.t https://github.com/Raku/roast/pull/810#discussion_r900129528:
@@ -79,7 +79,7 @@ subtest '.eof on empty files' => { .read: 42; is-deeply .eof, True, 'eof is True after a read'; }
- with "/proc/$*PID/status".IO -> $p {
- with "/proc/$*PID/environ".IO -> $p {
I doubt the sanity of this test which is currently linux-like-centric. Neither status nor environ work for FreeBSD, for example. /proc as such doesn't work neither on macos nor on Windows, etc. Guess, the file is to be chosen on platform-based grounds for better coverage.
- FreeBSD has /proc/*/status, as well as Linux.
- environ would serve for Solaris then
- I'm not sure of the purpose of the test is to check for a special file accessibility, but macos has nothing but devfs mounted. So, /etc/profile would be the best candidate after all
- Neither special mounts exists on Windows. So, /Windows/win.ini or system.init perhaps?
— Reply to this email directly, view it on GitHub https://github.com/Raku/roast/pull/810#pullrequestreview-1010516713, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHTH4VZGIWVYKIBW7PHRBLVPR6CVANCNFSM5ZAI7ZQQ . You are receiving this because you authored the thread.Message ID: @.***>
As long as I checked it out, it seems that the problem covered is related to /proc specifically. So, the test is better be skipped where the FS not available, as it is currently implemented. So, the only thing to be done is choose different entries under /proc, depending on their availability for a particular platform.
Ok, I'm confused now, sorry :) Does my current change look ok, or do we want to do it any other way? Thank you
Sorry for the confusion. I overlooked the line which actually skips if the special file is not found. Looks good to me now.
@niner are you ok with it now?