All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.
- Issue i393 7.4.0 broke running from a scene. On a side note, try the new and improved Gut Panel! It did not break in the last release and was significantly improved!
- 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
_initto 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.
- 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.
- Issue 288 First
yieldin a test does not cause a .4 second delay. - Issue 368 Doubling
WebSocketClientand anything with aPoolStringArraydefault value. - Issue 387 Introduced
auto_flush_inputtoInputSenderto address thatInput.use_accumulate_inputis enabled by default in Godot 3.5.0.
- Added some
class_nameclauses to files:- Issue 215 You can now use
extends GutTestinstead ofextends 'res://addons/gut/test.gd'when creating test scripts. That's 45% less text! - When making a hook script, you can use
extends GutHookScriptinstead of using the path.
- Issue 215 You can now use
- Added
InputFactorystatic class toaddons/gut/test.gdto simplify creatingInputEvent*events for use in tests. See Input Factory. - Added
InputSenderclass 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())
- 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.
- 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/gutdirectory if you accidently include it as a test directory.
- 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_fileand-gjunit_xml_timestampare supported on the command line.junit_xml_fileandjunit_xml_timestampare supported in the.gutconfig.jsonfile.
- Added
yield_frames. It works similar toyield_forexcept 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_countwhich allows you to get the number of times a method was called.
- Issue 268 Add message when
assert_signal_emitted_with_parametersis passed bad parameters. - Issue 258
yield_tonow supports signals with up to 9 parameters. This is the same limit supported bywatch_signals. - Issue 304
assert_isno 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_eqandassert_almost_neto work with Vectors properly.
prerun_setup,setup,teardown,postrun_teardowndeprecation 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.- Issue 254 Warns the user when a new version of Gut is available
- 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 yoursetgetproperties 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_eqandassert_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_shallowto 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_paramtersnow does a deep comparison of values instead of Godot's default equivalence check.- Issue 152
assert_signal_emitted_with_parametersnow performs a deep compare of the paramters instead of Godot's default equivalence check. - Issue 184 Asserts in
before_allandafter_allare now formally supported. They will appear correctly in the output and asserts will be tracked in the summary.
- Command Line now returns 1 if no sripts could be loaded.
- Issue 173 An error is now generated if you try to
stubthe_initmethod. 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
doubleorpartial_doublea GUT error is generated andnullis returned. - Issue 200 If you pass a non-doubled instance to
stuba GUT error is generated and nothing is stubbed. - Issue 211 GDNative scripts cause
Error calling built-in function 'inst2dict': Not a script with an instancewhen used in assertions. - Issue 230
assert_trueandassert_falsenow only accept boolean values. They will fail with anything else. - Issue 231_
assert_iscreates an orphan.
- 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_allwill no longer be around for all tests. - A new signal
gut_readyshould be used instead of_readywhen 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.pno longer supports the 3rd optional parameter for indent level. The parameter still exists but does nothing and generates a deprecation warning.
- 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.
- 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.
- 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.
- Added a Quick-Start wiki page.
- Memory Management page for all your memory management needs and questions.
- Parameterized Tests.
- 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 a 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.
- 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_eqno longer breaks all the beautiful colors in the display. - Issue 157/160 GDScript templates used for doubling now have a
.txtextension instead of.gd. This was causing issues with warnings and exporting tests. If you want to export your tests you must now include*.txtfiles. A warning was added if the templates are missing.
- Issue 113 ssd71 added asserts
assert_connectedandassert_not_connectedwhich 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_typeofandassert_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.
- 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.
- Godot 3.2 compatible.
- Issue 124 CodeDarigan added the
assert_freedandassert_not_freedmethods. - 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_stackmagic. - Issue 133 You can now double/partial_double/stub/spy Native classes like
Node2DandRaycast2D. Syntax is the same. - Issue 139 There are now
preandpostrun 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
- Issue 127 The method
ignore_method_when_doublingwas 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 emittingcan occur. Disconnecting from signals is now done viacall_deferred.
- Issue 98 Added Stubbing method
to_call_superso 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_doublemethod. 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_superunder 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_successoption to the command line to only exit if all tests passed. - Added
get_versionmethod toGut.gd.
- 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.
- It is not required, but you should remove the existing Gut node for any scenes you have that use it and then re-add it and re-configure it. Re-adding will get rid of the caution symbol next to the control (this is due to changes in inheritance, Gut changed from a
WindowDialogto aControl) - For the command line, note that the
logoption in the.gutconfig.jsonfile has changed tolog_levelfor consistency.
- 3.1 Compatible (with a few very minor issues, check them out here.)
- Issue 73 You can now export your tests and run them in your exported game! This means you can run your tests on all the platforms that Godot supports through the executable...no editor, no nothing! Check out the Export Tests wiki page for more information.
- Issue 102 Added
get_call_parameterswhich 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. - Issue 103 Added
replace_nodewhich 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 withqueue_free - A brand new GUI. It looks a lot like the old GUI but it is new. With the ability to export tests I wanted the GUI to be more mobile friendly. So I threw the old one out (which was a relic of the days when Gut was one script...the old GUI was made entirely with code) and created a scene which will make GUI changes soooo much easier going forward.
-gprint_gutconfig_samplecommand line option will print you a full config file that you can start using.
- Issue 104 Added all missing settings to the gutconfig file.
- For consistency the
logoption in the .gutconfig changed tolog_level.
- For consistency the
- Improved logging. More warnings and errors have been added to help when something goes wrong inside Gut. The number of Gut related errors, warnings, and deprecated methods are listed in the summary. If you don't see any listed, there aren't any.
- A lot of housekeeping and Boy Scouting.
- You can no longer set the selected script when adding scripts one by one via
add_script. If you pass a 2nd parameter an error is generated, but everything will continue to run. - Deprecated the following methods:
end_testand the oldgut.end_yielded_test. These no longer need to be called.assert_get_set_methodswas replaced withassert_accessorsawhile ago. In this release I added deprecation messages for this method. It still works, but wanted to start getting the message out.assert_extendshas been replaced withassert_isto match the 3.0 names.
- Stop button was removed. It didn't really work that well anyhow. I could be convinced to put it back.
Was exporting a directory that I shouldn't, added it to the .gitattributes
assert_nullandassert_not_null- added
simulateto the test object so you no longer have to usegutwhen calling it. It is fine if you still do though. Sorry if this breaks something. - Doubling, Stubbing, and Spies are no longer considered experimental.
- The
doublemethod is now smart:- It knows when you pass it a scene or a script, no need for
double_sceneanymore but it remains. - You can pass it a loaded class or scene like this:
var MyClass = load('res://my_class.gd') var MyClassDouble = double(MyClass) - It knows when you pass it a scene or a script, no need for
- You can now
doubleInner Classes by passing an Inner Class path like so:double('res://my_script.gd', 'Inner1/InnerInInner1/AndSoOn') - The start of an internal Gut logger to make better messages down the road.
- Experimental Full doubling allows you to Spy on most Built-in methods. You still cannot Stub them though. This must be enabled, details in the Double Wiki page.
- Added link to Rainware's setup tutorial on youtube to the README
- Issue 94 Gut runs
after_allon inner classes that are skipped. - Rawsyntax fixed a bunch of misspellings so that we can erock on with less bad speligs fo wrds.
- Issue 60: Improved signal assert failure messages in some cases by having them include a list of signals that were emitted for the object.
- Issue 88: Fixed issue where you couldn't specify the config_file from the command line.
- Issue 95: Fixed issue where sometimes Gut can end up clearing files from
res:\\when using doubling.
- Issue 79: Scaling wasn't being accounted for by the
maximizemethod. - Issue 80: Inner classes are no longer included in the count of scripts that were ran.
Issue 83: Added option to include subdirectories. Thanks to ChemicalInk for doing the initial work to implement the traversals. The option is off by default so that it doesn't break anything. This will probably change in later releases.
- gutconfig: include_subdirs
- command line: -ginclude_subdirs
- editor: Include Subdirectories
- Gut instance: set/get_include_subdirectories()
Issue 69: Renamed some methods. The old names will remain but the documentation has been updated to reflect the new names. If I ever end up removing the old names they will become deprecated for awhile and then removed in some later release.
assert_get_set_methodsrenamed toassert_accessorsb/c it is easier to sayassert_extendsrenamed toassert_isb/c the keyword changed in gut 3.0
The setup/teardown methods got a rename so they are a little easier to understand. You should use the new names going forward, but refactoring existing tests can be messy (see note below).
prerun_setuprenamed tobefore_allsetuprenamed tobefore_eachpostrun_teardownrenamed toafter_allteardownrenamed toafter_each
Note about setup/teardown rename:
- The new methods could not be actual aliases due to how they are used internally. They exist side by side with the old names and are called after the old methods. DO NOT use both in the same script.
- If you refactor your tests to use the new names, be careful wherever you have a test class that extends another test class and it calls
super's setup/teardown methods. For example, if you renamesuper'ssetuptobefore_eachbut all the test classes that inherit from it are still calling.setupthen you'll have problem on your hands.
- Bug fix by Xrayez to ensure that the command line tool always sets the return code properly. Before it was only setting it if Gut was configured to exit when done.
- Fixed an issue where the command line tool wasn't setting options correctly when the .gutconfig.json file was present. All options are now applied correctly based on order of precedence (default < gutconfig < cmd line). I also added the
-gpocommand line option to print out all option values from all sources and what value would be used when running Gut. This will make debugging theses issues easier later.
- We have two new asserts thanks to hbergren. These asserts make it easier to assert if a value is within or outside of a +/- range of a value. These are especially useful when comparing floats that the engine insists aren't equal due to rounding errors.
assert_almost_eq(got, expected, error_interval, text='')- Asserts thatgotis within the range ofexpected+/-error_interval. The upper and lower bounds are included in the check. Verified to work with integers, floats, and Vector2. Should work with anything that can be added/subtracted. Examplesassert_almost_ne(got, expected, error_interval, text='')- This is the inverse ofassert_almost_eq. This will pass ifgotis outside the range ofexpected+/-error_interval. Examples
- Xrayez contributed a new option to maximize the Gut window upon launch. The option can be set in the editor, .gutconfig, or at the command line.
- Added the
-gpocommand line option to print out all option values from all sources and what value would be used when running Gut. This will make debugging option issues much easier.
Some housekeeping. Removed some commented out and unreachable code. Renamed a lot of tests in test_test.gd since it now uses Inner Test Classes which allows for better names. They were setting a bad example for PRs.
I've "dog food"ed the doubles, stubs, and spies more in my own game and I think they are pretty stable. This release contains some tweaks to doubles and stubs and the introduction of spies as well as some other testing goodness.
inner_class_nameoption for editor node, command line, and .gutconfig.json.assert_exports: Assert that script exports a variable with a specific type. Thanks Myrkrheim- Command line now returns
0when all tests pass and1if there are any failures. Thanks cmfcmf. - You can now set the opacity for the GUI through a command line option or the
.gutconfig.jsonfile. That one is also thanks to Myrkheim. - Spies (experimental)
- You can make assertions now about method calls on doubled objects.
assert_calledassert_not_calledassert_call_count
- Fixed issue with duplicate methods in doubled classes.
First, the Readme has been broken up into a Github wiki. I think this will make consuming the help easier. There is probably some room for improvement in the documentation and organization. Create issues for anything that could be done better.
You can now create "Inner Classes" that run tests. This allows you to breakup your tests and create multiple setup/teardown scopes in a single script.
Example:
extends "res://addons/gut/test.gd"
class TestInnerClass:
extends "res://addons/gut/test.gd"
func setup():
pass
class TestInnerClass2:
extends "res://addons/gut/test.gd"
func setup():
passThere is now support for a config file for the command line tool. It only supports some options right now, but that will be expanded in the future.
{
"dirs":["res://test/unit/", "res://test/integration/"],
"should_exit":true,
"ignore_pause":true,
"log": 3
}There are also two new experimental features in this release. Doubling and Stubbing. These are experimental because their implementation could change a lot. I hope not, but they might. I fought with how these should work a lot, and honestly, I might have gotten it wrong. So I'm going to put it out there and see how they get used in the wild. I'm dedicated to keeping these features and improving on them, but they might be a little rough around the edges.
You can find out more about Stubbing and Doubling in the Wiki.
Big thanks to cmfcmf for introducing me to .gitattributes and creating a PR to put the old repo structure back. Now that I can easily exclude files from the exported zip file, this should be the last reorg or the repo.
- Some new asserts courtesy of Myrkrheim
assert_string_contains
assert_string_starts_with
assert_string_ends_with
assert_has_method- Added .gitattributes which might make for less un-checkboxing when installing from Asset Library and less extra files when downloading the addon. If this works out, then the next release will undo moving everything into
gut_tests_and_examplesand everything will be right in the world. Thanks cmfcmf.
- Moved as many files as I could to
gut_tests_and_examplesso that there was less stuff to uncheck when installing via the in-engine Asset Library. I'm still not 100% happy with the setup. - Moved the License to
addons/gut/so that it is distributed with the addon and doesn't accidentally get copied into the root of some other project when installed via the Asset Library. - Some README tweaks.
- Fixed resize window handle bug. It was connecting to wrong signals and didn't work.
- Missed changing
simulateto call_physics_processinstead of_fixed_processin the 3.0 conversion. Fixed that. - Improved summary. It now lists all failures and pendings instead of just listing the scripts that have failures or pending tests.
- Fixed issue where the
signal_watchercould try to disconnect from a freed object. - Added
yield_towhich allows you toyieldto a signal or a maximum amount of time. This keeps your tests moving along if you yield to a signal that never gets emitted. Now the test will fail after an amount of time instead of sitting in limbo forever. This will also watch the signals on the object so you can make asserts about signals after theyieldand you can save a line of code. Example:
# wait for my_object to emit the signal 'my_signal'
# or 5 seconds, whichever comes first.
yield(yield_to(my_object, 'my_signal', 5), YIELD)
assert_signal_emitted(my_object, 'my_signal', \
'Maybe it did, maybe it didn\'t, but we still got here.')- Godot 3.0 compatibility
- Combined GutTests repo so everything is now in one place.
- Fixed bug where prev/next were disabled incorrectly on startup.
- Some house keeping.
No longer works with Godot 2.x, other than that everything remained the same.
- Fixed issue where
watch_signalswas not working with "Script Signals". These are signals defined using the syntaxsignal SomeSignalinstead of usingadd_user_signalto create them. - Fixed a link in the README
This version mostly contains some long overdue house cleaning. So that this wasn't JUST a reorganization release I also added an method for asserting instance type and inheritance and some minor tweaks.
This change should only affect really old tests. If you started using Gut later than 4.0 then you will most likely be ok. The best approach to adjusting your tests is just to run them and see if it tells you that you are calling any methods that have been moved and then fixing them by removing the gut. prefix.
Due to the restructuring I've completely moved the various asserts out of the core gut object and put them in the test object that all unit tests inherit from. This means that any asserts or pending calls that are prefixed with gut. need to have the gut. prefix removed. To cut down on the annoyance level of this change I've added stubs for the removed methods that fail with a message indicating that the method has been moved.
- New Methdos
assert_extendsAsserts that an instance of an object inherits from the class passed.
- Some changes to the log output.
- Quick summary about each test script is included at the end of the run.
- Scripts that had a failing assert are listed together in the quick summary.
- Changed the GUI to have a fixed width font. It makes formatting the output easier and I like it more. Future changes should make customizing the GUI possible, so if you aren't fond of it you'll be able to change it sometime soon.
- All asserts were moved from the
gutclass to thetestclass so you don't need to prefix them. Placeholder methods were put back intogutso your tests will run but fail with a message indicating the assert has been moved.
When I first created Gut I tried to keep it all to a single file so that deployment was easier. With the advent of the Addons system, I have a lot more freedom in structuring the files. I had also based the structure of the classes on another unit test tool I had cobbled together for a procedural language. This refactoring of the files will make changes easier in the future and separates out the various responsibilities into their own files and classes better.
- Added the ability to assert that signals did or did not fire. By calling
watch_signalsGut will monitor any signals emitted by the object. You can then later make assertions about whether or not a signal was emitted or whether it emitted a desired number of times, and even if it was emitted and passed specific parameters. You can also verify that the signal was emitted with the right parameters. The following methods were added for this feature, see the README for more information about them.watch_signalsassert_signal_emittedassert_signal_not_emittedassert_signal_emitted_with_parametersassert_signal_emit_countassert_has_signalget_signal_emit_countget_signal_parameters
- Some minor fixes to
gut.p- It now performs a
stron the input. So if you pass it an object or something that isn't a string it won't blow up. - It now indents multi-line input correctly.
- It now performs a
Before upgrading, remove gut.gd and gut_cmdln.gd from your your current project. That will help ensure that you got everything setup right with the new install location.
- The install location has changed to
res://addons/gut. So you'll want to clean out wherever you had it previously installed. - You'll want to update your existing scene to use the new plugin object. Follow the new install instructions.
Note: just about everything you had to code to get your main testing scene running can now be configured in the Editor. Select the Gut node and the options will appear in the Inspector. Your existing code will work with the new custom node but using the Editor greatly simplifies things. - The object that all test scripts must extend has changed to
res://addons/gut/test.gd. - All examples and tests for Gut itself have been moved to the new repo https://github.com/bitwes/GutTests/
- There were earlier versions, they had changes but I can't remember what they were.