mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-04-25 08:27:39 +02:00
Merge pull request #10 from zerotier/cargo-workspaces
Convert to using cargo workspaces.
This commit is contained in:
commit
f92e4a165f
8 changed files with 24 additions and 40 deletions
2
.github/workflows/main.yaml
vendored
2
.github/workflows/main.yaml
vendored
|
@ -13,4 +13,4 @@ jobs:
|
|||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- run: make test
|
||||
- run: cargo test
|
||||
|
|
13
Cargo.toml
Normal file
13
Cargo.toml
Normal file
|
@ -0,0 +1,13 @@
|
|||
[workspace]
|
||||
|
||||
members = [
|
||||
"zerotier-core-crypto",
|
||||
"zerotier-network-hypervisor",
|
||||
"zerotier-system-service",
|
||||
]
|
||||
|
||||
[profile.release]
|
||||
opt-level = 3
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
panic = 'abort'
|
15
Makefile
15
Makefile
|
@ -1,15 +0,0 @@
|
|||
all:
|
||||
|
||||
clean: FORCE
|
||||
for i in */Cargo.toml; do cd $$(dirname $$i); cargo clean || exit 1; cd ..; done
|
||||
|
||||
test:
|
||||
for i in */Cargo.toml; do cd $$(dirname $$i); cargo test || exit 1; cd ..; done
|
||||
|
||||
fmt:
|
||||
set extglob; for i in */Cargo.toml; do cd $$(dirname $$i); rustfmt **/*.rs || exit 1; cd ..; done
|
||||
|
||||
|
||||
FORCE:
|
||||
|
||||
.PHONY: test
|
|
@ -5,12 +5,6 @@ edition = "2021"
|
|||
license = "MPL-2.0"
|
||||
authors = ["ZeroTier, Inc. <contact@zerotier.com>", "Adam Ierymenko <adam.ierymenko@zerotier.com>"]
|
||||
|
||||
[profile.release]
|
||||
opt-level = 3
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
panic = 'abort'
|
||||
|
||||
[dependencies]
|
||||
rand_core = "0.5.0"
|
||||
aes-gmac-siv = { path = "../aes-gmac-siv" }
|
||||
|
|
|
@ -5,12 +5,6 @@ edition = "2021"
|
|||
license = "MPL-2.0"
|
||||
authors = ["ZeroTier, Inc. <contact@zerotier.com>", "Adam Ierymenko <adam.ierymenko@zerotier.com>"]
|
||||
|
||||
[profile.release]
|
||||
lto = true
|
||||
opt-level = 3
|
||||
codegen-units = 1
|
||||
panic = 'abort'
|
||||
|
||||
[features]
|
||||
default = ["debug_events"]
|
||||
debug_events = []
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// from zeronsd
|
||||
pub fn randstring(len: u8) -> String {
|
||||
(0..len).map(|_| (rand::random::<u8>() % 26) + 'a' as u8).map(|c| if rand::random::<bool>() { (c as char).to_ascii_uppercase() } else { c as char }).map(|c| c.to_string()).collect::<Vec<String>>().join("")
|
||||
}
|
||||
// from zeronsd
|
||||
pub fn randstring(len: u8) -> String {
|
||||
(0..len).map(|_| (rand::random::<u8>() % 26) + 'a' as u8).map(|c| if rand::random::<bool>() { (c as char).to_ascii_uppercase() } else { c as char }).map(|c| c.to_string()).collect::<Vec<String>>().join("")
|
||||
}
|
||||
|
|
|
@ -5,12 +5,6 @@ authors = ["ZeroTier, Inc. <contact@zerotier.com>", "Adam Ierymenko <adam.ieryme
|
|||
edition = "2021"
|
||||
license = "MPL-2.0"
|
||||
|
||||
[profile.release]
|
||||
opt-level = 3
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
panic = 'abort'
|
||||
|
||||
[dependencies]
|
||||
zerotier-network-hypervisor = { path = "../zerotier-network-hypervisor" }
|
||||
zerotier-core-crypto = { path = "../zerotier-core-crypto" }
|
||||
|
|
|
@ -198,7 +198,11 @@ mod tests {
|
|||
let start = ms_monotonic();
|
||||
std::thread::sleep(Duration::from_millis(500));
|
||||
let end = ms_monotonic();
|
||||
assert!((end - start).abs() > 450);
|
||||
assert!((end - start).abs() < 550);
|
||||
// per docs:
|
||||
//
|
||||
// The thread may sleep longer than the duration specified due to scheduling specifics or
|
||||
// platform-dependent functionality. It will never sleep less.
|
||||
//
|
||||
assert!((end - start).abs() >= 500);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue