From 65bff57e6139cc126191d4faabbcf74118932dd2 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Sat, 29 Dec 2018 11:52:42 -0800 Subject: Use nitrokey-test for nitrokey device tests This change is the first in a series to migrate the existing tests to using the nitrokey-test crate. The crate provides a couple of benefits over the existing way testing works: - test execution is automatically serialized (i.e., no more need for --test-threads) - available devices are detected at runtime (i.e., no more need for --features test-pro) - tests capable of running only on a specific device are automatically skipped if this device is not present In addition to that, the crate also offers selection of particular groups of tests by virtue of the NITROKEY_TEST_GROUP environment variable. If set (valid values are "nodev", "pro", and "storage") only tests of the particular group are run (those tests will fail if a required precondition is not met, i.e., if a device is present but "nodev" is set, or if the "pro" group is run but no device or a storage device is present). Unfortunately, it has some limitations as well. Most importantly Rust does not allow us to indicate whether a test has been skipped or not. While it has #[ignore] support, that strictly is a compile-time feature and, hence, not usable. This patch in particular pulls in the nitrokey-test crate and adjusts the existing device tests to make use of it. --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index b8f30db..3712dbe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,3 +20,6 @@ test-storage = [] libc = "0.2" nitrokey-sys = "3.4" rand = "0.6" + +[dev-dependencies] +nitrokey-test = {version = "0.1"} -- cgit v1.2.1