Compare commits
7 Commits
e5e2c98e81
...
db43560be5
| Author | SHA1 | Date | |
|---|---|---|---|
|
db43560be5
|
|||
|
4544507c00
|
|||
|
13ccf1ed25
|
|||
|
dafdc05dff
|
|||
|
70c8437830
|
|||
|
f3718d143a
|
|||
|
12d362983d
|
@@ -3,12 +3,12 @@
|
||||
(rust-cargo-default-arguments . "-r")
|
||||
(eglot-workspace-configuration . (:rust-analyzer
|
||||
(:check
|
||||
(:overrideCommand ["./rust-analyzer.sh"]))))
|
||||
(:overrideCommand ["ninja" "clippy-json" "-C" "build"]))))
|
||||
(eval . (add-to-list 'eglot-server-programs
|
||||
'((rust-ts-mode rust-mode) .
|
||||
("rust-analyzer" :initializationOptions
|
||||
(:check
|
||||
(:overrideCommand ["./rust-analyzer.sh"]))))))
|
||||
(:overrideCommand ["ninja" "clippy-json" "-C" "build"]))))))
|
||||
(eval . (eglot-ensure))
|
||||
(eval . (company-mode 1))
|
||||
(eval . (add-hook 'before-save-hook 'fmt-current-buffer nil t))
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# this script is a temporary workaround for not having a proper clippy-json target
|
||||
|
||||
source /etc/profile
|
||||
|
||||
cd build || exit $?
|
||||
|
||||
# compile as far as we can
|
||||
ninja
|
||||
|
||||
ninja clippy-json
|
||||
@@ -1,7 +1 @@
|
||||
tests += {meson.current_source_dir() / 'read_all_profiles.rs': []}
|
||||
tests += {
|
||||
meson.current_source_dir() / 'read_mock_profile.rs': [
|
||||
meson.current_source_dir() / 'mockrepo',
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
USE="base"
|
||||
@@ -1 +0,0 @@
|
||||
app-editors/emacs gui
|
||||
@@ -1 +0,0 @@
|
||||
..
|
||||
@@ -1 +0,0 @@
|
||||
gui
|
||||
@@ -1 +0,0 @@
|
||||
USE="emacs"
|
||||
@@ -1 +0,0 @@
|
||||
app-editors/emacs default
|
||||
@@ -1 +0,0 @@
|
||||
*app-editors/emacs
|
||||
@@ -1 +0,0 @@
|
||||
../../base
|
||||
@@ -1 +0,0 @@
|
||||
default
|
||||
@@ -1 +0,0 @@
|
||||
mockrepo
|
||||
@@ -1,58 +0,0 @@
|
||||
use std::env;
|
||||
|
||||
use gentoo_utils::{atom::Atom, repo::Repo, useflag::UseFlag};
|
||||
use itertools::Itertools;
|
||||
|
||||
fn main() {
|
||||
let repo_path = env::args().nth(1).expect("expected path to mock repo");
|
||||
let repo = Repo::new(&repo_path).expect("failed to open repo");
|
||||
let profile = repo
|
||||
.evaluate_profile("features/emacs/gui")
|
||||
.expect("failed to evaluate profile");
|
||||
|
||||
assert_eq!(
|
||||
profile.make_defaults()["USE"]
|
||||
.split_ascii_whitespace()
|
||||
.sorted()
|
||||
.collect::<Vec<_>>(),
|
||||
vec!["base", "emacs"]
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
profile
|
||||
.packages()
|
||||
.iter()
|
||||
.map(Atom::to_string)
|
||||
.collect::<Vec<_>>(),
|
||||
vec!["app-editors/emacs"]
|
||||
);
|
||||
|
||||
let emacs_package_use = profile
|
||||
.package_use()
|
||||
.iter()
|
||||
.find_map(|(atom, flags)| {
|
||||
if atom.clone().into_cp().to_string() == "app-editors/emacs" {
|
||||
Some(flags)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.expect("failed to read package.use settings for app-editors/emacs");
|
||||
|
||||
assert_eq!(
|
||||
emacs_package_use
|
||||
.iter()
|
||||
.map(UseFlag::to_string)
|
||||
.collect::<Vec<_>>(),
|
||||
vec!["default", "gui"]
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
profile
|
||||
.use_force()
|
||||
.iter()
|
||||
.map(UseFlag::to_string)
|
||||
.collect::<Vec<_>>(),
|
||||
vec!["default", "gui"]
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user