-
Notifications
You must be signed in to change notification settings - Fork 101
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
Godot 4.0 adaption #378
Godot 4.0 adaption #378
Conversation
* reorg yield tests * yield frames created, seems to be working * more test refactor, additional test, changes.md * handle invalid frame counts * added export post script, added time and orphans to base export * Decided on 2 frames
* method_maker now supports changing method signature * verified you can spy on overridden parameter lists * integrated into test.gd and gut.gd * CHANGES.md * double_parameter_override now works with object, path, and optional subpath. also comments.
* stub_params implemented * stubber has functionality now * poc working I think * defaults work * may have figured it out * I think it all is working, time to rip stuff out * gutted old new way out
* replicated and fixed issue * refactor
* Conditionally load script to get a reference to NativeScript * CHANGES and removed scratch script * why would I have thought ! was right? * more NativeScript tests * CHANGES
… equality. (#240) Added UT for comparing Vector2 y coords and Vector3 z and y&z coords in test.assert_almost_eq and test.assert_almost_ne
* some basic functionality working * working pretty darn good * created control bar * control bar integrated * setting tweaks * more tweaks * refactor cmdline, show passing, failing, pending in editor * KEYBOARD SHORTCUTS!!!! * status light! * a tool for getting the active editor and probably other things * do not use open_editors and move on with actually releasing this version * some comments and such * mouse overs and handling bad config * CHANGES
* input_factory and input_sender and related tests merged * implemented "hold_for" which releases an event * release_all works with keys and actions * mouse button release * clear * change signal to idle and add is_idle * tweak unrelated tests * changes.md
* run at cursor control implemented * update shortcuts, remove now unused controls * changes.md * cleanup and add properties for method prefix and inner class prefix * don't use added properties because I forgot it wasn't configurable
* better layout
* added warnings when a _down event is sent while already pressed * fix issue with warnings after idle
* merge code, still need to merge tests * fix a thing * merge test_test.gd * merge test_utils.gd * merged in tests, still some issues * fixed some bugs * Update README.md * all parameter override and partial double issues resolved * use method instead of flag in to_s * changes
* Bug fixed in test.gd: should pass a string to has_method. * Avoid unused variable warnings by actually using them, or prefixing with underscore.
* hook settings, hide orphans, file and dir controls * output panel font and font name. Some tweaks * background color and font color * CHANGES.md, fix issue with directory/file ctrl. add GutHookScript class name. Add error to default `run` method of hook script * conditionally show warnings, errors, orphans * do not show orphans when orphans hidden * log levels explained in mouse over * disable colors setting
* simple control that can open a file to a line number and get json results * incremental improvement of control * tabs, looks pretty slick * panel is super tough now. it even searches for method names when it does not know the line number * tree is better * tree is a whole lot better * can handle duplicate test names now * collapse passing tests * proper grouping of tests * run result controls * output toolbar * toolbar icons! * layout tweaks * add some messages for unloaded images * new icons, show/hide settings button * more toggle buttons for tree and output panels * CHANGES
#367) * Optimize PNG images using oxipng * Format files for POSIX compliance
* show output and settings on config error. more buttons. show editor when clicked * show script editor button * save/load various toggles * added orphan counts to the tree * orphan/orphans, added some sample tests * search output, tree view searches output when clickedd * risky tests and total display adjustments * scroll lock buttons, dynamic sizing of col 1, col 1 bg color * add some pass_test calls for missing assert tests * orphan display tweaks * refactor search, implement backwards search * display tweaks * word wrap button * an annoying workaround for extra "pendings" being formatted in output
I accidentally removed |
No more errors but for some reason GUT starts and then stops again (silently without any errors) - if anybody could check out the branch with Godot 4 alpha13+ that would be great! EDIT there are actually more errors but due to godotengine/godot#63714 I did not see them (I was hiding notifications) Will attempt to fix those. Also, |
Can you get this into a single PR? I'm still holding off on checking anything until the Beta release (which appears to be soon). |
@bitbrain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't review anything outside of root or addons/gut. I looked at the major stuff. The rest can be checked out later. This is going to be a mess for a while.
@@ -0,0 +1,17 @@ | |||
[main] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't get checked in. Mostly so everyone who develops for GUT doesn't end up fighting over the shortcuts. I thought this was in the .gitignore.
|
||
onready var rtl = $TextDisplay/RichTextLabel | ||
var _has_opened_file = false | ||
@onready var rtl = $TextDisplay/RichTextLabel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this @
the new way to do onready
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah
@@ -65,8 +65,7 @@ func simple(v1, v2, missing_string=''): | |||
extra = str('. ', _cannot_comapre_text(v1, v2)) | |||
|
|||
cmp_str = get_compare_symbol(result.are_equal) | |||
if(typeof(v1) != TYPE_ARRAY): | |||
result.summary = str(format_value(v1), ' ', cmp_str, ' ', format_value(v2), extra) | |||
result.summary = str(format_value(v1), ' ', cmp_str, ' ', format_value(v2), extra) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this change. If there was a change to typeof
add in a 4.0 comment (starting with "# !4.0"). I don't want to lose the if
without a specific commit explaining it since I have no idea why it is there right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually do not know how this happened. The auto converter tool must have decided this. Quite strange! Will revert this
var summary = null setget set_summary, get_summary | ||
var max_differences = 30 setget set_max_differences, get_max_differences | ||
var differences = {} setget set_differences, get_differences | ||
var are_equal_member = null : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any idea why this name got changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must have come from some of the commits that came from latest master. How are they called on the master branch?
@@ -22,7 +22,7 @@ func has_two_params_one_default(one, two=null): | |||
pass | |||
|
|||
func get_position(): | |||
return .get_position() | |||
return get_position() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless this changed in 4.0, this will cause an infinite loop. We specifically want to call super on this so that we can stub it for tests (or something that I forgot).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should replace this with super.get_position()
@@ -63,7 +63,7 @@ func _add_watched_signal(obj, name): | |||
_watched_signals[obj] = {name:[]} | |||
else: | |||
_watched_signals[obj][name] = [] | |||
obj.connect(name, self, '_on_watched_signal', [obj, name]) | |||
obj.connect(name,Callable(self,'_on_watched_signal'),[obj,name]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this will work or not, but it is closer than it was. This could use a # !4.0 comment
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could even change it simply to: _on_watched_signal instead of this Callable wrapper stuff
@@ -151,7 +151,7 @@ func clear(): | |||
for obj in _watched_signals: | |||
if(_utils.is_not_freed(obj)): | |||
for signal_name in _watched_signals[obj]: | |||
obj.disconnect(signal_name, self, '_on_watched_signal') | |||
obj.disconnect(signal_name,Callable(self,'_on_watched_signal')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this will work or not, but it is closer than it was. This could use a # !4.0 comment
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, no idea why the tool decided to use Callable here. We can reference the signal directly here
export(int) var _font_size = 20 | ||
export(Color) var _font_color = Color(.8, .8, .8, 1) | ||
export(Color) var _background_color = Color(.15, .15, .15, 1) | ||
@export var _font_name = 'AnonymousPro' # (String, 'AnonymousPro', 'CourierPrime', 'LobsterTwo', 'Default') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could use a # !4.0 comment
. It appears that the value hints are either done differently or doo not exist. Adding a comment here and noting that there are others in here that were altered will be helpful.
@@ -168,7 +172,7 @@ func _setup_gut(): | |||
|
|||
_lgr = _utils.get_logger() | |||
_gut = load('res://addons/gut/gut.gd').new() | |||
_gut.connect('tests_finished', self, '_on_tests_finished') | |||
_gut.connect('tests_finished',Callable(self,'_on_tests_finished')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could use a # !4.0 comment
. Another example of connecting that might not work.
@bitwes did you find anything suspicious already that could suggest why it does not run properly? I am scratching my head right now to figure out why Gut starts and then instantly stops again. |
I was able to get it to run via the command line yesterday. Been toying with it more than I should, heh. I've also made a bunch of 4.0 issues describing what I've found as I went along. I got the basic asserts running. A bunch of things are still not working (watching signals, doubles, partial doubles, stubbing, comparing dictionaries and arrays, input mocking, the controls/dialogs all look like garbage, and don't think the in-editor is working) but it is a start. You can check out the changes in the branch below. It's all experimental and not fit for general consumption but has helped get a list of things that will need formal changes. https://github.com/bitwes/Gut/tree/4_0_experiments I cloned your branch and started toying around. All tests that kinda work are in the |
This is a great start, i'm just going to merge it. Some of the outstanding things I asked for had to do with me not knowing much about 4.0. |
Once #379 is merged this PR should become more readable.
This branch is another attempt at porting this addon to Godot 4. For most of the files, I used the
--convert-3to4
flag on the Godot 4 (alpha13) executable.I used latest master for this, why it also contains more commits than just the Godot 4 changes.
The other files need to be migrated manually.
Output: