Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

Commit

Permalink
Fix travis tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sinhrks committed Dec 19, 2016
1 parent dcbbd89 commit 90e1944
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
10 changes: 9 additions & 1 deletion .travis.yml
Expand Up @@ -6,8 +6,16 @@ rust:
matrix:
allow_failures:
- rust: nightly
env:
matrix:
- OPTIONAL=true
- OPTIONAL=false
script:
- cargo build --verbose
- if [[ "$OPTIONAL" ]]; then
cargo build --features 'datasets' --verbose;
else
cargo build --verbose;
fi
- cargo test --verbose
- cargo build --features stats
- cargo test --features stats
4 changes: 2 additions & 2 deletions Cargo.toml
Expand Up @@ -11,10 +11,10 @@ readme = "README.md"
license = "MIT"

[features]
default = ["datasets"]
default = []
stats = []
datasets = []
test = ["datasets"]
test = []

[dependencies]
num = { version = "0.1.35", default-features = false }
Expand Down
21 changes: 13 additions & 8 deletions tests/datasets.rs
@@ -1,13 +1,18 @@
extern crate rusty_machine as rm;

use rm::datasets;
use rm::linalg::BaseMatrix;

#[test]
fn test_iris() {
let dt = datasets::load_iris();
assert_eq!(dt.data().rows(), 150);
assert_eq!(dt.data().cols(), 4);
#[cfg(datasets)]
mod test {

assert_eq!(dt.target().size(), 150);
use rm::datasets;
use rm::linalg::BaseMatrix;

#[test]
fn test_iris() {
let dt = datasets::load_iris();
assert_eq!(dt.data().rows(), 150);
assert_eq!(dt.data().cols(), 4);

assert_eq!(dt.target().size(), 150);
}
}
2 changes: 1 addition & 1 deletion tests/lib.rs
Expand Up @@ -12,5 +12,5 @@ pub mod learning {
}
}

#[cfg(feature = "datasets")]
#[cfg(datasets)]
pub mod datasets;

0 comments on commit 90e1944

Please sign in to comment.