test: add more stuff to CI

Signed-off-by: Stephen Waits <steve@waits.net>
This commit is contained in:
swaits committed 2023-02-09 20:17:24 -07:00
1 parent 95ce16ef0a
commit 60dba8fb0f
2 files changed
+29 -4

No files matched your search

+16 -3
View File
@@ -8,19 +8,32 @@ tasks:
rustup toolchain install nightly stable
cd vivaldi-nc/
rustup run stable cargo fetch
- stable: |
- format: |
rustup default stable
cd vivaldi-nc/
cargo fmt --verbose --check
- lint: |
rustup default stable
cd vivaldi-nc/
cargo clippy --verbose
- stable: |
rustup default stable
cd vivaldi-nc/
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: |
rustup default nightly
cd vivaldi-nc/
cargo clippy --verbose ||:
cargo build --verbose ||:
cargo test --verbose ||:
cargo test --verbose --no-default-features --features f32 ||:
cargo test --verbose --no-default-features --features f64 ||:
- docs: |
cd vivaldi-nc/
rustup run stable cargo doc --no-deps
+13 -1
View File
@@ -2,6 +2,18 @@
//
// 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::{
fs::File,
io::{BufReader, Read},
@@ -85,7 +97,7 @@ fn main() {
nc[i_local].update(&nc_remote, rtt_measured);
// 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());
if error < 5.0 {
break;