Skip to content

Commit 8dcc07d

Browse files
authored
Refactor testing (#210)
* Overhaul testing.
1 parent ecfc3ef commit 8dcc07d

38 files changed

+722
-2075
lines changed

.config/nextest.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[profile.default]
22
test-threads = 1
33
fail-fast = false
4-
slow-timeout = { period = "30s", terminate-after = 4 }
5-
retries = { backoff = "fixed", count = 2, delay = "1s" }
4+
slow-timeout = { period = "2s", terminate-after = 2 }
5+
retries = { backoff = "fixed", count = 3, delay = "1s" }

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ libc = "0.2"
1818
log = { version = "0.4", optional = true}
1919

2020
[dev-dependencies]
21+
approx = "0.5"
2122
crossbeam-channel = "0.5"
23+
ctor = "0.2"
2224

2325
[features]
2426
default = ["dynamic_loading", "log"]
25-
dynamic_loading = ["jack-sys/dynamic_loading"]
27+
dynamic_loading = ["jack-sys/dynamic_loading"]

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ Rust bindings for [JACK Audio Connection Kit](<https://jackaudio.org>).
1212

1313
The JACK server is usually started by the user or system. Clients can request
1414
that the JACK server is started on demand when they connect, but this can be
15-
disabled by creating a client with the `NO_START_SERVER` option.
15+
disabled by creating a client with the `NO_START_SERVER` option or
16+
`ClientOptions::default()`.
1617

1718
- Linux and BSD users may install JACK1, JACK2 (preferred for low latency), or
1819
Pipewire JACK (preferred for ease of use) from their system package manager.

docs/contrib/closure_callbacks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ contains captures the required state and then activating it.
1818
```rust
1919
// 1. Create the client.
2020
let (client, _status) =
21-
jack::Client::new("silence", jack::ClientOptions::NO_START_SERVER).unwrap();
21+
jack::Client::new("silence", jack::ClientOptions::default()).unwrap();
2222

2323
// 2. Define the state.
2424
let mut output = client.register_port("out", jack::AudioOut::default());
@@ -45,7 +45,7 @@ buffer size.
4545
```rust
4646
// 1. Create the client.
4747
let (client, _status) =
48-
jack::Client::new("silence", jack::ClientOptions::NO_START_SERVER).unwrap();
48+
jack::Client::new("silence", jack::ClientOptions::default()).unwrap();
4949

5050
// 2. Define the state.
5151
struct State {

docs/features.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,3 @@ Default: Yes
3737
Load `libjack` at runtime as opposed to the standard dynamic linking. This is
3838
preferred as it allows `pw-jack` to intercept the loading at runtime to provide
3939
the Pipewire JACK server implementation.
40-
41-
## `metadata`
42-
43-
Default: No
44-
45-
Provides access to the metadata API. This is experimental. Details on the JACK
46-
metadata API can be found at <https://jackaudio.org/metadata/>.

docs/logging.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@ enabled by default. The `log` crate provides a *facade* for logging; it provides
2727
macros to perform logging, but another mechanism or crate is required to
2828
actually perform the logging.
2929

30-
In the example below, we use the [`env_logger` crate]() to display logging for
31-
info and error severity level messages.
30+
In the example below, we use the [`env_logger`
31+
crate](https://crates.io/crates/env_logger) to display logging for info and
32+
error severity level messages.
3233

3334
```rust
3435
env_logger::builder().filter(None, log::LevelFilter::Info).init();
3536

3637
// JACK may log things to `info!` or `error!`.
3738
let (client, _status) =
38-
jack::Client::new("rust_jack_simple", jack::ClientOptions::NO_START_SERVER).unwrap();
39+
jack::Client::new("rust_jack_simple", jack::ClientOptions::default()).unwrap();
3940
```
4041

4142

docs/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ program that can take inputs and forward them to outputs.
5555
fn main() {
5656
// 1. Create client
5757
let (client, _status) =
58-
jack::Client::new("rust_jack_simple", jack::ClientOptions::NO_START_SERVER).unwrap();
58+
jack::Client::new("rust_jack_simple", jack::ClientOptions::default()).unwrap();
5959

6060
// 2. Register ports. They will be used in a callback that will be
6161
// called when new data is available.

examples/internal_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn main() {
66
// Create client
77
let (client, _status) = jack::Client::new(
88
"rust_jack_internal_client_tester",
9-
jack::ClientOptions::NO_START_SERVER,
9+
jack::ClientOptions::default(),
1010
)
1111
.unwrap();
1212

examples/playback_capture.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn main() {
66
// Create client
77
jack::set_logger(jack::LoggerType::Stdio);
88
let (client, _status) =
9-
jack::Client::new("rust_jack_simple", jack::ClientOptions::NO_START_SERVER).unwrap();
9+
jack::Client::new("rust_jack_simple", jack::ClientOptions::default()).unwrap();
1010

1111
// Register ports. They will be used in a callback that will be
1212
// called when new data is available.

examples/set_transport.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::env;
22

33
fn main() {
44
let (client, _status) =
5-
jack::Client::new("rust_jack_trans", jack::ClientOptions::NO_START_SERVER).unwrap();
5+
jack::Client::new("rust_jack_trans", jack::ClientOptions::default()).unwrap();
66

77
let transport = client.transport();
88

0 commit comments

Comments
 (0)