Giter Club home page Giter Club logo

xunit-unity-runner's Introduction

xUnit.net Unity Runner

This program runs xUnit.net-based unit tests on Unity player so that a software work well on Unity's peculiar runtime environment, which differs from stable Mono.

You can download the executable binaries from the releases page.

This program takes one or more absolute paths to .NET assembly files (.dll) and run tests in them, e.g.:

./StandaloneLinux64 "$(pwd)"/YourTests.dll
StandaloneWindows64.exe C:\path\to\YourTests.dll

It also takes several options like -c/--select-class and -T/--exclude-trait-condition. See --help for details.

On macOS you need to invoke the actual executable binary in StandardOSX.app/Contents/MacOS/ directory, e.g.:

StandaloneOSX.app/Contents/MacOS/unity-xunit "$(pwd)"/YourTests.dll

Note that .dll files to test should target on .NET Framework (e.g., net461), not .NET Core.

CircleCI-style parallelism1

There are two options for running tests in distributed nodes: -D/--distributed and -s/--distributed-seed. The former option takes an argument in the N/M format, where N is the current node's zero-indexed number and M is the total number of distributed nodes. This option selects the subset of the test cases2 for the current node, and this guarantees two different nodes never run the same test case, which is redundant.

For example, the following options make the test execution to take advantage of CircleCI's parallelism:

--distributed=$CIRCLE_NODE_INDEX/$CIRCLE_NODE_TOTAL \
--distributed-seed=$CIRCLE_BUILD_NUM

FAQ

I got Magic number is wrong: 542 error. I'm on Linux.

If the TERM environment variable is not set or it's a value unsupported by Mono (e.g., xterm-256color) yet Unity player's built-in Mono runtime could throw such an exception. You could work around this by setting it xterm:

TERM=xterm ./StandaloneLinux64 "$(pwd)"/YourTests.dll

See also the related issue on the Mono project:

mono/mono#6752

Footnotes

  1. See also CircleCI's related docs: Running Tests in Parallel.

  2. Before a subset is selected, all test filters are applied first. Therefore, all distributed nodes have to apply the same set of filters.

xunit-unity-runner's People

Contributors

dahlia avatar limebell avatar longfin avatar moreal avatar

Watchers

 avatar  avatar

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.