Skip to content

Commit

Permalink
Fix test compilation.
Browse files Browse the repository at this point in the history
  • Loading branch information
dbittman committed Nov 22, 2024
1 parent 4b4b68a commit f6bd3da
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion src/abi
3 changes: 3 additions & 0 deletions src/lib/twizzler-abi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ version = "0.5"
[features]
# Activate if compiling for the kernel.
kernel = ["volatile"]

[dev-dependencies]
twizzler-minruntime = { path = "../../runtime/minruntime" }
1 change: 1 addition & 0 deletions src/lib/twizzler-abi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ extern crate test;
#[cfg(test)]
mod tester {
use crate::print_err;
extern crate twizzler_minruntime;

#[bench]
fn test_bench(bench: &mut test::Bencher) {
Expand Down
3 changes: 3 additions & 0 deletions src/lib/twizzler-driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ futures = "0.3.21"
async-trait = "0.1.56"
bitflags = "2.4.1"
volatile = { version = "0.5", features = ["unstable"] }

[dev-dependencies]
twizzler-minruntime = { path = "../../runtime/minruntime" }
1 change: 1 addition & 0 deletions src/lib/twizzler-driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ pub fn get_bustree_root() -> BusTreeRoot {

#[cfg(test)]
mod tests {
extern crate twizzler_minruntime;
#[test]
fn it_works() {
let result = 2 + 2;
Expand Down
5 changes: 4 additions & 1 deletion src/lib/twizzler-queue-raw/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ edition = "2021"

[dependencies]
bitflags = "2.4.1"
twizzler-abi = {path = "../twizzler-abi", version = "*"}
twizzler-abi = { path = "../twizzler-abi", version = "*" }

[features]
std = []
default = ["std"]

[dev-dependencies]
twizzler-minruntime = { path = "../../runtime/minruntime" }
1 change: 1 addition & 0 deletions src/lib/twizzler-queue-raw/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ mod tests {
use crate::multi_receive;
use crate::{QueueEntry, QueueError, RawQueue, RawQueueHdr, ReceiveFlags, SubmissionFlags};

extern crate twizzler_minruntime;
fn wait(x: &AtomicU64, v: u64) {
// println!("wait");
while x.load(Ordering::SeqCst) == v {
Expand Down
3 changes: 3 additions & 0 deletions src/runtime/secgate/src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ mod handle;

pub use buffer::*;
pub use handle::*;

#[cfg(test)]
extern crate twizzler_minruntime;
12 changes: 12 additions & 0 deletions tools/xtask/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,23 @@ fn maybe_build_tests<'a>(
"nvme" => None,
"twz-rt" => None,
"monitor" => None,
"monitor-api" => None,
"bootstrap" => None,
"dynlink" => None,
"layout" => None,
"lethe-gadget-fat" => None,
"secgate-macros" => None,
"layout-derive" => None,
"twizzler-rt-abi" => None,
"twizzler-types" => None,
"twizzler-object" => None,
"twizzler-nando" => None,
"twizzler-net" => None,
"twizzler-futures" => None,
"twizzler-async" => None,
"twizzler-queue" => None,
"twizzler-kernel-macros" => None,
"twizzler-runtime-api" => None,
_ => Some(p.name().to_string()),
})
.collect(),
Expand Down
2 changes: 1 addition & 1 deletion tools/xtask/src/toolchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ pub fn set_dynamic() {
"RUSTFLAGS",
"-C prefer-dynamic=y -Z staticlib-prefer-dynamic=y",
);
std::env::set_var("CARGO_TARGET_DIR", "target");
std::env::set_var("CARGO_TARGET_DIR", "target/dynamic");
}

pub fn set_static() {
Expand Down

0 comments on commit f6bd3da

Please sign in to comment.