Browse Source

More cleanup after updates to test-runner-3ds

pull/135/head
Ian Chamberlain 1 year ago
parent
commit
1905c0ca1b
No known key found for this signature in database
GPG Key ID: AE5484D09405AA60
  1. 37
      .github/workflows/ci.yml
  2. 2
      ctru-rs/examples/hello-world.rs
  3. 8
      ctru-rs/src/services/gfx.rs
  4. 3
      ctru-rs/src/services/romfs.rs

37
.github/workflows/ci.yml

@ -9,12 +9,6 @@ on:
- master - master
workflow_dispatch: workflow_dispatch:
env:
# https://blog.rust-lang.org/2022/06/22/sparse-registry-testing.html
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
# actions-rust-lang/setup-rust-toolchain sets some default RUSTFLAGS
RUSTFLAGS: ""
jobs: jobs:
lint: lint:
strategy: strategy:
@ -33,13 +27,15 @@ jobs:
- name: Checkout branch - name: Checkout branch
uses: actions/checkout@v2 uses: actions/checkout@v2
# TODO update to to rust3ds/$something once migrated. Also, this is a bit # TODO point to to rust3ds/test-runner once migrated
# wordy, it might be nicer to put the actions at the top level of the repo - uses: ian-h-chamberlain/test-runner-3ds/setup@v1
- uses: ian-h-chamberlain/test-runner-3ds/.github/actions/setup@v1
with: with:
toolchain: ${{ matrix.toolchain }} toolchain: ${{ matrix.toolchain }}
- name: Hide duplicate warnings from nightly # https://github.com/actions/runner/issues/504
# Removing the matchers won't keep the job from failing if there are errors,
# but will at least declutter pull request annotations (especially for warnings).
- name: Hide duplicate annotations from nightly
if: ${{ matrix.toolchain == 'nightly' }} if: ${{ matrix.toolchain == 'nightly' }}
run: | run: |
echo "::remove-matcher owner=clippy::" echo "::remove-matcher owner=clippy::"
@ -67,27 +63,22 @@ jobs:
- name: Checkout branch - name: Checkout branch
uses: actions/checkout@v2 uses: actions/checkout@v2
- uses: ian-h-chamberlain/test-runner-3ds/.github/actions/setup@v1 - uses: ian-h-chamberlain/test-runner-3ds/setup@v1
with: with:
toolchain: ${{ matrix.toolchain }} toolchain: ${{ matrix.toolchain }}
- name: Hide duplicated warnings from lint job - name: Hide duplicated warnings from lint job
run: echo "::remove-matcher owner=clippy::" run: echo "::remove-matcher owner=clippy::"
- name: Build lib + integration tests - name: Build and run lib and integration tests
# Technically this will only build one 3dsx even if there's more than one executable, uses: ian-h-chamberlain/test-runner-3ds/run-tests@v1
# but we only run the `.elf` outputs so it doesn't really matter.
run: cargo 3ds test --no-run --tests --package ctru-rs
- name: Build doc tests
run: cargo 3ds test --no-run --doc
- name: Run lib + integration tests
uses: ian-h-chamberlain/test-runner-3ds/.github/actions/citra@v1
with: with:
executable: ./target/armv6k-nintendo-3ds/debug/deps/*.elf args: --tests --package ctru-rs
# TODO: run doc tests https://github.com/ian-h-chamberlain/test-runner-3ds/issues/4 - name: Build and run doc tests
uses: ian-h-chamberlain/test-runner-3ds/run-tests@v1
with:
args: --doc --package ctru-rs
- name: Upload citra logs and capture videos - name: Upload citra logs and capture videos
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3

2
ctru-rs/examples/hello-world.rs

@ -31,6 +31,8 @@ fn main() {
String::from_utf8_lossy(&writer.into_inner().unwrap()) String::from_utf8_lossy(&writer.into_inner().unwrap())
); );
dbg!(std::env::args());
println!("\x1b[29;16HPress Start to exit"); println!("\x1b[29;16HPress Start to exit");
// Main application loop. This checks whether the app is normally running in the foreground. // Main application loop. This checks whether the app is normally running in the foreground.

8
ctru-rs/src/services/gfx.rs

@ -499,8 +499,10 @@ mod tests {
#[test] #[test]
fn gfx_duplicate() { fn gfx_duplicate() {
// NOTE: this will fail if using the console test runner, since that creates // NOTE: this is expected to fail if using the console test runner, since
// a Gfx as part of its test setup. // that necessarily creates a Gfx as part of its test setup:
Gfx::new().unwrap(); let _gfx = Gfx::new().unwrap();
assert!(matches!(Gfx::new(), Err(Error::ServiceAlreadyActive)));
} }
} }

3
ctru-rs/src/services/romfs.rs

@ -27,10 +27,10 @@
#![doc(alias = "embed")] #![doc(alias = "embed")]
#![doc(alias = "filesystem")] #![doc(alias = "filesystem")]
use crate::error::ResultCode;
use std::ffi::CStr; use std::ffi::CStr;
use std::sync::Mutex; use std::sync::Mutex;
use crate::error::ResultCode;
use crate::services::ServiceReference; use crate::services::ServiceReference;
/// Handle to the RomFS service. /// Handle to the RomFS service.
@ -84,7 +84,6 @@ mod tests {
use super::*; use super::*;
#[test] #[test]
#[ignore = "library test .elf doesn't have the romfs in it. citra runner needs to support 3dsx"]
fn romfs_counter() { fn romfs_counter() {
let _romfs = RomFS::new().unwrap(); let _romfs = RomFS::new().unwrap();
let value = *ROMFS_ACTIVE.lock().unwrap(); let value = *ROMFS_ACTIVE.lock().unwrap();

Loading…
Cancel
Save