Clematis - ZScript Unit Testing Library

Post your example zscripts/ACS scripts/etc here.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
Post Reply
ZippeyKeys12
Posts: 111
Joined: Wed Jun 15, 2016 2:49 pm

Clematis - ZScript Unit Testing Library

Post by ZippeyKeys12 »

Clematis
ZScript unit test framework for GZDoom
Github

See the README for basic instructions.
I plan on adding more features and docs, especially if someone actually uses this.

Allows you to do:

Code: Select all

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), ERR_Error);
            It('Math', AssertSame(Pointer1, Pointer2, "Custom error mesage"), ERR_Warning);
        EndDescribe();
    }
}
So you can set up unit testing for your mod.

There's Clematis.Create(<classname>) for creating the object and executing its Init method, so it is preferred over new(<classname>)

DOWNLOAD

Please let me know what I should add/change and of any errors.
Post Reply

Return to “Script Library”