diff --git a/Cargo.toml b/Cargo.toml index 124e148de7951..a71c3cb579ecf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -139,6 +139,7 @@ extra_traits = [] [workspace] members = [ "ctest", + "ctest-next", "ctest-test", "libc-test", ] diff --git a/ctest-next/Cargo.toml b/ctest-next/Cargo.toml new file mode 100644 index 0000000000000..54c62d05be6ea --- /dev/null +++ b/ctest-next/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "ctest-next" +version = "0.1.0" +edition = "2021" +rust-version = "1.77" +license = "MIT OR Apache-2.0" +repository = "https://github.com/rust-lang/libc" +publish = false + +[dependencies] +cc = "1.2.25" +syn = { version = "2.0.101", features = ["full", "visit", "visit-mut", "fold"] } diff --git a/ctest-next/src/lib.rs b/ctest-next/src/lib.rs new file mode 100644 index 0000000000000..7d12d9af8195b --- /dev/null +++ b/ctest-next/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +}