Closed brainsick closed 6 years ago
New issue. I'd like the assert() errors to be more descriptive. Better error descriptions will result in better bug reports.
For example:
todd@todd-ab28d3:~/repos/remote/brainsick-godot-tests/tests/qa$ cat utils/Assert.gd
static func assertEquals(a, b):
if (a != b):
print(a, ' != ', b)
assert(a == b) # not the stack info we need
todd@todd-ab28d3:~/repos/remote/brainsick-godot-tests/tests/qa$ cat utils/AssertTest.gd
extends MainLoop
const Assert = preload('Assert.gd')
# main test body
func _iteration(delta):
Assert.assertEquals(true, true)
Assert.assertEquals(true, false)
Assert.assertEquals('a', 'a')
Assert.assertEquals('a', 'b')
Assert.assertEquals(1, 1)
Assert.assertEquals(1, 2)
return true # exit MainLoop
todd@todd-ab28d3:~/repos/remote/brainsick-godot-tests/tests/qa$ ~/Downloads/Godot3.0Beta2/Godot_v3.0-beta2_x11.64 -s utils/AssertTest.gd No touch devices found
OpenGL ES 3.0 Renderer: AMD Radeon (TM) R9 Fury Series (AMD FIJI / DRM 3.18.0 / 4.13.0-21-generic, LLVM 5.0.0)
GLES3: max ubo light: 409
GLES3: max ubo reflections: 455, ubo size: 144
ARVR: Registered interface: Native mobile
True != False
SCRIPT ERROR: assertEquals: Assertion failed.
At: res://utils/Assert.gd:4.
a != b
SCRIPT ERROR: assertEquals: Assertion failed.
At: res://utils/Assert.gd:4.
1 != 2
SCRIPT ERROR: assertEquals: Assertion failed.
At: res://utils/Assert.gd:4.
With this we gain the values that failed but we lose the line it happened on and the function it happened in. Doesn't seem like a good idea.
How can we get the values, the offending function, and the offending file/line? I don't see any means of accessing the call stack from GDScript.
I don't expect to pursue this any further at this time. Closing PR.
Were these unit/integration tests abandoned?
Were these unit/integration tests abandoned?
I suppose the continuation of this could be godotengine/godot#40795, I hope that I won't have to close the PR similarly. 😮
I was very excited to contribute to Godot at the time. I was more effective at finding bugs than fixing them though. This topic got a few people talking and engaged but got nothing from the development team. I moved on.
doctest was merged in the master
branch and we now welcome pull requests adding tests in the main repsoitory. See https://github.com/godotengine/godot/issues/43440 if you are interested in contributing :slightly_smiling_face:
Inspired by #2641. General quality assurance discussion here.
Issues:
To Do:
Classes String Test
This spawned issue godotengine/godot#15471.
Classes UndoRedo Test
Inspired by godotengine/godot#11785.
This spawned issue godotengine/godot#15424. This spawned issue godotengine/godot#15460. This spawned issue godotengine/godot#15506.
Issue godotengine/godot#14799 Test
Just an example. This probably belongs in a Class Test.
Issue godotengine/godot#15166 Test - Shader Crash
Issue godotengine/godot#15149 Test - Wireframe Mode
The beginning of a simple image comparison test. Could be combined with the shader test to monitor shader output.
This spawned issue godotengine/godot#15378.
Issue godotengine/godot#15378 Test - PoolDataArray comparisons
This spawned issue godotengine/godot#15374.
Issue godotengine/godot#15374 Test - Image docs and resize crash
Issue godotengine/godot#15424 Test - UndoRedo crashes