Conversation
aheejin
left a comment
There was a problem hiding this comment.
Why are _dwarf added to test file names..? Do we have a pass called --dwarf?
| if get_platform() == 'windows': | ||
| print('skipping test "%s" on windows' % name) | ||
| return True | ||
| return False |
There was a problem hiding this comment.
Doesn't this mean we don't run anything on Windows? Is this only a placeholder for now and are we planning to add real conditions here later? If so, where is this supposed to be used? Currently it seems it is used only in spec tests and wasm-opt pass tests... Is there a guideline where we should use this or not?
There was a problem hiding this comment.
The idea is that this would be called when we know a test currently fails on windows. It just returns true/false so it's up to the calling code to actually skip the test.
I plan to use it in this PR to disable all failing windows tests, which should let us enable the majority of tests at least (I hope).
There was a problem hiding this comment.
What I meant was, this returns True for everything on Windows now even without checking names.. So do you mean this is a placeholder for now and you are gonna add real file names later?
There was a problem hiding this comment.
No, this is the actual function. It's only called when we should definitely skip what we are currently doing if we are on windows. So the caller decides which test or part of a test to skip, and this just logs and returns True, and provides a simple way to search for all windows skips.
See e.g. the wasm2js test change https://github.com/WebAssembly/binaryen/pull/3035/files#diff-611fb24eb3395253b8c42c20f7238e8e
There was a problem hiding this comment.
Oh, I see. Thanks. I was confused.
| base = os.path.basename(wast) | ||
| print('..', base) | ||
| # windows has some failures that need to be investigated | ||
| if base == 'names.wast' and shared.skip_if_on_windows('spec: ' + base): |
There was a problem hiding this comment.
Why skip names.wast? If this is not something windows-related, we have something similar in shared.py:
binaryen/scripts/test/shared.py
Lines 385 to 440 in 454a1cb
There was a problem hiding this comment.
Hmm, maybe it should be added to that list then, good point. It's windows-specific but we could append it when on that platform. However, then we can't use the skip_if_on_windows function which otherwise would be a single easy way to find all skipped stuff in windows... what's better?
There was a problem hiding this comment.
Oh, sorry, I didn't see names.wast is skipped only on Windows.. I thought it was an 'or' condition, so I thought the condition was if it is names.wast or it is on Windows. This part of the code excludes failing tests from the list of spec tests, so if we add some platform handling logic I think we can make those files be excluded from here. But if we have only a single case of names.wast that is platform-dependent, I'm not sure that's worth it. Also this list is only for spec tests, so maybe it'd be better to keep them separate after all, unless we make a more complex system of skipping tests that takes the platform and the kind of tests as arguments, which seems like an overkill.
There was a problem hiding this comment.
Seems like overkill to me too, to try to generalize this. I don't feel strongly, but I think I prefer the current status of the code.
|
@aheejin There is a pass called "dwarfdump" which prints out the DWARF, and is what we need to skip on windows for now. |
Sorry I still don't understand how it is related to the file renaming.. |
|
Oh, the name of the test may not contain the passes we run. So I renamed tests that contain a call to |
|
Ok, I think the work here is done - I had to disable a bunch of things like wasm2js and unit tests, but the majority do pass now. |
| # delete the old file, make sure you rename the corresponding .wast.log file in | ||
| # expected-output/ if any. | ||
| SPEC_TEST_BLACKLIST = [ | ||
| SPEC_TESTS_TO_SKIP = [ |
There was a problem hiding this comment.
Thanks! I forgot we still had this.
| if get_platform() == 'windows': | ||
| print('skipping test "%s" on windows' % name) | ||
| return True | ||
| return False |
There was a problem hiding this comment.
Oh, I see. Thanks. I was confused.
|
|
||
| # similar to assertEqual, but while ignoring line ending differences such | ||
| # as those between windows and unix | ||
| def assert_equal_ignoring_line_endings(self, left, right): |
There was a problem hiding this comment.
We don't need to replace other usages of assert_equal with this?
There was a problem hiding this comment.
I think we would need to audit each one to see if line endings should be ignored there or not. That may explain some of the remaining failures in unit, but not the first few at least (which is when I gave up on trying to fix them all).
This lets us run most tests at least on that platform.
Add a new function for skipping those tests,
skip_if_on_windows,so that it's easy to find which tests are disabled on windows for later fixing
efforts.
This fixes a few minor issues for windows, like comparisons
should ignore
\rin some cases.