Skip to content

Ability to use busted in devtest unit tests #16119

@appgurueu

Description

@appgurueu

Problem

Our current unit testing framework is a bit crude and inconsistent. We use busted to test "pure Lua" features, such as vectors or serialization. But we can't test features that require the engine Lua environment, e.g. because they are implemented in C++, this way. So we have a unittests mod in devtest with a simple crude unittest framework.

Solutions

Somehow make busted available. This should be doable since busted and the luassert module are pure Lua. However I'm not sure whether the design of busted is suitable is for such an integration. The documentation certainly seems lacking. A quick test using require("busted.runner") (with disabled mod security) still had some major issues.

Alternatives

We could implement the most useful busted features - essentially describe, it and a few asserts - ourselves and expand our unittests framework to be effectively a simpler subset of busted. This might very well be the easier option than frankensteining in busted, and will probably be what I'll do for now.

Additional context

I'm currently working on #15985 and #7478 for which I need to write unit tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    @ BuiltinFeature requestIssues that request the addition or enhancement of a feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions