summaryrefslogtreecommitdiff
path: root/tests/shared.rs
diff options
context:
space:
mode:
authorNamilskyy <alive6863@gmail.com>2025-12-01 14:06:10 +0300
committerNamilskyy <alive6863@gmail.com>2025-12-01 14:06:10 +0300
commit068eea55e0612184151461e64633b3dc18e53490 (patch)
treed3e20aea860a88e2b50ad3d35ddbd8792a1e531e /tests/shared.rs
parent2029c2c09284d0228c0bce2977fdfa0ca8a8db06 (diff)
Implemented test suite, fixed some issues and added more modular structure into .woodpecker.yaml
Diffstat (limited to 'tests/shared.rs')
-rw-r--r--tests/shared.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/shared.rs b/tests/shared.rs
new file mode 100644
index 0000000..2ea0bf5
--- /dev/null
+++ b/tests/shared.rs
@@ -0,0 +1,22 @@
+use mesk::cfg::config::{Config, Repo, Log, Loglevel, Paths};
+
+pub fn create_test_config(temp_dir_path: &str) -> Config {
+ let cfg: Config = Config {
+ repo: Repo {
+ repo_url: format!(r"http://mesk.anthrill.i2p/repo/{}", std::env::consts::ARCH),
+ auto_update: true,
+ destination: (String::from("mesk"), String::from("mesk")),
+ repo_http_url: None,
+ },
+ log: Log {
+ log_file: String::from("/var/log/mesk.log"),
+ log_level: Loglevel::Info,
+ },
+ paths: Paths {
+ cache_dir: String::from(temp_dir_path),
+ build_dir: String::from(format!("{}/build", String::from(temp_dir_path)))
+ },
+ };
+
+ cfg
+} \ No newline at end of file