Coder Social home page Coder Social logo

sgt's Introduction

Simple Godot Tests

About

Addon for Godot that allows you to easily create tests for your C# scripts. Its designed to be as simple to use as possible and have as little dependency issues with different Godot versions.

Wiki

All information needed to use this plugin is provided here.

Dev info

Everything is as Godot/IDE agnostic as possible to minigate all of compatibility issues that other plugins tend to have. The only interface entry points with Godot are Logger and EditorRunner classes.

Testing class can be in any .cs file in your project, I would recommend putting all tests in a test folder so its easier to exclude the testing files in your .csproj file from the realase version of the game:

<PropertyGroup>
  <DefaultItemExcludes Condition="'$(Configuration)' == 'ExportRelease'">
    $(DefaultItemExcludes);YourTestFolderName/**;addons/SGT/**
  </DefaultItemExcludes>
</PropertyGroup>

For older versions of godot everything in addons/SGT/Bridge/GUI can be simply deleted because it only serves as GUI and all core parts are written in pure C#. All you need to do to run the tests is to modify addons/SGT/Bridge/GodotTestRoot.cs to be compatible with your version of godot, and simply call RunTestsInNamespaces(string[] namespaces). If you want to run tests for all namespaces you can get them via AssemblyExtractor.GetAllTestNamespaces().ToArray(), this function gets all namespaces with tests in your entire project.

Q/A

Q: Why no bottom panel?
A: Bottom panel requires using [Tool] attribute for class, and that doesn't work for mono in 4.x

sgt's People

Contributors

ruedoux avatar

Stargazers

 avatar

Watchers

 avatar

sgt's Issues

Todo

TODO:

Make GUI more pleasant to look at.
Standarize output, possibly to XML format similar to other testing frameworks.

Do look at either

  • GodotXUnit (better)
  • NURF

Integration Scene Test

What is your approach to display e.g. animated scene integration test?
Do you have plan to get there?

Documentation related question

Why this project needed? we have Xunit framework, exactly what solution it overcomes? Will I be able to create behavioural test, end to end test cases using this? Is it a way to automate my testing like ChatGPT helps us?

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.