From f909638bf4595ce49fab41fb2be4b6877811fcee Mon Sep 17 00:00:00 2001 From: Andreas Longva Date: Tue, 17 Nov 2020 08:37:56 +0100 Subject: [PATCH] Designate exhaustive matrix proptest as slow-tests The slow-tests feature flag is intended to be used for tests that take substantially more time to run than other unit tests. --- .circleci/config.yml | 4 ++-- Cargo.toml | 3 +++ tests/proptest/mod.rs | 11 ++++++++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c947dbd7..033bc01a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,10 +57,10 @@ jobs: - checkout - run: name: test - command: cargo test --features arbitrary --features serde-serialize --features abomonation-serialize --features sparse --features debug --features io --features compare --features libm --features proptest + command: cargo test --features arbitrary --features serde-serialize --features abomonation-serialize --features sparse --features debug --features io --features compare --features libm --features proptest --features slow-tests - run: name: test nalgebra-glm - command: cargo test -p nalgebra-glm --features arbitrary --features serde-serialize --features abomonation-serialize --features sparse --features debug --features io --features compare --features libm + command: cargo test -p nalgebra-glm --features arbitrary --features serde-serialize --features abomonation-serialize --features sparse --features debug --features io --features compare --features libm --features slow-tests build-wasm: executor: rust-executor steps: diff --git a/Cargo.toml b/Cargo.toml index a74d39cf..b0fe191e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,6 +34,9 @@ compare = [ "matrixcompare-core" ] libm = [ "simba/libm" ] libm-force = [ "simba/libm_force" ] +# This feature is only used for tests, and enables tests that require more time to run +slow-tests = [] + [dependencies] typenum = "1.12" diff --git a/tests/proptest/mod.rs b/tests/proptest/mod.rs index 40d61864..306dd507 100644 --- a/tests/proptest/mod.rs +++ b/tests/proptest/mod.rs @@ -5,9 +5,13 @@ use nalgebra::{DMatrix, DVector, Dim, Matrix3, MatrixMN, Vector3}; use proptest::prelude::*; use proptest::strategy::ValueTree; use proptest::test_runner::TestRunner; -use itertools::Itertools; -use std::iter::repeat; -use std::collections::HashSet; + +#[cfg(feature = "slow-tests")] +use { + itertools::Itertools, + std::iter::repeat, + std::collections::HashSet, +}; /// Generate a proptest that tests that all matrices generated with the /// provided rows and columns conform to the constraints defined by the @@ -92,6 +96,7 @@ proptest! { fn ensure_arbitrary_test_compiles_dvector(_: DVector) {} } +#[cfg(feature = "slow-tests")] #[test] fn matrix_samples_all_possible_outputs() { // Test that the proptest generation covers all possible outputs for a small space of inputs