MikeSchulze / gdUnit3

A Godot Unit Test Framework. Support for gdScript and c# unit testing
MIT License
312 stars 22 forks source link

GD-349: Don't report -1 as failure line number at runtime mode #349

Closed ZodmanPerth closed 1 year ago

ZodmanPerth commented 1 year ago

The used Godot version: v3.5.1.stable.official [6fed1ffa3]

OS including version: Windows 11

Describe the bug The line number on the report shows the correct line when debugging tests, but when running tests without the debugger the line number is reported as -1

Debug Time: image

Run Time: image

Steps to Reproduce

  1. Create a test with the reproduction method provided below
  2. Run the test with debug
  3. Observe the correct line number is reported
  4. Run the test without debug
  5. Observe the line number is reported as -1

Minimal reproduction project:

func test_lineNumber():
    assert_bool(false).is_true()
MikeSchulze commented 1 year ago

This is not a bug, Godot do not give a full stacktrace at runtime mode. This info is only available at debug mode.

I have to add this info to the documentation, to not confuse the user.

ZodmanPerth commented 1 year ago

In that case I suggest you remove the line number part of the report at runtime and only show it at debug time.