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.
This commit is contained in:
Andreas Longva 2020-11-17 08:37:56 +01:00
parent cbef37ed9c
commit f909638bf4
3 changed files with 13 additions and 5 deletions

View File

@ -57,10 +57,10 @@ jobs:
- checkout - checkout
- run: - run:
name: test 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: - run:
name: test nalgebra-glm 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: build-wasm:
executor: rust-executor executor: rust-executor
steps: steps:

View File

@ -34,6 +34,9 @@ compare = [ "matrixcompare-core" ]
libm = [ "simba/libm" ] libm = [ "simba/libm" ]
libm-force = [ "simba/libm_force" ] libm-force = [ "simba/libm_force" ]
# This feature is only used for tests, and enables tests that require more time to run
slow-tests = []
[dependencies] [dependencies]
typenum = "1.12" typenum = "1.12"

View File

@ -5,9 +5,13 @@ use nalgebra::{DMatrix, DVector, Dim, Matrix3, MatrixMN, Vector3};
use proptest::prelude::*; use proptest::prelude::*;
use proptest::strategy::ValueTree; use proptest::strategy::ValueTree;
use proptest::test_runner::TestRunner; use proptest::test_runner::TestRunner;
use itertools::Itertools;
use std::iter::repeat; #[cfg(feature = "slow-tests")]
use std::collections::HashSet; use {
itertools::Itertools,
std::iter::repeat,
std::collections::HashSet,
};
/// Generate a proptest that tests that all matrices generated with the /// Generate a proptest that tests that all matrices generated with the
/// provided rows and columns conform to the constraints defined by the /// provided rows and columns conform to the constraints defined by the
@ -92,6 +96,7 @@ proptest! {
fn ensure_arbitrary_test_compiles_dvector(_: DVector<i32>) {} fn ensure_arbitrary_test_compiles_dvector(_: DVector<i32>) {}
} }
#[cfg(feature = "slow-tests")]
#[test] #[test]
fn matrix_samples_all_possible_outputs() { fn matrix_samples_all_possible_outputs() {
// Test that the proptest generation covers all possible outputs for a small space of inputs // Test that the proptest generation covers all possible outputs for a small space of inputs