Releases: bitwes/Gut
Releases · bitwes/Gut
9.5.0
9.5.0
Here's a quick video covering some new features: https://www.youtube.com/watch?v=ovq_1sjIpOs
Breaking Changes
- Stubbing/Doubling/Spying on vararg methods has changed (due to engine changes).
- You no longer need to stub the parameter count for vararg methods.
- Since you don't need to do that, you can't do that anymore.
- Asserting parameter values passed into a vararg must be enclosed in an array.
assert_called(my_double.rpc_id, [p1, p2, [vararg_val1, vararg_val2, vararg_val3]])- Test scripts are now freed after they finish. Prior to this release they would continue to exist until the end of the run, but were removed from the tree. This has been changed to give more accurate orphan information and because it wasn't needed anymore. You shouldn't care, but I thought you should know.
Features
- Requires Godot 4.5
- New menu and functionality at Project->Tools->GUT
- All the
.uidfiles you could ever want. - Error detection and asserts have been added. Tests fail when unexpected errors occur and you can assert that errors have occurred (preventing failures). See the wiki for more information.
- Orphaned nodes are now displayed...not the count (well, the count too), but the actual node and some extra information. Insead of seeing "2 new orphans" you'll see something like:
* test_this_makes_two_orphans
2 Orphans:
* test_two_one:<Node#59760445195>
* test_two_two:<Node#59777222412>
* test_with_some_nodes_with_children
9 Orphans
* parent_one:<Node#65062045712> + 5
* parent_a:<Node#65162709014> + 2- Pop out the GUT panel into a window (a.k.a. Make Flaoting). You an also put the text pane below the tree pane when in a window.
- "Awaiting" messages now have a configurable delay which defaults to .5 seconds. Messages to indicate a call to a
wait_method will not appear until this delay has expired. Now your 10 frame awaits aren't noisy unless you want them to be. - More shortcuts, use shortcuts anytime (even if the GUT panel is hidden).
- All GUT dialogs remember their size.
- Run tests externally through the editor. This is basically the same thing as running from the command line, but kicked off through the editor. This was introduced to allow you to run tests that had errors in them without invoking the debugger, but could have many other use cases. See the run-externally options for more information about best use.
- There's an About box now. It has text, and links, and an icon...and absolutely nothing else.
What's Changed
- Check if object emitting signal exist before disconnecting by @m-radzikowski in #726
- updated readme by @bitwes in #727
- Godot 4 4 by @bitwes in #728
- I 725 by @bitwes in #729
- fix: register_inner_classes can handle cyclic dependencies by @thephilipquan in #750
- Godot 4 5 by @bitwes in #760
New Contributors
- @m-radzikowski made their first contribution in #726
- @thephilipquan made their first contribution in #750
Full Changelog: v9.4.0...v9.5.0
9.4.0
9.4.0
Potentially Breaking Changes
- The deprecated
wait_framesand the newwait_idle_frames,wait_physics_framesnow count frames when theSceneTree.process_frameandSceneTree.physics_framesignals are emitted. This may cause some of your awaits to wait a frame too long/short. This approach is more reliable as it occurs before the_processor_physics_processis called on anything in the tree. This means that tree order will not matter and all objects will have finished_process/_physics_processby the time the await ends.
Features
- Utilized the adapted Godot tools that generate HTML from code comments, moving some documentation to code comments. This makes more documentation easily accessible from the editor and cuts down on some duplicate documentation.
wait_idle_framesadded. This counts frames idle/process frames instead of_physics_process.wait_frameshas been renamed (deprecated) towait_physics_frames.wait_whileadded. This waits while aCallablereturnstrue.- New
class_names:GutInputFactoryforres://addons/gut/gut_input_factory.gdstatic class.
- Signal related methods now accept a reference to a signal as well as an object/signal name:
get_signal_emit_count,assert_connected,assert_not_connected,assert_signal_emitted,assert_signal_not_emitted,assert_signal_emitted_with_parameters,assert_signal_emit_count,get_signal_parameters.
Deprecations
wait_frameshas been deprecated in lieu of the more specificwait_physics_framesandwait_idle_frames.
Changelog
- I192 in just under 5 years I moved the two lines of code up some to finally fix this.
- Remove editor config file warning by @bitwes in #682
- add default title to assert_not_freed by @bitwes in #683
- I639 by @bitwes in #684
- Gut test comments by @bitwes in #685
- Fix docs typo by @Curtis-Barnhart in #692
- include parameter list in passing test message by @bitwes in #698
- fixed issue by @bitwes in #699
- Refactor wait methods by @bitwes in #701
- I630 wait while by @bitwes in #703
- Add instructions for installing gut as a git submodule by @Curtis-Barnhart in #695
- Wrap failure and pending messages with CDATA by @bitwes in #707
- fix failing test_optparse.TestValuesDictionary test by @Curtis-Barnhart in #704
- add hold_frams and hold_seconds to input sender by @bitwes in #712
- Clear embedded font from OutputText.tscn by @gbrock in #713
- Optparse option aliases by @Curtis-Barnhart in #705
- Fix typo in the Awaiting documentation by @pupeno in #714
- Avoid global
Loggeras this conflicts with a native class in Godot 4.5 by @dreed-sd in #715 - Pass signals instead of strings by @bitwes in #717
New Contributors
- @Curtis-Barnhart made their first contribution in #692
- @gbrock made their first contribution in #713
- @pupeno made their first contribution in #714
- @dreed-sd made their first contribution in #715
Full Changelog: 9.3.1...v9.4.0
v9.3.1
9.3.1
A small collection of bug fixes and documentation. GUT can now generate documentation from code comments.
Features
- added class_name to InputSender by @bitwes in #651
- add await in pre-run script, post-run scrpt, and should_skip_script. by @LowFire in #671
- Doctools generation by @bitwes in #672
Bug Fixes
- Parsed Native Refcounted Objects are not freed. by @bitwes in #648
- Housekeeping by @bitwes in #652
- I650 more warnings by @bitwes in #653
- fix: Mocking-Input link by @HotariTobu in #659
- Fixed typos in error messages. by @xmoby in #663
- Fix docs typo by @MSWS in #665
- Font import files: Add disable_embedded_bitmaps by @manuq in #674
- Update is_almost_eq() to use built-in vector comparison by @onegm in #668
New Contributors
- @HotariTobu made their first contribution in #659
- @xmoby made their first contribution in #663
- @MSWS made their first contribution in #665
- @LowFire made their first contribution in #671
- @manuq made their first contribution in #674
- @onegm made their first contribution in #668
Full Changelog: v9.3.0...9.3.1
v9.3.0
9.3.0
Features
- You can Monkey Patch your doubles! You can make any method in a double call a specified
Callableusing.to_call(callable)onstub. Details are on the Stubbing wiki page.
var dbl = double(MyScript)
stub(dbl.some_method).to_call(func(): print("Monkey Patched!"))- You can now use callables to
stubinsetad of passing the object and method name. Binding arguments adds an implicitwhen_passedto the stub. Less strings, less typing!
var dbl = double(MyScript)
# same as stub(dbl, "some_method").to_return(111)
stub(dbl.some_method).to_return(111)
# same as stub(dbl, 'some_method').to_return(999).when_passed("a")
stub(dbl.some_method.bind("a")).to_return(999)- @WebF0x GUT can now wait on a
Callableto returntrue(aka predicate method) via the newwait_until:
# Call the function once per frame until it returns 5 or one second has elapsed.
await wait_until(func(): return randi_range(0, 20)==5, 1)
wait_for_signaland the newwait_untilreturntrueif they did not timeout, andfalseotherwise. This means waiting on, and asserting a signal has been emitted can now be written as
assert_true(await wait_for_signal(my_obj.my_singal, 2),
'signal should emit before 2 seconds')
- @mphe GUT now automatically enables the "Exclude Addons" option when running tests. This means you don't have to keep enabling/disabling this option if GUT does not conform to your warning/error settings.
- GUT disables warnings at key points in execution and then re-enables them. This makes running GUT possible (or at least easier) with warning levels incompatable with GUT source code. This also makes the ouput less noisy.
- @plink-plonk-will Elapsed time is now included in the XML export.
- Issue #612
InputSendernow sets thebutton_maskproperty for generated mouse motion events when mouse buttons have been pressed but not released prior to a motion event. - Issue #598 Added the virtual method
should_skip_scripttoGutTest. If you impelement this method and returntrueor aString, then GUT will skip the script. Skipped scripts are marked as "risky" in the final counts. This can be useful when skipping scripts that should not be run under certiain circumstances such as:- You are porting tests from 3.x to 4.x and you don't want to comment everything out.
- Skipping tests that should not be run when in
headlessmode.
func should_skip_script(): if DisplayServer.get_name() == "headless": return "Skip Input tests when running headless"
- If you have tests that would normally cause the debugger to break on an error, you can skip the script if the debugger is enabled so that the run is not interrupted.
func should_skip_script(): return EngineDebugger.is_active()
- The CLI got an update to its Option Parser. There's more info in #623:
- options that take a value can now be specified with a space (
option value) instead of usingoption=value. -ghoption now has headings for the different options. It looks a lot better.-gdirand-gtestcan be specified multiple times instead of using a comma delimited list.- You can use
-gconfig=to not use a config file.
- options that take a value can now be specified with a space (
- Minor niceties such as showing that GUT is exiting in the title bar (takes a bit sometimes) and switching to full display at the end of a run if GUT does not automatically exit.
Bug Fixes
- Issue #601 doubles now get a resource path that makes Godot ignore them when "Exclude Addons" is enabled (res://adddons/gut/not_a_real_file/...).
- Issue #594 An error is generated if GUT cannot find the double template files. This can happen if you export your game with tests, but do not include *.txt files.
- Issue #595 When no tests are run GUT no longer displays "All Tests Passed!" and exits (based off of settings).
- Issue #578 Fix
InputSenderso it works withInput.is_action_just_pressed,Input.is_action_just_releasedandInput.is_action_pressed. Thanks @lxkarp and @edearth for you work on this.
Deprecations
- The optional
GutTestscript variableskip_scripthas been deprecated. Use the newshould_skip_scriptmethod instead. - GUT now warns if you have overridden
_readyin your test script without callingsuper._ready.
New Contributors
- @mphe made their first contribution in #600
- @plink-plonk-will made their first contribution in #581
- @nycdotnet made their first contribution in #617
- @WebF0x made their first contribution in #609
- @lxkarp made their first contribution in #587
- @Edearth made their first contribution in #634
Full Changelog: v9.2.1...v9.3.0
v9.2.1
What's Changed
- Issue #570 Doubling scripts that contain a statically typed variable of another class_name script (
var foo := Foo.new()where foo is aclass_namein another script) could cause errors. - Add support for running tests through the debugger via VSCode via the gut-extension.
Full Changelog: v9.2.0...v9.2.1
v7.4.3
v9.2.0
9.2.0
Configuration Changes
- The GUT Panel config is now auto-saved/loaded to
user://instead ofres://. This file changes a lot and is very annoying with version control and teams that have more than one person (which is all teams since there is no "I" in team).- The new location is
user://gut_temp_directory/gut_editor_config.json - When you open your project, GUT will check to see if there is a file in the new location. If not, it will copy it there.
- GUT prints a warning to `Output`` telling you that you can delete the old file.
- The new location is
- You can now Save/Load configs to/from anywhere through the Settings Subpanel.
- Saving/Loading does not change where the GUT panel auto-saves/loads to.
- This allows you to define standard config files for your project, but not save any changes in a version controlled file (unless you explicitly resave it using the cool new Save As button).
- The GUT Panel Shortcuts config file has also been moved. GUT also moves this file automatically and prints a warning.
- The new location is
user://gut_temp_directory/gut_editor_shortcuts.cfg
- The new location is
- All files that were being saved in
user://have been moved touser://gut_temp_directoryfor better house keeping.
Features
- The Settings Subpanel now has on/off switches for directories, so you can turn them off if you want to run a subset of tests.
- Wiki moved to https://gut.readthedocs.io
Bug Fixes
- Issue #479 source_code_pro.fnt was malformed, is now bienformed.
- Issue #549 @andrejp88 debug/gdscript/warnings/untyped_declaration as error would break GUT due to dynamic code generation.
- Issue #536 Theme refernces font instead of embedding it.
- Issue #523 "got" values are printed with extra precision for float, Vector2, and Vector3 when using
assert_almost_eq,assert_almost_ne,assert_betweenandassert_not_between. - Issue #436 Doubled Scenes now retain export variable values that were set in the editor.
- Issue #547 The output_font_name and output_font_size for the GutPanel are now saved.
- PR #544 (@xorblo-doitus) InputSender will now emit the
gui_inputsignal on receivers. - Issue #473 Moved gut panel settings and gut options out of res:// so that multiple devs won't fight over files that are really user preferences.
- Created some Editor Preferences for Gut to handle user only settings.
- When running GUT from the editor, the config used by the runner is saved to
user://now. - You can load and save configs through the editor, so you can have a base set of settings that are not overwritten when running Gut.
- Moved all files that Gut creates in
user://touser://gut_temp_directory. - Output Subanel related settings have moved to the Output Subpanel. Use the "..." button.
- Issue #557 Tests are now found in exported projects.
- Fixed issue where the panel was not loading the double strategy correctly.
- Issue #542 GUT no longer generates orphans...again.
New Contributors
- @andrejp88 made their first contribution in #533
- @PerMalmberg made their first contribution in #548
- @xorblo-doitus made their first contribution in #544
Full Changelog: v9.1.1...v9.2.0
v7.4.2
7.4.2
- Issue #485 GUT prints a warning and ignores scripts that do not extend
GutTest. - Documentation changes for readthedocs.
- Issue #436 Doubled Scenes now retain export variable values that were set in the editor.
- Issue #547 GutPanel now saves output_font_name and output_font_size correctly.
- Issue #450 yield timer is now stopped to avoid possible leaking of yield time between tests.
New Contributors
- @jamie-pate made their first contribution in #455
Full Changelog: v7.4.1...v7.4.2
v9.1.1
- Fixed numerous issues with doubling that were caused by the port from 3.x. Most of these involved using the INCLUDE_NATIVE doubling strategy.
- Added errors and better failure messages when trying to stub or spy on an invalid method. For example, if your script does not implement
_readyand you try to spy on it, your test will now fail since_readyis virtual and you didn't overload it. - Doubled methods that have a vararg argument are now auto detected and extra parameters (up to 10) are added to the method signature to handle most use cases (i.e.
rpc_id,emit_signal). If you call a doubled method that has a vararg argument and you have not stubbedparam_counton the object's script then a warning is generated. - Fixed an issue where command line would not launch in 4.2rc1.
- Issue #510 Added all types to strutils to address #510.
- Issue #525 Signals are now disconnected when waiting on signals that do not fire in the expected amount of time.
v9.1.0 (Godot 4.1)
9.1.0 (requires Godot 4.1)
- GUT generated errors now cause tests to fail (not engine errors, just things GUT thinks are bad). You can disable this through the CLI, .gutconfig, or the panel.
- Changes to Double Strategy and Double/Partial Double creation to fix #482.
- See Double-Strategy in the wiki for more information.
- The default strategy has been changed back to
SCRIPT_ONLY(a bug caused it to change). Due to how the Godot Engine calls native methods, the overrides may not be called by the engine so spying and stubbing may not work in some scenarios. - Doubling now disables the Native Method Override warning/error when creating Doubles and Partial Doubles. The warning/error is turned off and then restored to previous value after a Double or Partial Double has been loaded.
- The doubling strategy
INCLUDE_SUPERhas been renamed toINCLUDE_NATIVE. - If you have an invalid Double Strategy set via command line or gutconfig, the default will be used. So if you are explicity setting it to the old
INCLUDE_SUPER, it will useSCRIPT_ONLY. - You can now set the default double strategy in the GutPanel in the Editor.
- Added
GutControlto aid in running tests in a deployed game. Instructions and sample code can be found in the wiki. - Issue 485 GUT prints a warning and ignores scripts that do not extend
GutTest. - A lot of internal reworkings to simplify logging and info about test statuses. The summary changed and the final line printed by GUT is now the highest severity status of the run (i.e. failed > pending/risky > passed).
- Issue 503 Fixed issue where GUT would not find script object when doubling PackedScenes.
- Port PR 409 GUT's simulate function can now check
is_processingandis_physics_processingwhen running thier respective methods.