diff --git a/src/main.rs b/src/main.rs index 8e768beb..a8b47781 100644 --- a/src/main.rs +++ b/src/main.rs @@ -83,7 +83,8 @@ mod test { // Run once before tests are executed. #[ctor] fn setup_schema() { - let schema_dir = concat!(env!("CARGO_MANIFEST_DIR"), "/data"); + let schema_dir = &env::var("GSETTINGS_SCHEMA_DIR") + .unwrap_or(concat!(env!("CARGO_MANIFEST_DIR"), "/data").into()); let output = Command::new("glib-compile-schemas") .arg(schema_dir) diff --git a/src/meson.build b/src/meson.build index a5a4637c..ae0fde16 100644 --- a/src/meson.build +++ b/src/meson.build @@ -63,6 +63,7 @@ test( ], env: [ 'RUST_BACKTRACE=1', + 'GSETTINGS_SCHEMA_DIR=@0@/data'.format(meson.project_build_root()), cargo_env ], timeout: 300, # give cargo more time