aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2018-12-16 15:49:14 +0000
committerRobin Krahl <robin.krahl@ireas.org>2018-12-16 17:04:59 +0100
commit9c5364a63e363a6f69afddb29453efc5e4b12cc0 (patch)
treef195c9338e76d896d3e7519d38242a105ace858d
parent7f0c2e550d0439d0311da71806e19f893725b40b (diff)
downloadnitrokey-rs-9c5364a63e363a6f69afddb29453efc5e4b12cc0.tar.gz
nitrokey-rs-9c5364a63e363a6f69afddb29453efc5e4b12cc0.tar.bz2
Remove test-no-device feature
Currently, the test-no-device feature is used for tests that expect no Nitrokey to be connected. Yet test-no-device is equivalent to not test-pro and not test-storage. Therefore, this patch removes the test-no-device feature.
-rw-r--r--CHANGELOG.md1
-rw-r--r--Cargo.toml1
-rw-r--r--README.md10
-rw-r--r--tests/device.rs2
-rw-r--r--tests/util/mod.rs5
5 files changed, 8 insertions, 11 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9a27a51..3cf86d4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
# unreleased
- Update to Rust edition 2018.
+- Remove the `test-no-device` feature.
# v0.2.1 (2018-12-10)
diff --git a/Cargo.toml b/Cargo.toml
index 85e4705..f3560a2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,6 @@ readme = "README.md"
license = "MIT"
[features]
-test-no-device = []
test-pro = []
test-storage = []
diff --git a/README.md b/README.md
index 6039943..61da317 100644
--- a/README.md
+++ b/README.md
@@ -35,12 +35,12 @@ supported by `nitrokey-rs`:
## Tests
This crate has three test suites that can be selected using features. One test
-suite (feature `test-no-device`) assumes that no Nitrokey device is connected.
-The two other test suites require a Nitrokey Pro (feature `test-pro`) or a
-Nitrokey Storage (feature `test-storage`) to be connected.
+suite assumes that no Nitrokey device is connected. It is run if no other test
+suite is selected. The two other test suites require a Nitrokey Pro (feature
+`test-pro`) or a Nitrokey Storage (feature `test-storage`) to be connected.
Use the `--features` option for Cargo to select one of the test suites. You
-cannot select more than one of the test suites at the same time. Note that the
+should select more than one of the test suites at the same time. Note that the
test suites that require a Nitrokey device assume that the device’s passwords
are the factory defaults (admin password `12345678` and user password
`123456`). Running the test suite with a device with different passwords might
@@ -54,7 +54,7 @@ the test executable.
In conclusion, you can use these commands to run the test suites:
```
-$ cargo test --features test-no-device -- --test-threads 1
+$ cargo test
$ cargo test --features test-pro -- --test-threads 1
$ cargo test --features test-storage -- --test-threads 1
```
diff --git a/tests/device.rs b/tests/device.rs
index 7ceac1e..2c8cfa6 100644
--- a/tests/device.rs
+++ b/tests/device.rs
@@ -24,7 +24,7 @@ fn count_nitrokey_block_devices() -> usize {
}
#[test]
-#[cfg_attr(not(feature = "test-no-device"), ignore)]
+#[cfg_attr(any(feature = "test-pro", feature = "test-storage"), ignore)]
fn connect_no_device() {
assert!(nitrokey::connect().is_err());
assert!(nitrokey::Pro::connect().is_err());
diff --git a/tests/util/mod.rs b/tests/util/mod.rs
index 257586e..c2c94e2 100644
--- a/tests/util/mod.rs
+++ b/tests/util/mod.rs
@@ -1,10 +1,7 @@
pub static ADMIN_PASSWORD: &str = "12345678";
pub static USER_PASSWORD: &str = "123456";
-#[cfg(feature = "test-no-device")]
-pub type Target = nitrokey::Pro;
-
-#[cfg(feature = "test-pro")]
+#[cfg(not(feature = "test-storage"))]
pub type Target = nitrokey::Pro;
#[cfg(feature = "test-storage")]