GithubHelp home page GithubHelp logo

tdaffin / barometer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jjtparadox/barometer

0.0 2.0 0.0 118 KB

Experimental test library for MinecraftForge mods.

License: GNU Lesser General Public License v3.0

Kotlin 84.49% Java 15.51%

barometer's Introduction

Barometer

An experimental test suite for MinecraftForge mods. Runs with MC 1.10.2 and requires ForgeGradle.

Usage

Download the latest release from the GitHub releases page and put it into your project's ./libs folder.

Add the following to your build.gradle's dependency section:

dependencies {
    // ...
    testCompile "org.jetbrains.kotlin:kotlin-stdlib:1.1.2-5"
    testCompile "org.jetbrains.kotlin:kotlin-reflect:1.1.2-5"
    testCompile "junit:junit:4.12"
    testCompile makeStart.outputs.files
}

Add the following to the end of build.gradle:

test {
    // Number of test classes that are run before the server is closed (if this value is wrong things will break!)
    systemProperty 'barometer.numClasses', 1
    
    workingDir = {minecraft.runDir + "/test"} // This can be set to whatever you prefer
}

Make sure the directory ./run/test (or equivalent) exists.

Create the directories ./src/test/java/YourModPackage for test classes.

Create JUnit tests as usual, except prepend each class with the annotation @RunWith(BarometerTester.class). Look to BarometerExampleTestJava.java for an example.

Run all tests with gradle test.

Notes:

  • All tests are server side ONLY.
  • Remember to agree to eula.txt in your test's run dir.
  • Use TestUtils.tickServer(); to tick the server while in tests.
  • Always update the barometer.numClasses property in build.gradle every time you create or remove a test class.
  • This is very alpha and will probably collapse into a black hole if you sneeze on it. Please report bugs and submit PRs to GitHub!

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.