-
Notifications
You must be signed in to change notification settings - Fork 953
WIP: implement testing.TempDir, os.RemoveAll, and os.ReadDir. #2500
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
WIP: implement testing.TempDir, os.RemoveAll, and os.ReadDir. #2500
Conversation
That's kind of fun -- with all those changes to testing, "go test -run TestBuild/Host" fails on mac.
with old and new trees, and compare output. I'll look into it when I get a chance. |
Evidently "testing: gather duplicate code into tRunner" introduced this regression. Checking... |
3f07a0b
to
648a76e
Compare
OK, sorted. This passes now on CI on darwin, which is the only place I've implemented os.ReadDir so far. |
The first two parts of this that are ready for review are:
I'll rebase this once those land. |
648a76e
to
e9fc27f
Compare
Rebased. Also include breadcrumbs pull request, since I use that, and this is just a preview of the pull requests I use, stacked together. |
e9fc27f
to
05882d2
Compare
I just tried a few tests that depend on these functions... didn't find any that now pass, but here are the immediate blockers I found (ignoring any tests immediately blocked by reflect).
|
05882d2
to
203dedc
Compare
248e192
to
af35672
Compare
…go-org#1906" This reverts commit 60b483b.
This replaces an earlier kludge which was at the wrong level and caused "GOARCH=386 tinygo test os" to fail to compile on linux. Stubbing just the one missing function, syscall.seek, lets os tests compile on linux 386, and skipping tests of seek and Fstat (which has a cryptic dependency on syscall.Seek via time) lets os tests pass on linux 386. The stub can be removed once tinygo implements go assembly and picks up the real definition.
readdir is disabled on linux for 386 and arm until syscall.seek is implemented there. windows is hard, so leaving that for later. File src/os/dir_other_go115.go can be deleted when we drop support for go 1.15.
TODO: enable test on windows once Readdir is implemented there
TODO: enable test on windows once os.Readdir and os.RemoveAll are implemented there
Turns out wine 5.x doesn't export WINEUSERNAME.
af35672
to
d6cdcde
Compare
Closing in favor of individual pull requests. |
It slices! It dices! It's a floor wax and a shoe polish!
testing.TempDir() needs testing.Cleanup() needs os.RemoveAll needs os.ReadDir.
And its tests need sub-benchmarks.
Pull it all together into one pull request as a preview while we wait for the individual pull requests to land.
Only works on darwin and linux for now, because the current readdir patch does not handle windows.