mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
implement shellchat test modals
remove modals feature ux_tests
This commit is contained in:
parent
f19b2ac939
commit
342e8e82b1
5 changed files with 10 additions and 11 deletions
|
|
@ -32,6 +32,5 @@ fast_image_resize = "0.9.2"
|
||||||
utralib = { path = "../../utralib"}
|
utralib = { path = "../../utralib"}
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
ux_tests = []
|
|
||||||
tts = []
|
tts = []
|
||||||
default = ["ux_tests"]
|
default = []
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
pub mod api;
|
pub mod api;
|
||||||
use api::*;
|
use api::*;
|
||||||
|
pub mod tests;
|
||||||
|
|
||||||
use bit_field::BitField;
|
use bit_field::BitField;
|
||||||
use core::cell::Cell;
|
use core::cell::Cell;
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@
|
||||||
/// a `TextResponseValid` message which pumps the work queue.
|
/// a `TextResponseValid` message which pumps the work queue.
|
||||||
mod api;
|
mod api;
|
||||||
use api::*;
|
use api::*;
|
||||||
mod tests;
|
|
||||||
use gam::Bitmap;
|
use gam::Bitmap;
|
||||||
|
|
||||||
use xous::{msg_blocking_scalar_unpack, msg_scalar_unpack, send_message, Message};
|
use xous::{msg_blocking_scalar_unpack, msg_scalar_unpack, send_message, Message};
|
||||||
|
|
@ -126,11 +125,6 @@ fn xmain() -> ! {
|
||||||
let mut list_hash = HashMap::<String, usize>::new();
|
let mut list_hash = HashMap::<String, usize>::new();
|
||||||
let mut list_selected = 0u32;
|
let mut list_selected = 0u32;
|
||||||
|
|
||||||
if cfg!(feature = "ux_tests") {
|
|
||||||
tt.sleep_ms(1000).unwrap();
|
|
||||||
tests::spawn_test();
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut token_lock: Option<[u32; 4]> = None;
|
let mut token_lock: Option<[u32; 4]> = None;
|
||||||
let trng = trng::Trng::new(&xns).unwrap();
|
let trng = trng::Trng::new(&xns).unwrap();
|
||||||
// this is a random number that serves as a "default" that cannot be guessed
|
// this is a random number that serves as a "default" that cannot be guessed
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ use gam::*;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use xous_names::XousNames;
|
use xous_names::XousNames;
|
||||||
use image::io::{Reader};
|
use image::io::{Reader};
|
||||||
|
use super::*;
|
||||||
|
|
||||||
const RADIO_TEST: [&'static str; 4] = ["zebra", "cow", "horse", "cat"];
|
const RADIO_TEST: [&'static str; 4] = ["zebra", "cow", "horse", "cat"];
|
||||||
|
|
||||||
|
|
@ -15,12 +16,12 @@ const CHECKBOX_TEST: [&'static str; 5] = ["happy", "😃", "安", "peaceful", ".
|
||||||
///
|
///
|
||||||
/// Each thread will create a series of Modal primitives, including progess bars, notifications,
|
/// Each thread will create a series of Modal primitives, including progess bars, notifications,
|
||||||
/// check boxes and radio boxes.
|
/// check boxes and radio boxes.
|
||||||
pub(crate) fn spawn_test() {
|
pub fn spawn_test() {
|
||||||
// spawn two threads that compete for modal resources, to test the interlocking mechanisms
|
// spawn two threads that compete for modal resources, to test the interlocking mechanisms
|
||||||
thread::spawn({
|
thread::spawn({
|
||||||
move || {
|
move || {
|
||||||
let xns = XousNames::new().unwrap();
|
let xns = XousNames::new().unwrap();
|
||||||
let modals = modals::Modals::new(&xns).unwrap();
|
let modals = Modals::new(&xns).unwrap();
|
||||||
let tt = ticktimer_server::Ticktimer::new().unwrap();
|
let tt = ticktimer_server::Ticktimer::new().unwrap();
|
||||||
|
|
||||||
// 0. multi-modal test
|
// 0. multi-modal test
|
||||||
|
|
@ -84,7 +85,7 @@ pub(crate) fn spawn_test() {
|
||||||
thread::spawn({
|
thread::spawn({
|
||||||
move || {
|
move || {
|
||||||
let xns = XousNames::new().unwrap();
|
let xns = XousNames::new().unwrap();
|
||||||
let modals = modals::Modals::new(&xns).unwrap();
|
let modals = Modals::new(&xns).unwrap();
|
||||||
|
|
||||||
// 1. test radio box
|
// 1. test radio box
|
||||||
for item in RADIO_TEST {
|
for item in RADIO_TEST {
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ use core::fmt::Write;
|
||||||
use core::sync::atomic::{AtomicBool, Ordering, AtomicU32};
|
use core::sync::atomic::{AtomicBool, Ordering, AtomicU32};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use num_traits::*;
|
use num_traits::*;
|
||||||
|
use modals;
|
||||||
|
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
|
|
||||||
|
|
@ -608,6 +609,9 @@ impl<'a> ShellCmdApi<'a> for Test {
|
||||||
write!(ret, "Ship mode request denied").unwrap();
|
write!(ret, "Ship mode request denied").unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
"modals" => {
|
||||||
|
modals::tests::spawn_test();
|
||||||
|
}
|
||||||
_ => {
|
_ => {
|
||||||
() // do nothing
|
() // do nothing
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue