Giter VIP home page Giter VIP logo

Comments (13)

AlexDarigan avatar AlexDarigan commented on August 14, 2024 1

To be clear, you can run it via

godot -s -d addons/WAT/CLI.gd -run_? from the command-line.

from wat.

AlexDarigan avatar AlexDarigan commented on August 14, 2024 1

Alright I messed around in the experimental branch. This is feasibly but it touches pretty much the whole code base. I've been planning on a proper refactor/rewrite for a while so this seems to be better set for 5.0 which might be a while. However it will solve this issue, solve the other issue with autoloads and probably handle some-side effect related things. Hopefully without changing the user interface too much.

from wat.

Boivin92 avatar Boivin92 commented on August 14, 2024

I'll try and prototype a solution

from wat.

AlexDarigan avatar AlexDarigan commented on August 14, 2024

Alright so for the time being, you should be able to add breakpoints and then run WAT as a scene and not an editor tool.

This is obviously not ideal because we don't want users to care about WAT data. To figure this out I need to figure out if there is a straightforward way of running a scene from the editor. We could possibly execute the scene by passing in commandline arguments from Godot, save the results in a resource, then read those resources for results display.

from wat.

AlexDarigan avatar AlexDarigan commented on August 14, 2024

To re-emphasize; Once I figure out how I can click a tool button to make WAT run a scene implicitly, then a lot of this work is done.

from wat.

Boivin92 avatar Boivin92 commented on August 14, 2024

I asked on the godot Reddit and WillNationsDev pointed me towards the Os.execute(...) method

But I don't know if this allows for breakpoints to be hit or if it just runs the engine with a target scene

from wat.

Boivin92 avatar Boivin92 commented on August 14, 2024

Ok so a quick test confirmed me that the debugger isn't linked when you use OS.execute to launch a scene

from wat.

AlexDarigan avatar AlexDarigan commented on August 14, 2024

Yeah that's a problem. I could figure out a slightly convoluted way to pass results from the scene to the editor via resources but no debugger. If this is going to happen, it won't be for a while if at all.

from wat.

AlexDarigan avatar AlexDarigan commented on August 14, 2024

If you pass "-d" for the debugger, you can access a command-line version. You think something like this might suffice for the time being? A Command Line option also means being able to affect tests on servers if you have no visual interface.

image

I'm not able to access breakpoints from toolscripts I think.

from wat.

Boivin92 avatar Boivin92 commented on August 14, 2024

We could get around this problem by creating a custom node that does all the boilerplate for us.

Example:

extends Node

class_name TestDebugger

export (GDScript) var testScript : GDScript

func _ready():
	var script = testScript.new()
	if script is WATTest:
		#Test Runner sequence (Start -> Pre -> Test -> etc...)
		pass

If we give it a cute icon and some documentation, it makes creating the testing scene really quick and allows to drag & drop the test scripts. Then we simply use good old F6 and our breakpoints are hit.

Not perfect, but better than nothing.

from wat.

AlexDarigan avatar AlexDarigan commented on August 14, 2024

I managed to figure out a way to get it into the button.
image

Basically we search up the editor tree until we get the editor node (is there an easier way to get this?) and then we can access the _menu_option method, then we passed in an enum value (the enum itself having been copied from here: https://github.com/godotengine/godot/blob/22782d519c263febe0af94c7765fd79565c0f3ce/editor/editor_node.h)

I clicked that test runner button below and voila, we got the current open scene running. More detailed iterations could set the particular scene via your export idea there.

from wat.

Boivin92 avatar Boivin92 commented on August 14, 2024

Alright, thanks for the info, I'll look forward to 5.0 then :)

from wat.

AlexDarigan avatar AlexDarigan commented on August 14, 2024

Resolved as of the latest merge! You still control WAT from the editor view but when you click the run, the test runner starts in the game context, giving you the ability to debug tests (this is also available to the command line interface).

from wat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.