Comments (6)
Closed by #68
from xunit.stafact.
Most of the attributes in this library are Windows-specific. But UIFact
might work for you. It is OS-agnostic, but really the only thing it does is keep the test running on one particular thread even across async awaits.
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:
- They are not thread-safe, and therefore should only be accessed from one thread, but the particular thread chosen doesn't matter.
- They access the UI, so they need to only be accessed on the UI thread.
If your native library actually has one of these two common requirements, I think [UIFact]
may work for you. But I'm not sure.
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.
from xunit.stafact.
i tried
I'll make this issue a feature request then
from xunit.stafact.
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?
from xunit.stafact.
Unfortunately [UIFact]
isn't enough. What di you mean by spec? Main thread is main thread, but i guess it is unavailable to be modified in xunit?
from xunit.stafact.
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).
I don't know what it's like on a mac, if macos defines main thread differently. But I suspect the xunit runner on macos is the same, in that it's impossible to get the test to actually run on the entrypoint thread.
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.
from xunit.stafact.
Related Issues (20)
- Suggestion: Skip support (SkippableFact) HOT 4
- [StaFact] tests not found when used with netcoreapp2.2 HOT 13
- StaTheory is not supported in Visual Studio Runner HOT 13
- Support for OleInitialize HOT 2
- WPF support on .NET Core 3.0 breaks .NET Core 3.0 consumers on Linux/Mac
- Can't run tests HOT 2
- Generate test arguments on test thread
- CPU usage in polling message loop HOT 4
- Hanging UITheoryTestCase
- Clarify attribute names, or rename package ID HOT 8
- CollectionAttribute seems to be not respected HOT 7
- [StaFact] tests do not execute when targeting net462 HOT 8
- .net 4.5.2 compatibility HOT 3
- netstandard support HOT 1
- STA for Fixture Collections HOT 5
- StaFact facts breaks the concurrency limitations of Xunit HOT 11
- Running all tests within a class on the same thread? HOT 12
- Custom Thread HOT 1
- WinUI Unit testing with UIFact doesn't appear to work. HOT 18
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xunit.stafact.