Skip to content

Commit a11acab

Browse files
committed
Add integration test
As mentioned upstream[^1] the integration tests aren't able to use cdylib crate types so "lib" was added to the list of crate types. To not having to repeat the plugin interface types for Rust in the integration test they were made public in the library. The integration test needs a running MQTT server to which it will connect. That way the full functionality (except for mstarConfigure with its UI) can be tested. [^1]: rust-lang/cargo#6659 (comment)
1 parent e1a2591 commit a11acab

File tree

5 files changed

+407
-12
lines changed

5 files changed

+407
-12
lines changed

Cargo.lock

Lines changed: 101 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ env_logger = "0.10.1"
99
rumqttc = "0.23.0"
1010
slint = "1.3.0"
1111

12+
[dev-dependencies]
13+
mockall = "0.11.4"
14+
1215
[lib]
13-
crate-type=["cdylib"]
16+
crate-type=["lib", "cdylib"]

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![allow(non_snake_case)]
22

33
mod mqtt;
4-
mod plugin_interface_v2;
4+
pub mod plugin_interface_v2;
55

66
use core::ffi::{c_char, c_double, c_int};
77
use log::{debug, error, warn};

src/plugin_interface_v2.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
77
use core::ffi::{c_char, c_float, c_void};
88

9-
type ListPlayersCallbackFunction = extern "C" fn(*const c_char, *const c_void);
10-
type ListPlayersFunction = extern "C" fn(*const c_char, ListPlayersCallbackFunction, *const c_void);
11-
type PlayFunction = extern "C" fn(*const c_char);
12-
type StopFunction = extern "C" fn(*const c_char);
13-
type NextFunction = extern "C" fn(*const c_char);
14-
type PreviousFunction = extern "C" fn(*const c_char);
15-
type ListTracksCallbackFunction = extern "C" fn(*const c_char, *const c_char, *const c_void);
16-
type ListTracksFunction = extern "C" fn(*const c_char, ListTracksCallbackFunction, *const c_void);
17-
type SetTrackVolumeFunction = extern "C" fn(*const c_char, *const c_char, c_float);
9+
pub type ListPlayersCallbackFunction = extern "C" fn(*const c_char, *const c_void);
10+
pub type ListPlayersFunction =
11+
extern "C" fn(*const c_char, ListPlayersCallbackFunction, *const c_void);
12+
pub type PlayFunction = extern "C" fn(*const c_char);
13+
pub type StopFunction = extern "C" fn(*const c_char);
14+
pub type NextFunction = extern "C" fn(*const c_char);
15+
pub type PreviousFunction = extern "C" fn(*const c_char);
16+
pub type ListTracksCallbackFunction = extern "C" fn(*const c_char, *const c_char, *const c_void);
17+
pub type ListTracksFunction =
18+
extern "C" fn(*const c_char, ListTracksCallbackFunction, *const c_void);
19+
pub type SetTrackVolumeFunction = extern "C" fn(*const c_char, *const c_char, c_float);
1820

1921
#[repr(C)]
2022
#[derive(Clone)]

0 commit comments

Comments
 (0)