Skip to content

Releases: bitwes/Gut

9.7.1

Choose a tag to compare

@bitwes bitwes released this 10 Jul 00:01
aeb5d4f

Bug Fixes

  • 841 Invalid classes in class list was causing doubles to have parsing errors on some operating systems.
  • 842 Ignore "Compiler bug: Unresolved return" errors which can occur when doubles are being generated. The error still appears in the log but GUT will no longer fail tests when it occurs.
  • Ported changes from 9.6.1

9.6.1

Choose a tag to compare

@bitwes bitwes released this 09 Jul 17:43
c80954f

Features

  • 805 Renamed internal classes to make clashes with autoloads and user classes far less likely.

Bug Fixes

  • 802 The GUT Panel no longer overlaps with the Editor's center panel tabs when it is at its minimum size.
  • 824 Fixed using assert_no_new_orphans in after_all.
  • Various changes to the "Check for update" system.

New Contributors

Full Changelog: v9.6.0...v9.6.1

9.7.0

Choose a tag to compare

@bitwes bitwes released this 19 Jun 23:17

9.7.0

Breaking Changes

Godot 4.7 introduced more restrictive type checking for return values. In prior releases Doubles could return null regardless of the declared return type of the function. Doubles have been adjusted to return a default value for each TYPE_ constant. This may cause false postives/negatives in existing and new tests if you do not take this into account.

You can find a complete list of the default values at https://gut.readthedocs.io/en/latest/Doubles.html

When a method is stubbed to return an invalid value GUT will generate an error but execution will continue. This will result in an engine error as well.

Gut Error Example:

[GUT ERROR]:  Method [explicit_int_return] was stubbed to return invalid value [adsf].

Engine Error Example:

SCRIPT ERROR: Trying to return a value of type "String" from a function whose return type is "int".

stub(...).to_do_nothing() now stubs the method to return the default value for the return type of the function.

Features

  • Compatibility changes for Godot 4.7.

Change Log

New Contributors

9.6.0

Choose a tag to compare

@bitwes bitwes released this 24 Feb 16:39
9f3edeb

9.6.0

Breaking Changes

  • assert_push_error and assert_engine_error now only accept a string and assert a single error exists with the specified text. assert_push_error_count and assert_engine_error_count have been added to assert error counts. It was too witty to have the original methods do two things. assert_push_error and assert_engine_error will fail with a message telling you to use the new methods if you pass them a number.

Features

  • Compatibility changes for Godot 4.6.
  • Added assert_push_warning and assert_push_warning_count. Calls to push_warning no longer cause tests to fail due to unexpected errors (#775).
  • Added print_tracked_errors that will print all errors that were generated by the test.
  • Added the ability to double Godot Singletons (Input, Time, OS, etc.). See https://gut.readthedocs.io/en/latest/Doubling-Singletons.html for more information.
  • When running headless, GUT will automatically ignore all calls to pause_before_teardown and will exit when tests are finished (in case your forget to specify -gignore_pause and -gexit).
  • You can now get the amount of time that has passed for a test via the new methods get_elapsed_sec, get_elapsed_msec, get_elapsed_usec, get_elapsed_idle_frames, , get_elapsed_process_frames, and get_elapsed_physics_frames.

What's Changed

New Contributors

Full Changelog: v9.5.0...v9.6.0

9.5.0

Choose a tag to compare

@bitwes bitwes released this 16 Sep 21:50

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 .uid files 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

New Contributors

Full Changelog: v9.4.0...v9.5.0

9.4.0

Choose a tag to compare

@bitwes bitwes released this 11 Jun 16:37
ca6cf20

9.4.0

Potentially Breaking Changes

  • The deprecated wait_frames and the new wait_idle_frames, wait_physics_frames now count frames when the SceneTree.process_frame and SceneTree.physics_frame signals 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 _process or _physics_process is called on anything in the tree. This means that tree order will not matter and all objects will have finished _process/_physics_process by 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_frames added. This counts frames idle/process frames instead of _physics_process. wait_frames has been renamed (deprecated) to wait_physics_frames.
  • wait_while added. This waits while a Callable returns true.
  • New class_names:
    • GutInputFactory for res://addons/gut/gut_input_factory.gd static 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_frames has been deprecated in lieu of the more specific wait_physics_frames and wait_idle_frames.

Changelog

New Contributors

Full Changelog: 9.3.1...v9.4.0

v9.3.1

Choose a tag to compare

@bitwes bitwes released this 10 Jan 16:53
52e6d7a

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

New Contributors

Full Changelog: v9.3.0...9.3.1

v9.3.0

Choose a tag to compare

@bitwes bitwes released this 25 Jul 15:21
6fc7c17

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) on stub. 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 implicit when_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 return true (aka predicate method) via the new wait_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 new wait_until return true if they did not timeout, and false 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 the button_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 to GutTest. If you impelement this method and return true or a String, 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 using option=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.
  • 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 with Input.is_action_just_pressed, Input.is_action_just_released and Input.is_action_pressed. Thanks @lxkarp and @edearth for you work on this.

Deprecations

  • The optional GutTest script variable skip_script has been deprecated. Use the new should_skip_script method instead.
  • GUT now warns if you have overridden _ready in your test script without calling super._ready.

New Contributors

Full Changelog: v9.2.1...v9.3.0

v9.2.1

Choose a tag to compare

@bitwes bitwes released this 29 Feb 22:54
5782983

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 a class_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

Choose a tag to compare

@bitwes bitwes released this 29 Feb 23:01

What's Changed

Full Changelog: v7.4.2...v7.4.3