Releases: bitwes/Gut
Releases · bitwes/Gut
v7.4.1
v7.4.0
7.4.0
Features
- Issue 354 Doubles and partial doubles can now be instanced with parameters
- You can now specify parameters when instancing a double/partial double:
var dbl = double(MyClass).new(1, 2, 'c')
- You can now spy on
_init
to verify parameter values:
assert_called(my_inst, '_init', [1, 2, 'c'])
- You can now stub default parameter values for
_init
:
stub(MyClass, '_init').param_defaults([1, 2, 'c'])
- You can now specify parameters when instancing a double/partial double:
- Issue 363 GUT In-Editor Panel Improvements
- New, super fancy, Tree Panel that shows your failing/pending/risky tests. Click an element in the tree, go to that line in the file AND that line in the output.
- You can toggle the visibility of Settings, Output, and Tree panels.
- You can search the output.
- Some nice editor icons to make things look slick.
- Issue 375 You can change the suffix of your test files. Example:
_foo.gd
.
Misc
- Yield messages are now disabled on log level 0.
- Tests that do not assert are included in the summary as "risky".
- Test totals in various places have been adjusted to display a passing count and total count.
- Running a single test script is faster now. Gut no longer parses scripts with non-matching names.
Bug Fixes
- Issue 288 First
yield
in a test does not cause a .4 second delay. - Issue 368 Doubling
WebSocketClient
and anything with aPoolStringArray
default value. - Issue 387 Introduced
auto_flush_input
toInputSender
to address thatInput.use_accumulate_input
is enabled by default in Godot 3.5.0.
v7.3.0
7.3.0
Features
Mocking Input
- Added some
class_name
clauses to files:- Issue 215 You can now use
extends GutTest
instead ofextends 'res://addons/gut/test.gd'
when creating test scripts. That's 45% less text! - When making a hook script, you can use
extends GutHookScript
instead of using the path.
- Issue 215 You can now use
- Added
InputFactory
static class toaddons/gut/test.gd
to simplify creatingInputEvent*
events for use in tests. See Input Factory. - Added
InputSender
class for mocking input and scripting input sequences. See Mock Input.
func test_fireball_input():
var player = Fighter.new()
var sender = InputSender.new(player)
sender.action_down("down").hold_for(.1)\
.action_down("down_forward").hold_for(.1)\
.action_down("forward").key_down("FP")
yield(sender, 'idle')
assert_true(player.is_throwing_fireball())
Misc
- Issue 121 Child tests are now added to the root scene instead of to the GUT Runner. The new "On Top" setting and "Compact Mode" can be used to manage the visibility of objects added during tests and seeing test results.
- Introduced new setting which causes GUT to always be on top. There is an "On Top" setting added to the GUT Panel. This option can also be specified in gutconfig (
"gut_on_top":true
). - Compact Mode added to the panel, gutconfig and command line. This minimizes the size of the GUT runner and puts it in the corner. Unlike Baby...we all can put GUT in the corner.
- In-Editor GUT Panel improvements
- Smart buttons to run tests based on cursor location.
- Added more settings (hook scripts, font color, background color, panel font settings, directory and file dialog buttons where appropriate, hide orphans, disable colors)
- Display counts for errors, warnings, orphans (only displayed when present).
- Issue 310 The summary output now lists the number of passing/failing tests as well as passing/failing assert counts.
Bug Fixes
- Issue 283 The Gut Scene now has a theme with a font which prevents higher level font changes from applying to the Gut Scene.
- Issue 294 GUT ignores the
res://addons/gut
directory if you accidently include it as a test directory.
Related Tutorials
New Gut Panel features: https://youtu.be/tWNswMIJHKk
Mocking Input: https://youtu.be/cRKppa9R7ZQ
7.2.0
7.2.0
Features
- Run GUT straight from the Editor, no scene needed! This is my first stab at making an Editor GUI for GUT. It's not perfect yet so please me know what works and what doesn't. More info in the Quick Start wiki page.
- Issue 207 Added ability to export test results in the JUnit XML format.
- Added "Junit Xml File" setting to the Gut control to specify the file. "Junit Xml Timestamp" will include an epoch timestamp in the filename.
-gjunit_xml_file
and-gjunit_xml_timestamp
are supported on the command line.junit_xml_file
andjunit_xml_timestamp
are supported in the.gutconfig.json
file.
- Added
yield_frames
. It works similar toyield_for
except it will yield for N frames instead of N seconds. - Issue #266 Introduced
stub(...).param_count(x)
which allow you to specify the number of paramters a method has. Useful when working with vararg methods or NativeScripts. This addresses #246 and #252. See the Stubbing page in the wiki for more information. - Issue #263 Introduced
stub(...).param_defaults([])
which allows you to specify the default values that a method should get. See the Stubbing page in the wiki for more information. - Issue #248 Added
get_call_count
which allows you to get the number of times a method was called.
Bug Fixes
- Issue 268 Add message when
assert_signal_emitted_with_parameters
is passed bad parameters. - Issue 258
yield_to
now supports signals with up to 9 parameters. This is the same limit supported bywatch_signals
. - Issue 304
assert_is
no longer errors when asserting objects of typeReference
. - Issue 257 Gut only uses NativeScript when NativeScript exists in the build.
- Issue 290 consts defined in test-scripts that start with 'Test' are further validated before being treated as Inner-Test-Classes.
- Issue 239 @db0 fixed
assert_almost_eq
andassert_almost_ne
to work with Vectors properly.
7.1.0
7.1.0
Misc
prerun_setup
,setup
,teardown
,postrun_teardown
deprecation warnings have been enabled. These were removed from the documentation over 2 years ago (6.6.0) and replaced withbefore_all
,before_each
,after_each
, andafter_all
. Having to make additional changes for these in order to implement Issue 184 annoyed me, so there will now be depracation warnings for these. Earliest they could be removed is 8.0.0.
Features
- Issue 70 Thanks to @short-story-long for adding "property" asserts
assert_property
,assert_setget
,assert_setget_called
. You can now easily asssert you have yoursetget
properties setup correctly including ensuring that your setters/getters are used when accessing an attribute externally. - Issue 66 Thanks to @nilold for adding
assert_not_between
. - Enhanced the printing of floats and strings in the various asserts. Floats will always have a deciaml point now making it easier to see float/int comparisons. All strings are now wrapped in double quotes making it easier to see number/string comparisons.
- Enhanced the display of arrays when using
assert_eq
andassert_ne
. It now lists up to 30 indexes that are different and thier values. Large arrays are also truncated when printed to cut down on output. - Added
compare_deep
,compare_shallow
,assert_eq/ne_deep
,assert_eq/ne_shallow
to aid in comparing dictionaries and arrays. See Comparing Things wiki page for more info. - Issue 201 Added
pass_test(text)
,fail_test(text)
,is_passing()
,is_failing()
methods totest.gd
.- No more
assert_true(true, 'we got here')
! Long livepass_test('we got here')
!
- No more
assert_called_with_paramters
now does a deep comparison of values instead of Godot's default equivalence check.- Issue 152
assert_signal_emitted_with_parameters
now performs a deep compare of the paramters instead of Godot's default equivalence check. - Issue 184 Asserts in
before_all
andafter_all
are now formally supported. They will appear correctly in the output and asserts will be tracked in the summary.
Bug Fixes
- Command Line now returns 1 if no sripts could be loaded.
- Issue 173 An error is now generated if you try to
stub
the_init
method. Documentation has been updated. - Issue 195 Parameterized Tests no longer generate deprecated warnings.
- Fixed various issues with parameterized tests. All test execution is now treated exactly the same(Issue 196, Issue 197, Issue 202).
- Issue 199 If you pass an instance of something to
double
orpartial_double
a GUT error is generated andnull
is returned. - Issue 200 If you pass a non-doubled instance to
stub
a GUT error is generated and nothing is stubbed. - Issue 211 GDNative scripts cause
Error calling built-in function 'inst2dict': Not a script with an instance
when used in assertions. - Issue 230
assert_true
andassert_false
now only accept boolean values. They will fail with anything else. - Issue 231_
assert_is
creates an orphan.
7.0.0
Breaking Changes
- Requires Godot 3.2. Versions 3.1 and earlier are no longer supported.
- You must recreate the GUT node in your test runner scene.
- Take notes on your GUT settings in the editor.
- Delete GUT from the tree and add it back in.
- You may have to restart Godot after this change.
- Repopulate your settings.
- All Doubles and Partial Doubles are freed automatically after each test. Doubles and Partial Doubles created in
before_all
will no longer be around for all tests. - A new signal
gut_ready
should be used instead of_ready
when performing any actions on the GUT object in your test runner scene. You should avoid interacting with GUT until this signal has been emitted. gut.p
no longer supports the 3rd optional parameter for indent level. The parameter still exists but does nothing and generates a deprecation warning.
Potentially Breaking Changes
- The order the tests are run is no longer guaranteed. This has been the case with Inner Test cases but it's now true for all tests.
- The order that Inner Test classes are run is no longer guaranteed.
Features
- Issue 114 By popular demand Parameterized Tests have been added. You can now create a tests that will be run multiple times and fed a list of parameters. (This feature opened up a giant can of worms for logging which led to more cans and more worms.)
- Added Memory Management tools.
- Logging of orphan counts.
- Warnings for children added to tests that are not freed.
- New assert:
assert_no_new_orphans
- New utility methods:
autofree
,autoqfree
,add_child_autofree
,add_child_autoqfree
.
- Issue 168 Added "user directory" file viewer to additional options for viewing logs on a device. See Running on Devices
- Issue 167 Added more areas where filenames are printed when printing objects.
- Redesigned logging to be more consistent across the GUT control, terminal, and Godot console (here be the cans and worms).
- Can now set the font (from a few choices), font size, font color, and the background color!
- Some GUI tweaks.
Bug Fixes
- Thanks to hilfazer for contributing a PR that addressed most of the memory leaks in GUT. This PR also inspired most of the new Memory Management features.
Relevant Wiki Links
- Added a Quick-Start wiki page.
- Memory Management page for all your memory management needs and questions.
- Parameterized Tests.
6.8.3
6.8.3
Features
- Added filename and inner class paths to "expected" and "got" values in asserts. For example you'll see
[Node:1234](my_script.gd)
now instead of just[Node:1234]
. Types are also included where appropriate. For exampleColor(1,1,1,1)
instead of(1,1,1,1)
but strings and numbers aren't changed. - Text is now wrapped in the display. If you hate it let me know and I'll add a flag.
Bug Fixes
- Xrayez found an issue with the signal watcher in 3.2.2 and fixed it.
- Issue 147 Some built-ins could not be doubled because the underlying class starts with an underscore. This was discovered for
File
. These are now detected and handled. - Issue 149 Using
assert_almost_eq
no longer breaks all the beautiful colors in the display. - Issue 157/160 GDScript templates used for doubling now have a
.txt
extension instead of.gd
. This was causing issues with warnings and exporting tests. If you want to export your tests you must now include*.txt
files. A warning was added if the templates are missing.
6.8.2
6.8.2
Features
- Issue 113 ssd71 added asserts
assert_connected
andassert_not_connected
which allow you to assert an object is connected to a signal. - Added some colors to the console output. This is disabled by default in the editor and enabled by default at the command line. The colors don't work in the Godot console. Each has options to enable/disable them.
- Issue 138 Added
assert_typeof
andassert_not_typeof
. - Doubles are now created in memmory instead of creating temporary files. This does not change how they are used, just how they are created on the backend.
Bug Fixes
- When running a single Inner Class GUT generated a lot of
ERROR: get_as_ratio: Cannot get ratio when minimum and maximum value are equal.
due to changes in 3.2. These have been corrected. - Cleaned up some warnings.
Version 6.8.1
6.8.1
Features
- Godot 3.2 (RC 1 at least) compatible.
- Issue 124 CodeDarigan added the
assert_freed
andassert_not_freed
methods. - Issue 130 GUT now lists the exact line number of a failing test in all cases instead of just the method number in non-inner classes. Thanks to mschulzeLpz for adding
get_stack
magic. - Issue 133 You can now double/partial_double/stub/spy Native classes like
Node2D
andRaycast2D
. Syntax is the same. - Issue 139 There are now
pre
andpost
run script hooks that allow you to run your own code before any tests are run and after all tests are run. This can be useful in setting global values before a run or investigating the results of the run for CICD pipelines and the like. Check the wiki for more info
Bug Fixes
- Issue 127 The method
ignore_method_when_doubling
was added as a workaround for doubling scripts that have static methods. The Doubles wiki page has more info about this method. - Issue 136 Bug can happen when yielding where a
attempt to disconnect signal...while emitting
can occur. Disconnecting from signals is now done viacall_deferred
.
Version 6.8.0
6.8.0
Features
- Issue 98 Added Stubbing method
to_call_super
so that you can force a doubled object to call its super method instead of being stubbed out. - Added Stubbing method
to_do_nothing
. This allows you to be a little more deliberate in your stubbing and is more readable thanto_return(null)
which is basically all it does. It also suppresses un-stubbed method messages. - Issue 115 Partial doubles can now be created with the
partial_double
method. This will give you an object that has all of its methods stubbedto_call_super
. So it will act the same as a normal object, but you can spy and stub methods on it as well. - Experimental FULL doubling is now working in Godot 3.1.
- Experimental FULL doubling now stubs all supported built-ins
to_call_super
under the covers. This means you can stub methods you haven't overloaded in your class (before you could only spy on them). - Issue 105 Added
-gexit_on_success
option to the command line to only exit if all tests passed. - Added
get_version
method toGut.gd
.
Bug Fixes
- Housekeeping, typos and some unused variables.
- Issue 108 Maximize doesn't move back to 0,0.
- Xrayez fixed Issue 109.
- Issue 117 The Spying related methods now fail if you don't pass an array for the list of expected parameters. Something I forgot about when making "TDD and P O N G" episode 2. You can watch it and enjoy me forgetting how to use my own tool.
- Exporting tests in 3.1 appears to be working now. Could not reproduce original issue.
- Issue 111 Tests are now sorted.