Robust.UnitTesting was both ALL tests for RT, and also API surface for content tests.
Tests are now split into separate projects as appropriate, and the API side has also been split off.
Applies when vsync is not enabled.
Had to shuffle stuff around to GameController since it involves the game loop.
The implementation isn't great and undershoots the target FPS value (because the OS overshoots the desired sleep value). I tried using SDL_DelayPrecise too but this causes significantly increased CPU usage probably because it spinwaits and all that nonsense, so I decided against it.
I don't know why I bothered to do this. I just got the idea in my head. Kinda feels like a waste of time, but there's no point not committing it at this point.
* Move RobustXaml to a shared package
In a near-future change, I'll make it possible to optionally link to
this from Robust.Client, which will allow JIT compiling XAML.
Also upgrade it to a version of .NET that supports nullability
annotations.
* Re-namespace packages
* Add a JIT compiler, plus hooks that call into it
In Debug, after this change, all XAML will be hot reloaded once every
time an assembly is reloaded.
The new code is compiled with SRE and is _not_ sandboxed -- this is not
suitable to run against prod.
In Release, the hot reload path is totally skipped, using the same trick
as SmugLeaf used in an earlier attempt to implement this functionality.
* Hot reload: watcher
This is a bit of a horror, but there's not in-engine support for
identifying the source tree or the XAML files in it.
* Put everything dangerous behind conditional comp
* Code cleanup, docs
* Fix a bad comment
* Deal a little better with crashes in the watcher
* Make reload failures Info, since they're expected
They were previously causing the integration tests to flag, even though
"a few types fail hot reloading because they're internal" is expected
behavior.
* Fix an unnecessary null check
I removed the ability for CompileCore to return null.
* injectors: null! strings, default primitives
* Tidy documentation (thanks, PJB!)
* Reinstate netstandard2.0, abolish Pidgin
* Internal-ize all of Robust.Xaml
* Add a cautionary note to Sandbox.yml
* Shuffle around where conditional compilation occurs
* Privatize fields in XamlImplementationStorage
* Internalize XamlJitDelegate
* Inline some remarks. No cond. comp in Robust.Xaml
* Use file-scoped namespaces
They aren't allowed at Language Level 8.0. (which I arbitrarily picked
for Robust.Xaml because it's the oldest one that would work)
* Bump language level for R.Xaml, file namespaces
* Force hot reloading off for integration tests
* Fix bizarre comment/behavior in XamlImplementationStorage
* Consistently use interfaces, even in generated code
* Update Robust.Client/ClientIoC.cs
---------
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
* Isolate net messages in integration tests.
Integration tests don't use Lidgren to connect client and send, instead they just use some in-process channels to communicate. Because of this, the original implementation of net messages *directly* passed the net message instances between client and server instances. This caused issues whenever content would mutate data in a NetMessage after it "passed through".
Now we run the messages through WriteToBuffer() and ReadFromBuffer() so they pass through binary serialization. This means there's no more implicit sharing of the objects.
Note that this requires some trickery: Lidgren's message types have internal constructors. Really ideally we'd change the engine to make this more testable... but that's a content breaking change. Instead I just added InternalsVisibleTo to Lidgren so we can mess with it. We maintain the library ourselves anyways I can do what I want.
Fixes#4836
* Register Robust.UnitTesting as assembly for reflection.
This is necessary so that serialized types in the assembly can be picked up by NetSerializer.
Have to disable automatic reflection on all entity systems/components that tests register manually right now, because otherwise tests break.
* Stop shallow cloning specific net messages in integration tests.
This isn't necessary anymore now that we have a thorough fix.
* Wow I really forgot to copy-paste that line to the other side huh.
* Add test that serializer hash matches.
* Another test one I missed earlier.
* Changelog
* Trying to get res:// and usr:// cookies to wrok
* Update CefGlue
* Bump CEF
* Seal types in WebView
Fixes warnings
* Move most of client cleanup to game thread.
This used to run in the windowing thread which broke CEF shutdown, most notably cookie saving.
* "flushcookies" command for CEF.
* Remove unecessary res:// code.
* Fix tests
* More request handler fixes.
* Good thing I don't have to care about commit quality in PRs like this.
* Add test pooling and global test setup
* WIP test pooling changes
* Make asynchronous tests the default again
* Finish fixing tests, make test threads background threads
* Un-pool tests with custom cvars
* Fix not changing FailureLogLevel cvar on instance return
* Fix error when overriding already overriden cvar
* Don't pool some physics integration tests
* Unpool engine tests, the technology just isn't there yet
* Remove explicit Pool = false from physics tests
* Change default pooling setting to false
* Didn't need this anyway
* Remove ConfigurationManager.ResetOverrides
* Bring back enum cvar override parsing
* Make integrationInstances name clearer > notPooledInstaces
Make clients ready and servers ready internal
* Add logging test instances
* Give more info on ran tests
* Show total clients and servers in test output
* Wipe LayerMap on SpriteComponent.AfterDeserialize
* Fix server not properly kicking clients
* Rider shut
* Make all test metrics report totals
* Format tests ran better
* Replace Console.WriteLine with TestContext.Out.WriteLine
* Fix two server test pooling info prints using total clients instead of total servers
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
* Adds ServerOptions, improve GameControllerOptions, fix engine integration tests
* Do component auto-registration in engine integration tests by default
* Fix integration tests on content, register components ONLY if not contentstarted or options are null
* Add integration test for engine integration tests working correctly
* Move cvar overrides out of content and into engine.