jamie-pate / godot-code-coverage

Code coverage tool for gdscript
MIT License
16 stars 3 forks source link

Debugging the Issue while re-running the code coverage #4

Closed nappaillav closed 4 months ago

nappaillav commented 4 months ago

Hi I'm Using Godot 4.2 in windows I cloned this repository ran update_addon.sh but when I'm trying to run the following command

> .\godot.windows.editor.x86_64.exe -s godot-code-coverage\addons\coverage\coverage_tree.gd --scene=res://spatial.tscn

Can't load the script "addons\coverage\coverage.gd" as it doesn't inherit from SceneTree or MainLoop. 

Could you help me find the issue. Error message

--- GDScript language server started on port 6005 ---
  res://addons/gut/gut_plugin.gd:1 - Parse Error: Unexpected "Identifier" in class body.
  modules\gdscript\gdscript.cpp:2726 - Failed to load script "res://addons/gut/gut_plugin.gd" with error "Parse error". (User)
  editor\editor_file_system.cpp:2393 - Detected another project.godot at res://contrib/Gut. The folder will be ignored.
  res://addons/gut/gut_plugin.gd:1 - Parse Error: Unexpected "Identifier" in class body.
  modules\gdscript\gdscript.cpp:2726 - Failed to load script "res://addons/gut/gut_plugin.gd" with error "Parse error". (User)
  res://addons/gut/gut_cmdln.gd:220 - Parse Error: Static function "print()" not found in base "GDScriptNativeClass".
  res://addons/gut/gut_cmdln.gd:226 - Parse Error: Static function "print()" not found in base "GDScriptNativeClass".
  res://addons/gut/gut_cmdln.gd:286 - Parse Error: Cannot find member "exit_code" in base "OS".
  res://addons/gut/gut_cmdln.gd:291 - Parse Error: Cannot find member "exit_code" in base "OS".
  res://addons/gut/gut_cmdln.gd:305 - Parse Error: Cannot find member "exit_code" in base "OS".
  modules\gdscript\gdscript.cpp:2726 - Failed to load script "res://addons/gut/gut_cmdln.gd" with error "Parse error". (User)

Powershell error message

Project is missing: C:/Users/vchidambaramadaikkap/Downloads/godot-code-coverage-main/godot-code-coverage-main/project.godot
ERROR: Cannot open file 'res://spatial.tscn'.
   at: (scene\resources\resource_format_text.cpp:1646)
ERROR: Failed loading resource: res://spatial.tscn. Make sure resources have been imported by opening the project in the editor at least once.
   at: (core\io\resource_loader.cpp:275)
SCRIPT ERROR: Cannot call method 'get_state' on a null value.
          at: Coverage.instrument_scene_scripts (C:/Users/vchidambaramadaikkap/Downloads/godot-code-coverage-main/godot-code-coverage/addons/coverage/coverage.gd:569)
SCRIPT ERROR: Cannot call method 'instantiate' on a null value.
          at: _run_scene (C:/Users/vchidambaramadaikkap/Downloads/godot-code-coverage-main/godot-code-coverage/addons/coverage/coverage_tree.gd:18)
Editing project: C:/Users/vchidambaramadaikkap/Downloads/godot-code-coverage-main/godot-code-coverage
Godot Engine v4.2.3.rc.custom_build.7a3a36ab8 - https://godotengine.org
Vulkan API 1.3.236 - Forward+ - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce RTX 2070 SUPER

100.0% Total Coverage: 0/0 lines
WARNING: 2 RIDs of type "Canvas" were leaked.
     at: RendererCanvasCull::_free_rids (servers\rendering\renderer_canvas_cull.cpp:2178)
ERROR: 4 RID allocations of type 'struct GLES3::LightStorage::ShadowAtlas' were leaked at exit.
ERROR: 2 RID allocations of type 'struct GLES3::RenderTarget' were leaked at exit.
ERROR: 6 RID allocations of type 'struct GLES3::Texture' were leaked at exit.
ERROR: Texture with GL ID of 20: leaked 1364 bytes.
   at: GLES3::Utilities::~Utilities (drivers\gles3\storage\utilities.cpp:79)
ERROR: Texture with GL ID of 21: leaked 1364 bytes.
   at: GLES3::Utilities::~Utilities (drivers\gles3\storage\utilities.cpp:79)
ERROR: 2 RID allocations of type 'struct RendererViewport::Viewport' were leaked at exit.
ERROR: 2 RID allocations of type 'struct RendererSceneCull::Scenario' were leaked at exit.
ERROR: 1 RID allocations of type 'struct TextServerAdvanced::FontAdvanced * __ptr64' were leaked at exit.
WARNING: ObjectDB instances leaked at exit (run with --verbose for details).
     at: ObjectDB::cleanup (core\object\object.cpp:2209)
ERROR: Resources still in use at exit (run with --verbose for details).
   at: ResourceCache::clear (core\io\resource.cpp:492)
WARNING: Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
     at: _editor_init (modules\gltf\register_types.cpp:63)
SCRIPT ERROR: Parse Error: Unexpected "Identifier" in class body.
          at: GDScript::reload (res://addons/gut/gut_plugin.gd:1)
ERROR: Failed to load script "res://addons/gut/gut_plugin.gd" with error "Parse error".
   at: ResourceFormatLoaderGDScript::load (modules\gdscript\gdscript.cpp:2726)
WARNING: Detected another project.godot at res://contrib/Gut. The folder will be ignored.
     at: EditorFileSystem::_should_skip_directory (editor\editor_file_system.cpp:2393)
SCRIPT ERROR: Parse Error: Unexpected "Identifier" in class body.
          at: GDScript::reload (res://addons/gut/gut_plugin.gd:1)
ERROR: Failed to load script "res://addons/gut/gut_plugin.gd" with error "Parse error".
   at: ResourceFormatLoaderGDScript::load (modules\gdscript\gdscript.cpp:2726)
SCRIPT ERROR: Parse Error: Static function "print()" not found in base "GDScriptNativeClass".
          at: GDScript::reload (res://addons/gut/gut_cmdln.gd:220)
SCRIPT ERROR: Parse Error: Static function "print()" not found in base "GDScriptNativeClass".
          at: GDScript::reload (res://addons/gut/gut_cmdln.gd:226)
SCRIPT ERROR: Parse Error: Cannot find member "exit_code" in base "OS".
          at: GDScript::reload (res://addons/gut/gut_cmdln.gd:286)
SCRIPT ERROR: Parse Error: Cannot find member "exit_code" in base "OS".
          at: GDScript::reload (res://addons/gut/gut_cmdln.gd:291)
SCRIPT ERROR: Parse Error: Cannot find member "exit_code" in base "OS".
          at: GDScript::reload (res://addons/gut/gut_cmdln.gd:305)
ERROR: Failed to load script "res://addons/gut/gut_cmdln.gd" with error "Parse error".
   at: ResourceFormatLoaderGDScript::load (modules\gdscript\gdscript.cpp:2726)

Thanks

jamie-pate commented 4 months ago

If you want to run the addon in your project you should copy godot-code-coverage/addons/coverage -> <your project>/addons/coverage

The spatial.tscn file is part of the demo project that also uses addons/coverage as a plugin to run tests and etc.