Comments (13)
To be clear, you can run it via
godot -s -d addons/WAT/CLI.gd -run_? from the command-line.
from wat.
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.
I'll try and prototype a solution
from wat.
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.
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.
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.
Ok so a quick test confirmed me that the debugger isn't linked when you use OS.execute to launch a scene
from wat.
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.
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.
I'm not able to access breakpoints from toolscripts I think.
from wat.
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.
I managed to figure out a way to get it into the button.
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.
Alright, thanks for the info, I'll look forward to 5.0 then :)
from wat.
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)
- C#. Tests are not recognized if put in subfolders of main test folder HOT 1
- Document --no-window for CLI / IDE use cases. HOT 1
- Godot 4 support HOT 3
- Seperate Test Doubles into another Plugin
- Add Contributors Guideline
- Add Docker CI/CD for platforms, versions & build tools. HOT 1
- Use Regex for Yield Calculator HOT 1
- Rename Time Variable HOT 1
- Stop Qutting Godot HOT 1
- Detect Externally created tests
- Fix Run Running All Test Always HOT 1
- Workflow cannot load settings.gd after new change. HOT 1
- Rewrite Documentation
- Fetch tags on test menu about to show HOT 1
- Splitter.gd error using new CLI Syntax HOT 1
- Handle Orphan StringNames HOT 1
- Github Actions Error: "WARNING: WAT: Could not update filesystem" HOT 4
- Filesystem test keys are not respecting case HOT 1
- Use standard paths for build tools
- Add a tab count for results panel
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wat.