Releases: bitwes/Gut
Releases · bitwes/Gut
v9.3.0
9.3.0
Features
- You can Monkey Patch your doubles! You can make any method in a double call a specified
Callable
using.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
stub
insetad of passing the object and method name. Binding arguments adds an implicitwhen_passed
to 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
Callable
to 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_signal
and the newwait_until
returntrue
if they did not timeout, andfalse
otherwise. 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
InputSender
now sets thebutton_mask
property 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_script
toGutTest
. If you impelement this method and returntrue
or 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
headless
mode.
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
. -gh
option now has headings for the different options. It looks a lot better.-gdir
and-gtest
can 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
InputSender
so it works withInput.is_action_just_pressed
,Input.is_action_just_released
andInput.is_action_pressed
. Thanks @lxkarp and @Edearth for you work on this.
Deprecations
- The optional
GutTest
script variableskip_script
has been deprecated. Use the newshould_skip_script
method instead. - GUT now warns if you have overridden
_ready
in 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_name
in 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_directory
for 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_between
andassert_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_input
signal 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
_ready
and you try to spy on it, your test will now fail since_ready
is 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_count
on 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_SUPER
has 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
GutControl
to 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_processing
andis_physics_processing
when running thier respective methods.
v9.0.1 (Godot 4)
Fixed a bug where you could not double
scripts that used the new Godot 4 accessors.
GUT 9 for Godot 4!
This is the initial release of GUT for Godot 4.0. Going forward, GUT 9+ will support Godot 4. GUT 7+ will support Godot 3.x.
GUT 9.0.0 will live in the godot_4
branch of the repo. Eventually it will move to main
as Godot 3.x support is not needed. You should read Gut's Godot 4 README for information about what has changed.
What's Changed
- Update documentation for assert_is/assert_extends by @Structed in #348
- Fix for comparison of incompatible types when the first type is Array by @hilfazer in #352
- hide yield msgs at log level 0 by @bitwes in #358
- I354 init parameters by @bitwes in #359
- no longer waits .4 for the first yield detected by @bitwes in #361
- I363 panel improvements by @bitwes in #365
- Fix #368. Add PoolStringArray as a supported default. by @bitwes in #369
- Optimize PNG images using oxipng and format files for POSIX compliance by @aaronfranke in #367
- More panel enhancements by @bitwes in #370
- 4.0 Name Change Errors by @Tim-Fronsee in #395
- Sync 4 0 Experiments with 7.4.1 by @Tim-Fronsee in #397
- 4.0 ShortcutButton Keycode Usage & Name Changes by @Tim-Fronsee in #396
- 4.0 Syntax Highlighting & Label Settings by @Tim-Fronsee in #398
- 4.0 Button Pressed in GutBottomPanel & OutputText by @Tim-Fronsee in #399
- 4.0 DirectoryCtrl::set_text Infinite Loop Fix by @Tim-Fronsee in #400
- 4.0 Shortcuts by @Tim-Fronsee in #402
- 4.0 JSON by @Tim-Fronsee in #403
- 4.0 Run Result Line Select Fixes by @Tim-Fronsee in #406
- 4 0 experiments new gui by @bitwes in #407
- 4.0 Gut Runner Fixes by @Tim-Fronsee in #404
- 4 0 experiments gut refactor by @bitwes in #411
- Godot 4 watch signals by @bitwes in #412
- Godot 4 Inst to Dict by @Tim-Fronsee in #413
- Godot 4 CanvasItem Redraw Function Name Change by @Tim-Fronsee in #414
- Rename
rect_min_size
tocustom_minimum_size
, set for bottom panel by @aaronfranke in #417 - Fix Gut not recognizing
--script
by @aaronfranke in #419 - Godot 4 Yield To Fix by @Tim-Fronsee in #421
- Fix "instantiate" being used as a noun or adjective by @aaronfranke in #422
- Godot 4 doubler by @bitwes in #427
- Godot 4 await by @bitwes in #428
- Godot 4 assert is by @bitwes in #429
- Moved tests back by @bitwes in #430
- Godot 4 beta 2 by @bitwes in #438
- Godot 4 fix tests by @bitwes in #447
- Godot 4 inner classes by @bitwes in #448
- Godot 4 new stubber by @bitwes in #449
- Godot 4 output cleanup by @bitwes in #451
- Godot 4 use awaiter by @bitwes in #452
- Godot 4 fix array dictionary compare by @bitwes in #458
- [fix] issue #443 ParseError in gut_config_gui by @theludovyc in #454
- run at cursor appears to be working by @bitwes in #463
- Godot 4 output control by @bitwes in #464
- shortcuts working by @bitwes in #465
- Godot 4 panel results tree fixes by @bitwes in #466
- Godot 4 runner fixes by @bitwes in #470
- Remove call to deprecated clear_text() by @mbrealm in #469
- Final Godot 4 tweaks by @bitwes in #471
- Godot 4 release prep by @bitwes in #474
New Contributors
- @Structed made their first contribution in #348
- @Tim-Fronsee made their first contribution in #395
- @theludovyc made their first contribution in #454
- @mbrealm made their first contribution in #469
Full Changelog: v7.3.0...v9.0.0