-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Stringify Variant
compatible types for doctest output
#40945
Conversation
Added a test case to see the output of all Variant types, but this results in a crash in all tests somehow (despite successful runs), lets see what I can find with sanitizer to investigate what causes it. |
Code that caused the crashes (commented out now as Object *obj = memnew(Object);
INFO(obj);
Callable callable(obj, "has_method");
INFO(callable);
Signal signal(obj, "script_changed");
INFO(signal);
memdelete(obj); Sanitizer output:
But this is out of scope of this PR, likely requires proper initialization of In either case this should be safe to merge now, no crashes from sanitizer with this PR in its current state either. |
Similar call stack in #40951... |
Calling |
Yes this fixes it, I was lazy to find a matching So, I do I do think that for more complex stuff we could come up with more sophisticated mechanism to init and deinit stuff (especially all which requires a |
Is this related to #34668? |
Current PR just teaches doctest how to convert those types for internal usage (printing to console, even generating output in XML with those Variant types properly serialized:
I do think it's better to use |
Thanks! |
See #40890 and #40940 for context.
Assertion messages should now be able to properly convert
Variant
to doctest strings (usingVariantWriter
akavar2str
in GDScript), example output forColor
:Using
VariantWriter
is necessary if you want to copy and paste the output from doctest directly in code or even GDScript from them to be parsed back properly.