papyrus-lang icon indicating copy to clipboard operation
papyrus-lang copied to clipboard

Add Papyrus test runner and unit testing framework.

Open Scrivener07 opened this issue 5 years ago • 2 comments

Describe

This is a feature request for a Papyrus unit testing provider in VS Code. Imagine automatic pass/fail unit testing and building a code coverage report for papyrus.

Thankfully Chesko has already done half of the work by writing a test framework for scripts. With Lilac we can use the game developer console and log files to execute and read reports.

Ive used it and have some samples and project examples. It works well but it may be difficult for beginner scripters. If integrating Lilac ends up being the smartest course of action then it would also be neat to retain the Lilac branding and art where possible. Even if its purely documentation or the odd icon or text label in editor. Kinda like how you see the Git icon in VS Code as a supplemental technology.

I thinking it would be good to add a panel for it with the debugger or something along those lines. We could even integrate the whole Lilac code base if it ends up being necessary. Using some runtime script injection is also a possibility for a testing framework. Loading and binding scripts is apparently something that can be done via the in game developer console. Ive never bothered to try since it never had any use to me in a release distribution or debugging for me.

Lilac - A Papyrus Testing Framework

This is the Lilac Documentation with project summary below.

lilac_fallout

Lilac is a unit testing framework for Papyrus. It has a simple and direct syntax so that you can easily write tests to increase the quality of your mods.

It is inspired by Jasmine for Javascript. It is currently available for Fallout 4 (GitHub) and Skyrim (GitHub) under the MIT license.

Lilac can be built into your mod and distributed with it. Your tests will only run when you decide to run them; your users will most likely never know they exist.

Introduction

Lilac is a behavior-driven development framework for Papyrus. It has a clean, Jasmine-like syntax so you can quickly write tests for your mods.

  • All of Lilac is contained in a single script file, Lilac.psc.
  • There is no complex set-up or installation.
  • Lilac does not require any external dependencies.

Details

  1. Display a list of available tests.
    • Be able to run tests.
    • Be able to stop tests.
    • Be able to restart tests.
    • Be able to view test results.

Scrivener07 avatar Jun 21 '19 14:06 Scrivener07