Bot releases are hidden (Show)
Full Changelog: https://github.com/bitwes/Gut/compare/v7.4.2...v7.4.3
Published by bitwes 8 months ago
var foo := Foo.new()
where foo is a class_name
in another script) could cause errors.Full Changelog: https://github.com/bitwes/Gut/compare/v9.2.0...v9.2.1
Published by bitwes 8 months ago
GutTest
.Full Changelog: https://github.com/bitwes/Gut/compare/v7.4.1...v7.4.2
Published by bitwes 8 months ago
user://
instead of res://
. 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).
user://gut_temp_directory/gut_editor_config.json
user://gut_temp_directory/gut_editor_shortcuts.cfg
user://
have been moved to user://gut_temp_directory
for better house keeping.assert_almost_eq
, assert_almost_ne
, assert_between
and assert_not_between
.gui_input
signal on receivers.user://
now.user://
to user://gut_temp_directory
.Full Changelog: https://github.com/bitwes/Gut/compare/v9.1.1...v9.2.0
Published by bitwes 11 months ago
_ready
and you try to spy on it, your test will now fail since _ready
is virtual and you didn't overload it.rpc_id
, emit_signal
). If you call a doubled method that has a vararg argument and you have not stubbed param_count
on the object's script then a warning is generated.Published by bitwes 11 months ago
_ready
and you try to spy on it, your test will now fail since _ready
is virtual and you didn't overload it.rpc_id
, emit_signal
). If you call a doubled method that has a vararg argument and you have not stubbed param_count
on the object's script then a warning is generated.Published by bitwes over 1 year ago
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.INCLUDE_SUPER
has been renamed to INCLUDE_NATIVE
.INCLUDE_SUPER
, it will use SCRIPT_ONLY
.GutControl
to aid in running tests in a deployed game. Instructions and sample code can be found in the wiki.GutTest
.is_processing
and is_physics_processing
when running thier respective methods.Published by bitwes over 1 year ago
Fixed a bug where you could not double
scripts that used the new Godot 4 accessors.
Published by bitwes over 1 year ago
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.
rect_min_size
to custom_minimum_size
, set for bottom panel by @aaronfranke in https://github.com/bitwes/Gut/pull/417
--script
by @aaronfranke in https://github.com/bitwes/Gut/pull/419
Full Changelog: https://github.com/bitwes/Gut/compare/v7.3.0...v9.0.0
Published by bitwes about 2 years ago
Published by bitwes about 2 years ago
var dbl = double(MyClass).new(1, 2, 'c')
_init
to verify parameter values:assert_called(my_inst, '_init', [1, 2, 'c'])
_init
:stub(MyClass, '_init').param_defaults([1, 2, 'c'])
_foo.gd
.yield
in a test does not cause a .4 second delay.WebSocketClient
and anything with a PoolStringArray
default value.auto_flush_input
to InputSender
to address that Input.use_accumulate_input
is enabled by default in Godot 3.5.0.Published by bitwes over 2 years ago
class_name
clauses to files:
extends GutTest
instead of extends 'res://addons/gut/test.gd'
when creating test scripts. That's 45% less text!extends GutHookScript
instead of using the path.InputFactory
static class to addons/gut/test.gd
to simplify creating InputEvent*
events for use in tests. See Input Factory.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())
"gut_on_top":true
).res://addons/gut
directory if you accidently include it as a test directory.New Gut Panel features: https://youtu.be/tWNswMIJHKk
Mocking Input: https://youtu.be/cRKppa9R7ZQ
Published by bitwes almost 3 years ago
-gjunit_xml_file
and -gjunit_xml_timestamp
are supported on the command line.junit_xml_file
and junit_xml_timestamp
are supported in the .gutconfig.json
file.yield_frames
. It works similar to yield_for
except it will yield for N frames instead of N seconds.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.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.get_call_count
which allows you to get the number of times a method was called.assert_signal_emitted_with_parameters
is passed bad parameters.yield_to
now supports signals with up to 9 parameters. This is the same limit supported by watch_signals
.assert_is
no longer errors when asserting objects of type Reference
.assert_almost_eq
and assert_almost_ne
to work with Vectors properly.Published by bitwes almost 4 years ago
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 with before_all
, before_each
, after_each
, and after_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.assert_property
, assert_setget
, assert_setget_called
. You can now easily asssert you have your setget
properties setup correctly including ensuring that your setters/getters are used when accessing an attribute externally.assert_not_between
.assert_eq
and assert_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.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.pass_test(text)
, fail_test(text)
, is_passing()
, is_failing()
methods to test.gd
.
assert_true(true, 'we got here')
! Long live pass_test('we got here')
!assert_called_with_paramters
now does a deep comparison of values instead of Godot's default equivalence check.assert_signal_emitted_with_parameters
now performs a deep compare of the paramters instead of Godot's default equivalence check.before_all
and after_all
are now formally supported. They will appear correctly in the output and asserts will be tracked in the summary.stub
the _init
method. Documentation has been updated.double
or partial_double
a GUT error is generated and null
is returned.stub
a GUT error is generated and nothing is stubbed.Error calling built-in function 'inst2dict': Not a script with an instance
when used in assertions.assert_true
and assert_false
now only accept boolean values. They will fail with anything else.assert_is
creates an orphan.Published by bitwes over 4 years ago
before_all
will no longer be around for all tests.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.assert_no_new_orphans
autofree
, autoqfree
, add_child_autofree
, add_child_autoqfree
.Published by bitwes over 4 years ago
[Node:1234](my_script.gd)
now instead of just [Node:1234]
. Types are also included where appropriate. For example Color(1,1,1,1)
instead of (1,1,1,1)
but strings and numbers aren't changed.File
. These are now detected and handled.assert_almost_eq
no longer breaks all the beautiful colors in the display..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.Published by bitwes over 4 years ago
assert_connected
and assert_not_connected
which allow you to assert an object is connected to a signal.assert_typeof
and assert_not_typeof
.ERROR: get_as_ratio: Cannot get ratio when minimum and maximum value are equal.
due to changes in 3.2. These have been corrected.Published by bitwes over 4 years ago
assert_freed
and assert_not_freed
methods.get_stack
magic.Node2D
and Raycast2D
. Syntax is the same.pre
and post
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
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.attempt to disconnect signal...while emitting
can occur. Disconnecting from signals is now done via call_deferred
.Published by bitwes over 5 years ago
to_call_super
so that you can force a doubled object to call its super method instead of being stubbed out.to_do_nothing
. This allows you to be a little more deliberate in your stubbing and is more readable than to_return(null)
which is basically all it does. It also suppresses un-stubbed method messages.partial_double
method. This will give you an object that has all of its methods stubbed to_call_super
. So it will act the same as a normal object, but you can spy and stub methods on it as well.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).-gexit_on_success
option to the command line to only exit if all tests passed.get_version
method to Gut.gd
.Published by bitwes over 5 years ago
WindowDialog
to a Control
)log
option in the .gutconfig.json
file has changed to log_level
for consistency.get_call_parameters
which allows you to get the parameters sent to a call to a doubled method. It returns the most recent call by default but you can specify an optional index as well.replace_node
which allows you to replace a node in a scene with another node by specifying the node path. This makes testing scenes that use the $
syntax to get a reference to a child node easier to test by giving you a quick way to inject a double of any child node. The node that was replaced is freed with queue_free
-gprint_gutconfig_sample
command line option will print you a full config file that you can start using.log
option in the .gutconfig changed to log_level
.add_script
. If you pass a 2nd parameter an error is generated, but everything will continue to run.end_test
and the old gut.end_yielded_test
. These no longer need to be called.assert_get_set_methods
was replaced with assert_accessors
awhile ago. In this release I added deprecation messages for this method. It still works, but wanted to start getting the message out.assert_extends
has been replaced with assert_is
to match the 3.0 names.