GithubHelp home page GithubHelp logo

vikerman / gdunit4 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mikeschulze/gdunit4

0.0 1.0 0.0 47.37 MB

A Godot Unit Test Framework. Support for GDScript and C# unit testing

License: MIT License

Shell 0.04% C# 0.27% CSS 0.48% GAP 0.04% GDScript 98.46% HTML 0.67% Batchfile 0.05%

gdunit4's Introduction

GdUnit4 GitHub release (latest by date)

A Godot Embedded Unit Testing Framework

This version of GdUnit4 is based on Godot v4.2.1.stable.official [b09f793f5] (master branch)


Supported Godot Versions


GitHub branch checks state

What is GdUnit4?

Gd(Godot)Unit(Unit Testing)4(Godot 4.x)

GdUnit4 is an embedded unit testing framework designed for testing Gd scripts, C# scripts, and scenes in the Godot editor. With GdUnit4, you can easily create and run unit tests to verify the functionality and performance of your code, ensuring that it meets your requirements and specifications.
GdUnit4 is a powerful tool that supports Test-Driven Development (TDD), a popular software development approach that emphasizes creating automated tests before writing any code. By using GdUnit4 for TDD, you can ensure that your code is thoroughly tested and free of bugs, which can save you time and effort in the long run.

Main Features

  • Support for writing and executing tests in GdScript or C#
  • Embedded test Inspector in Godot for easy navigation of your test suites
  • Convenient interface for running test-suites directly from Godot
    One of the main features of GdUnit4 is the ability to run test-suites directly from the Godot editor using the context menu. You can run test-suites from the FileSystem panel, the ScriptEditor, or the GdUnit Inspector. To do this, simply right-click on the desired test-suite or test-case and select "Run Test(s)" from the context menu. This will run the selected tests and display the results in the GdUnit Inspector.
    You can create new test cases directly from the ScriptEditor by right-clicking on the function you want to test and selecting "Create TestCase" from the context menu.
  • Fluent syntax for writing test cases that's easy to read and understand
  • Configurable template for generating new test-suites when creating test-cases
  • Wide range of assertion methods for verifying the behavior and output of your code
  • Argument matchers for verifying that a function call was made with the expected arguments
  • Test Fuzzing support for generating random inputs to test edge cases and boundary conditions
  • Parameterized Tests (Test Cases) for testing functions with multiple sets of inputs and expected outputs
  • Mocking classes to simulate behavior and define output for specific functions
  • Spy feature for verifying that a function was called with the expected parameters
  • Mocking or spying on scenes to simulate behavior and verify that certain functions were called
  • Scene runner for simulating different kinds of inputs and actions, such as mouse clicks and keyboard inputs
    For example, you can simulate mouse clicks and keyboard inputs by calling the appropriate methods on the runner instance. Additionally, you can wait for a specific signal to be emitted by the scene, or you can wait for a specific function to return a certain value.
  • Automatic update notifier to install the latest version of GdUnit from GitHub
  • CI - Continuous Integration support
    • Command line tool for running tests outside of Godot editor
    • Generates HTML report
    • Generates JUnit XML report
  • Public marketplace GitHub action to use in your own CI workflow gdunit4-action
  • Visual Studio Code extension for additional features and integrations in managing and running tests

Basic Test Example

class_name GdUnitExampleTest
extends GdUnitTestSuite

func test_example():
 assert_str("This is a example message")\
   .has_length(25)\
   .starts_with("This is a ex")

Documentation

How to Install GdUnit

API Documentation


You Are Welcome To:

  • Give Feedback on the gdUnit GitHub Discussions page.
  • Suggest Improvements by creating a new feature request issue on the gdUnit GitHub Issues page.
  • Report Bugs by creating a new bug report issue on the gdUnit GitHub Issues page.

GdUnit Test Coverage and Code Quality

Test Coverage:

GdUnit is comprehensively tested to ensure robust functionality.
Continuous Integration (CI) is in place for every pull request to prevent any potential functionality issues.

Code Formatting:

๐Ÿ™ Special Thanks to @Scony for creating gdlint, a valuable tool contributing to code quality.


Contribution Guidelines

Thank you for your interest in contributing to GdUnit4!
To ensure a smooth and collaborative contribution process, please review our contribution guidelines before getting started. These guidelines outline the standards and expectations we uphold in this project.

Code of Conduct: We strictly adhere to the Godot code of conduct in this project. As a contributor, it is important to respect and follow this code to maintain a positive and inclusive community.

Using GitHub Issues: We utilize GitHub issues for tracking feature requests and bug reports. If you have a general question or wish to engage in discussions, we recommend joining the GdUnit Discord Server for specific inquiries.

We value your input and appreciate your contributions to make GdUnit4 even better!


GitHub issues GitHub closed issues
GitHub top language GitHub code size in bytes

Join GdUnit Server

Thank you for supporting my project!


Sponsors:

bitbrain bitbrain bitbrain sebastianhutter

gdunit4's People

Contributors

mikeschulze avatar dependabot[bot] avatar clemens-tolboom avatar linuxusergd avatar adamscott avatar eggbertx avatar structed avatar

Watchers

 avatar

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.