From 3243c882df5d75653631353117852c6f4c6dee72 Mon Sep 17 00:00:00 2001 From: Evan Huff Date: Mon, 8 Apr 2024 14:52:30 -0400 Subject: [PATCH] chore: add basic testing module --- .gitignore | 2 +- tests/Cargo.toml | 9 +++++++++ tests/src/main.rs | 11 +++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 tests/Cargo.toml create mode 100644 tests/src/main.rs diff --git a/.gitignore b/.gitignore index ffea379..a0fb642 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -/target +**/target .DS_Store Cargo.lock \ No newline at end of file diff --git a/tests/Cargo.toml b/tests/Cargo.toml new file mode 100644 index 0000000..55169e6 --- /dev/null +++ b/tests/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "tests" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +hardened_malloc-sys = { path = "..", features = ["gcc"]} \ No newline at end of file diff --git a/tests/src/main.rs b/tests/src/main.rs new file mode 100644 index 0000000..1b22e5e --- /dev/null +++ b/tests/src/main.rs @@ -0,0 +1,11 @@ +use hardened_malloc_sys::HardenedMalloc; + +#[global_allocator] +static GLOBAL: HardenedMalloc = HardenedMalloc; + +fn main() { + let mut v = Vec::new(); + v.push(1); + v.resize(5, 0); + println!("v has value: {:?}", v); +}