test: add more stuff to CI
Signed-off-by: Stephen Waits <steve@waits.net>
This commit is contained in:
2 files changed
+29
-4
No files matched your search
+16
-3
@@ -8,19 +8,32 @@ tasks:
|
|||||||
rustup toolchain install nightly stable
|
rustup toolchain install nightly stable
|
||||||
cd vivaldi-nc/
|
cd vivaldi-nc/
|
||||||
rustup run stable cargo fetch
|
rustup run stable cargo fetch
|
||||||
- stable: |
|
- format: |
|
||||||
rustup default stable
|
rustup default stable
|
||||||
cd vivaldi-nc/
|
cd vivaldi-nc/
|
||||||
cargo fmt --verbose --check
|
cargo fmt --verbose --check
|
||||||
|
- lint: |
|
||||||
|
rustup default stable
|
||||||
|
cd vivaldi-nc/
|
||||||
cargo clippy --verbose
|
cargo clippy --verbose
|
||||||
|
- stable: |
|
||||||
|
rustup default stable
|
||||||
|
cd vivaldi-nc/
|
||||||
cargo build --verbose
|
cargo build --verbose
|
||||||
cargo test --verbose
|
cargo test --verbose --no-default-features --features f32
|
||||||
|
cargo test --verbose --no-default-features --features f64
|
||||||
|
- bench: |
|
||||||
|
rustup default stable
|
||||||
|
cd vivaldi-nc/
|
||||||
|
cargo bench --verbose --no-default-features --features f32
|
||||||
|
cargo bench --verbose --no-default-features --features f64
|
||||||
- nightly: |
|
- nightly: |
|
||||||
rustup default nightly
|
rustup default nightly
|
||||||
cd vivaldi-nc/
|
cd vivaldi-nc/
|
||||||
cargo clippy --verbose ||:
|
cargo clippy --verbose ||:
|
||||||
cargo build --verbose ||:
|
cargo build --verbose ||:
|
||||||
cargo test --verbose ||:
|
cargo test --verbose --no-default-features --features f32 ||:
|
||||||
|
cargo test --verbose --no-default-features --features f64 ||:
|
||||||
- docs: |
|
- docs: |
|
||||||
cd vivaldi-nc/
|
cd vivaldi-nc/
|
||||||
rustup run stable cargo doc --no-deps
|
rustup run stable cargo doc --no-deps
|
||||||
|
|||||||
+13
-1
@@ -2,6 +2,18 @@
|
|||||||
//
|
//
|
||||||
// for info on the format, see `NetLatency-Data/README.md`
|
// for info on the format, see `NetLatency-Data/README.md`
|
||||||
|
|
||||||
|
//
|
||||||
|
// **** Features ****
|
||||||
|
//
|
||||||
|
|
||||||
|
/// `FloatType` is a type alias for either `f32` or `f64` depending on cargo features
|
||||||
|
#[cfg(feature = "f32")]
|
||||||
|
type FloatType = f32;
|
||||||
|
|
||||||
|
/// `FloatType` is a type alias for either `f32` or `f64` depending on cargo features
|
||||||
|
#[cfg(feature = "f64")]
|
||||||
|
type FloatType = f64;
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
fs::File,
|
fs::File,
|
||||||
io::{BufReader, Read},
|
io::{BufReader, Read},
|
||||||
@@ -85,7 +97,7 @@ fn main() {
|
|||||||
nc[i_local].update(&nc_remote, rtt_measured);
|
nc[i_local].update(&nc_remote, rtt_measured);
|
||||||
|
|
||||||
// complete, now let's sum up the error
|
// complete, now let's sum up the error
|
||||||
error = nc.iter().map(|n| n.error()).sum::<f32>() / NUM_NODES as f32;
|
error = nc.iter().map(|n| n.error()).sum::<FloatType>() / NUM_NODES as FloatType;
|
||||||
assert!(error.is_finite());
|
assert!(error.is_finite());
|
||||||
if error < 5.0 {
|
if error < 5.0 {
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in new issue
Block a user