You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Ian Chamberlain 1b0f5fc7e1
Add doctest macro to setup doctests
1 year ago
.github/workflows Add doctest macro to setup doctests 1 year ago
run-tests Add doctest macro to setup doctests 1 year ago
setup Update README with usage examples 1 year ago
test-runner Add doctest macro to setup doctests 1 year ago
.gitignore Copy test runner and actions from ctru-rs 1 year ago
README.md Add doctest macro to setup doctests 1 year ago

README.md

test-runner-3ds

A set of tools for running automated Rust tests against Citra (3DS emulator).

Components

  • test-runner: a Rust crate for writing tests for 3DS homebrew
  • GitHub Actions:
    • setup: action for setting up the Rust 3DS toolchain in workflows
    • run-tests: action for running test executables with Citra in workflows

Usage

First the test runner to your crate:

cargo add --dev test-runner --git https://github.com/ian-h-chamberlain/test-runner-3ds

In lib.rs and any integration test files:

#![feature(custom_test_frameworks)]
#![test_runner(test_runner::run_gdb)]

Then use the setup and run-tests actions in your github workflow. This example shows the default value for each of the inputs:

jobs:
  test:
    runs-on: ubuntu-latest
    container:
      image: devkitpro/devkitarm
      volumes:
        # This is required so the test action can `docker run` the runner:
        - '/var/run/docker.sock:/var/run/docker.sock'

    steps:
      - name: Checkout branch
        uses: actions/checkout@v4

      - name: Setup Rust3DS toolchain
        uses: ian-h-chamberlain/test-runner-3ds/setup@v1
        with:
          # Optionally use a more specific nightly toolchain here if desired
          toolchain: nightly

      - name: Build and run tests
        uses: ian-h-chamberlain/test-runner-3ds/run-tests@v1
        with:
          # Optionally add arguments to pass to `cargo 3ds test`
          args: ''
          # Optionally set the name of the built test-runner docker image
          runner-image: test-runner-3ds
          # Optionally change to a given directory before running tests. Note
          # that this should use the environment variable ${GITHUB_WORKSPACE}
          # rather than ${{ github.workspace }} to avoid the issue described in
          # https://github.com/actions/runner/issues/2058
          working-directory: ${GITHUB_WORKSPACE}