forked from gentoo-utils/gentoo-utils
add repo parser test
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/usr/bin/meson format --recursive --check-only
|
/usr/bin/meson format --recursive --check-only
|
||||||
rustfmt --edition 2024 --check $(find src -type f -name '*.rs')
|
rustfmt --edition 2024 --check $(find src -type f -name '*.rs')
|
||||||
ninja clippy -C build
|
ninja clippy -C build
|
||||||
meson test unittests -C build
|
meson test unittests '*repo*' -C build
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
tests = {}
|
tests = {}
|
||||||
|
|
||||||
subdir('porthole')
|
subdir('porthole')
|
||||||
|
subdir('repo')
|
||||||
|
|
||||||
foreach test, test_args : tests
|
foreach test, test_args : tests
|
||||||
name = fs.name(test)
|
name = fs.name(test)
|
||||||
|
|||||||
1
tests/repo/meson.build
Normal file
1
tests/repo/meson.build
Normal file
@@ -0,0 +1 @@
|
|||||||
|
tests += {meson.current_source_dir() / 'repo.rs': []}
|
||||||
17
tests/repo/repo.rs
Normal file
17
tests/repo/repo.rs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
use std::error::Error;
|
||||||
|
|
||||||
|
use gentoo_utils::repo::Repo;
|
||||||
|
|
||||||
|
fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
let repo = Repo::new("/var/db/repos/gentoo");
|
||||||
|
|
||||||
|
for result in repo.categories()? {
|
||||||
|
let cat = result?;
|
||||||
|
|
||||||
|
for result in cat.ebuilds()? {
|
||||||
|
let _ = result?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user