add a skeleton for swapper test code

This commit is contained in:
bunnie 2024-03-08 18:42:13 +08:00
parent c2084af2ad
commit 21338321cd
2 changed files with 52 additions and 0 deletions

View file

@ -0,0 +1,33 @@
[package]
name = "test-swapper"
version = "0.1.0"
authors = ["bunnie <bunnie@kosagi.com>"]
edition = "2018"
description = "Manager of suspend/resume operations implementation"
license = "MIT OR Apache-2.0"
repository = "https://github.com/betrusted-io/xous-core/"
homepage = "https://betrusted.io/xous-book/"
# Dependency versions enforced by Cargo.lock.
[dependencies]
xous-api-susres = "0.9.54"
xous-names = { package = "xous-api-names", version = "0.9.56" }
log-server = { package = "xous-api-log", version = "0.1.54" }
xous = "0.9.58"
xous-ipc = "0.9.58"
log = "0.4.14"
num-derive = { version = "0.3.3", default-features = false }
num-traits = { version = "0.2.14", default-features = false }
rkyv = { version = "0.4.3", default-features = false, features = [
"const_generics",
] }
utralib = { version = "0.1.24", optional = true, default-features = false }
[features]
precursor = ["utralib/precursor"]
hosted = ["utralib/hosted"]
renode = ["utralib/renode"]
default = []

View file

@ -0,0 +1,19 @@
use std::thread::sleep;
use std::time::Duration;
use log::info;
fn main() -> ! {
log_server::init_wait().unwrap();
log::set_max_level(log::LevelFilter::Trace);
info!("my PID is {}", xous::process::id());
const DELAY_MS: u64 = 2000;
for i in 0.. {
info!("Loop #{}, waiting {} ms", i, DELAY_MS);
sleep(Duration::from_millis(DELAY_MS));
}
panic!("Finished endless loop");
}