Skip to content

ZScript unit test framework for GZDoom | Used in https://github.com/ZippeyKeys12/rogzis

License

Notifications You must be signed in to change notification settings

mmaulwurff/clematis

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clematis

Basic ZScript unit test framework for GZDoom
Inspired by Lilac by Chesko

Documentation

Making Test Suites

class ClematisExample:Clematis{
    override
    void TestSuites(){
        Describe('Testing Player Stats');
            It('MaxHealth', AssertEval(MaxHealth, '<', 100), LOG_Warning);
            It('Math', AssertEval(1+1, '==', 2), LOG_Fatal);
            It('Woot', AssertTrue(exampleBool), LOG_Fatal);
        EndDescribe();

        Describe('Testing Math');
            It('Calculus', AssertFalse(0*1!=0), LOG_Error);
            It('Math', AssertSame(Pointer1, Pointer2, "Custom error message"), LOG_Warning);
        EndDescribe();
    }
}

Override TestSuites and put in your own! Suites are started with Describe and end with EndDescribe

How to Run Tests

On Instantiation

Tests run on instantiation by default, which can be disabled by overriding Init()

Factory Method
Clematis.Create('ClematisExample');
Network Event
EventHandler.SendNetworkEvent('test:ClematisExample');
Console Command
netevent test:ClematisExample

On Method Call

Clematis Tester=Clematis.Create('ClematisExample');
Tester.Run();

License

Clematis is under the BSD 3-Clause License

Languages

  • C# 98.1%
  • Python 1.9%