GithubHelp home page GithubHelp logo

permalmberg / du-unit-testing Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 1.0 44 KB

Unit testing for Dual Universe using DU-LuaC and Busted

License: GNU General Public License v3.0

Makefile 4.75% Lua 87.06% Shell 8.19%
busted dualuniverse lua

du-unit-testing's Introduction

du-unit-testing

The files in this repository sets up a runtime environment to be used when running unit tests for code targeting Dual Universe using the Busted unit testing framework

Instructions

Add this repository as a submodule (or otherwise make it available to your code) and make sure to get all sub repositories too:

git submodule add [email protected]:PerMalmberg/du-unit-testing.git external/du-unit-testing
git submodule update --recursive --checkout --init

Next, setup your LUA_PATH to include the following folders from the root of this repo:

  • src/?.lua
  • external/du-lua-examples/?.lua
  • external/du-lua-examples/api-mockup/?.lua
  • external/du-luac/lua/?.lua

Finally, local env = require("environment") in your code in which you need the environment available. As Busted runs all test files in isolation, you can likely do that at the top of your unit test file. Then do env.Prepare() to setup the environment. Each call to Prepare replaces the environment with a fresh copy of the DU-related globals.

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.