]> git.proxmox.com Git - cargo.git/blob - vendor/os_info/src/netbsd/mod.rs
New upstream version 0.63.1
[cargo.git] / vendor / os_info / src / netbsd / mod.rs
1 use std::process::Command;
2
3 use log::{error, trace};
4
5 use crate::{bitness, uname::uname, Info, Type, Version};
6
7 pub fn current_platform() -> Info {
8 trace!("netbsd::current_platform is called");
9
10 let version = uname()
11 .map(Version::from_string)
12 .unwrap_or_else(|| Version::Unknown);
13
14 let info = Info {
15 os_type: Type::NetBSD,
16 version,
17 bitness: bitness::get(),
18 ..Default::default()
19 };
20
21 trace!("Returning {:?}", info);
22 info
23 }
24
25 #[cfg(test)]
26 mod tests {
27 use super::*;
28 use pretty_assertions::assert_eq;
29
30 #[test]
31 fn os_type() {
32 let version = current_platform();
33 assert_eq!(Type::NetBSD, version.os_type());
34 }
35 }