1
0
Fork 0
forked from wry/wry

config: add TestConfig

This commit is contained in:
Julian Orth 2022-05-02 20:53:07 +02:00
parent f92c9c6027
commit e212e0b8b1
7 changed files with 175 additions and 6 deletions

View file

@ -5,6 +5,7 @@ use {
backend::{ConnectorId, InputDeviceId},
config::handler::ConfigProxyHandler,
ifs::wl_seat::SeatId,
it::test_config::TEST_CONFIG_ENTRY,
state::State,
utils::{
clonecell::CloneCell, numcell::NumCell, oserror::OsError, ptr_ext::PtrExt,
@ -180,6 +181,11 @@ impl ConfigProxy {
Self::new(None, &entry, state)
}
#[cfg(feature = "it")]
pub fn for_test(state: &Rc<State>) -> Self {
Self::new(None, &TEST_CONFIG_ENTRY, state)
}
pub fn from_config_dir(state: &Rc<State>) -> Result<Self, ConfigError> {
let dir = match state.config_dir.as_deref() {
Some(d) => d,