Skip to content

Commit

Permalink
fix testfw
Browse files Browse the repository at this point in the history
  • Loading branch information
xor-bits committed Dec 3, 2023
1 parent d569f77 commit 5eb417b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/kernel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ multiboot2 = []
# Pick limine OR bootboot OR multiboot1 OR multiboot2, they conflict with eachother

[dependencies]
arcstr.workspace = true
spin.workspace = true
x86_64.workspace = true
time.workspace = true
Expand Down
9 changes: 5 additions & 4 deletions crates/kernel/src/testfw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
// extern crate test;

use alloc::{borrow::Cow, format, string::String};
use alloc::{format, string::String};
use core::{any::type_name, panic::PanicInfo};

use arcstr::ArcStr;
use crossbeam::queue::SegQueue;
use hyperion_log::{print, println, LogLevel};
use hyperion_scheduler::yield_now;
Expand Down Expand Up @@ -62,7 +63,7 @@ pub fn test_runner(tests: &'static [&'static dyn TestCase]) {
hyperion_scheduler::spawn(move || {
let name = test.name();
// println!("running {name}");
hyperion_scheduler::rename(name.into());
hyperion_scheduler::rename(name);

test.run();

Expand All @@ -79,7 +80,7 @@ pub fn test_runner(tests: &'static [&'static dyn TestCase]) {
}

hyperion_scheduler::spawn(move || {
hyperion_scheduler::rename("testfw waiter".into());
hyperion_scheduler::rename("testfw waiter");

let mut completed = 0;

Expand Down Expand Up @@ -126,7 +127,7 @@ pub fn test_panic_handler(info: &PanicInfo) -> ! {

//

static RESULTS: SegQueue<(Cow<'static, str>, Option<String>)> = SegQueue::new();
static RESULTS: SegQueue<(ArcStr, Option<String>)> = SegQueue::new();

//

Expand Down
2 changes: 1 addition & 1 deletion crates/scheduler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ fn cpu_time_elapsed() -> u64 {
let now = HPET.nanos() as u64;
let last = last_time().swap(now, Ordering::SeqCst);

now - last
now.saturating_sub(last)
}

fn reset_cpu_timer() {
Expand Down

0 comments on commit 5eb417b

Please sign in to comment.