-
Notifications
You must be signed in to change notification settings - Fork 31
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
[MainThreadFact] to execute tests on main thread on macos #58
Comments
Most of the attributes in this library are Windows-specific. But I'm a bit surprised to hear of a requirement to only be accessed from the "main thread", since in Windows this is virtually indistinguishable from any other thread. Most thread affinitized libraries I see care about either of two other things:
If your native library actually has one of these two common requirements, I think If you try it and find that it's insufficient, and are willing to send a PR to this library to add a new attribute to do what macos requires, comment back on this issue with your proposal and I may take a PR. |
i tried |
I'll need to know what you're requesting then. What is it about UIFact that isn't enough for your native library, for example? I don't have a mac, so this isn't a feature I'm likely to be able to do myself without a precise spec. Can you offer one? |
Unfortunately |
In Windows, the main thread is the entrypoint thread. No test runner I've seen exposes that for tests. The main thread just sleeps while tests are running (waking up to schedule them, perhaps). So to make progress on this, I think you'll need to research what this native module you're using really means by the main thread. If it means it literally checks to make sure its code is running on the entrypoint thread, there's nothing that can be done there except switch your testing from Xunit to a hand-written exe that runs your own methods as tests. If there are other more flexible requirements about the thread it's on, we may be able to do something here. |
Closed by #68 |
Hi!I have a native library that requires to be interacted with only from main thread on macos.Can this project provide a way to do it?Expected result
The text was updated successfully, but these errors were encountered: