Skip to content

Commit

Permalink
Address review comments and minor renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-h-chamberlain committed May 17, 2024
1 parent 5c81dea commit 752ae6a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ default-members = ["ctru-rs", "ctru-sys"]
resolver = "2"

[workspace.dependencies]
libc = { version = "0.2.121", default-features = false }
libc = { version = "0.2.153", default-features = false }
shim-3ds = { git = "https://github.com/rust3ds/shim-3ds.git" }
pthread-3ds = { git = "https://github.com/rust3ds/pthread-3ds.git" }
test-runner = { git = "https://github.com/rust3ds/ctru-rs.git" }
Expand Down
3 changes: 2 additions & 1 deletion ctru-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ libc = { workspace = true }
[build-dependencies]
bindgen = { version = "0.69", features = ["experimental"] }
cc = "1.0"
# Use git dependency so we can use https://github.com/mystor/rust-cpp/pull/111
cpp_build = { optional = true, git = "https://github.com/mystor/rust-cpp.git" }
doxygen-rs = "0.4.2"
itertools = "0.11.0"
Expand All @@ -47,7 +48,7 @@ which = "4.4.0"
[dev-dependencies]
shim-3ds = { workspace = true }
test-runner = { workspace = true }
cpp = { git = "https://github.com/mystor/rust-cpp.git" }
cpp = "0.5.9"

[package.metadata.docs.rs]
default-target = "armv6k-nintendo-3ds"
Expand Down
3 changes: 1 addition & 2 deletions ctru-sys/build/test_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ impl LayoutTestGenerator {

fn build_struct_test(&self, struct_name: &str) -> proc_macro2::TokenStream {
let name = format_ident!("{struct_name}");
let test_name = format_ident!("layout_test_{name}");

let mut field_tests = Vec::new();
field_tests.push(build_assert_eq(
Expand Down Expand Up @@ -194,7 +193,7 @@ impl LayoutTestGenerator {

quote! {
#[test]
fn #test_name() {
fn #name() {
#(#field_tests);*
}
}
Expand Down
9 changes: 7 additions & 2 deletions ctru-sys/tests/layout_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//! ABI used by libctru and the devkitARM toolchain, instead of just what libclang
//! thinks they should be at bindgen time.

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

Expand Down Expand Up @@ -52,7 +51,13 @@ macro_rules! align_of {
};
}

include!(concat!(env!("OUT_DIR"), "/generated_layout_test.rs"));
#[allow(non_snake_case)]
#[allow(non_upper_case_globals)]
mod generated {
use super::*;

include!(concat!(env!("OUT_DIR"), "/generated_layout_test.rs"));
}

mod helper_test {
macro_rules! packed_struct {
Expand Down
2 changes: 1 addition & 1 deletion test-runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ socket = []
[dependencies]
ctru-rs = { git = "https://github.com/rust3ds/ctru-rs" }
ctru-sys = { git = "https://github.com/rust3ds/ctru-rs" }
libc = "0.2.147"
libc = { workspace = true }

0 comments on commit 752ae6a

Please sign in to comment.