mirror of
https://github.com/uutils/coreutils.git
synced 2025-12-23 08:47:37 +00:00
Merge pull request #8052 from cakebaker/uptime_move_imports_into_test_function
Some checks are pending
CICD / Build (push) Blocked by required conditions
CICD / Style/cargo-deny (push) Waiting to run
CICD / Style/deps (push) Waiting to run
CICD / Documentation/warnings (push) Waiting to run
CICD / MinRustV (push) Waiting to run
CICD / Test all features separately (push) Blocked by required conditions
CICD / Dependencies (push) Waiting to run
CICD / Build/Makefile (push) Blocked by required conditions
CICD / Build/stable (push) Blocked by required conditions
CICD / Build/nightly (push) Blocked by required conditions
CICD / Binary sizes (push) Blocked by required conditions
CICD / Tests/BusyBox test suite (push) Blocked by required conditions
CICD / Tests/Toybox test suite (push) Blocked by required conditions
CICD / Code Coverage (push) Waiting to run
CICD / Separate Builds (push) Waiting to run
CICD / Build/SELinux (push) Blocked by required conditions
GnuTests / Run GNU tests (push) Waiting to run
Android / Test builds (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/lint (push) Waiting to run
Code Quality / Style/spelling (push) Waiting to run
Code Quality / Style/toml (push) Waiting to run
Code Quality / Style/Python (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
Some checks are pending
CICD / Build (push) Blocked by required conditions
CICD / Style/cargo-deny (push) Waiting to run
CICD / Style/deps (push) Waiting to run
CICD / Documentation/warnings (push) Waiting to run
CICD / MinRustV (push) Waiting to run
CICD / Test all features separately (push) Blocked by required conditions
CICD / Dependencies (push) Waiting to run
CICD / Build/Makefile (push) Blocked by required conditions
CICD / Build/stable (push) Blocked by required conditions
CICD / Build/nightly (push) Blocked by required conditions
CICD / Binary sizes (push) Blocked by required conditions
CICD / Tests/BusyBox test suite (push) Blocked by required conditions
CICD / Tests/Toybox test suite (push) Blocked by required conditions
CICD / Code Coverage (push) Waiting to run
CICD / Separate Builds (push) Waiting to run
CICD / Build/SELinux (push) Blocked by required conditions
GnuTests / Run GNU tests (push) Waiting to run
Android / Test builds (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/lint (push) Waiting to run
Code Quality / Style/spelling (push) Waiting to run
Code Quality / Style/toml (push) Waiting to run
Code Quality / Style/Python (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
uptime: move imports into test function
This commit is contained in:
commit
ef9cb277fc
1 changed files with 7 additions and 12 deletions
|
|
@ -8,21 +8,10 @@
|
|||
|
||||
#[cfg(not(any(target_os = "openbsd", target_os = "freebsd")))]
|
||||
use uutests::at_and_ucmd;
|
||||
use uutests::new_ucmd;
|
||||
use uutests::util::TestScenario;
|
||||
use uutests::util_name;
|
||||
use uutests::{new_ucmd, util_name};
|
||||
|
||||
#[cfg(not(any(target_os = "macos", target_os = "openbsd", target_env = "musl")))]
|
||||
use bincode::{config, serde::encode_to_vec};
|
||||
use regex::Regex;
|
||||
#[cfg(not(any(target_os = "macos", target_os = "openbsd", target_env = "musl")))]
|
||||
use serde::Serialize;
|
||||
#[cfg(not(any(target_os = "macos", target_os = "openbsd", target_env = "musl")))]
|
||||
use serde_big_array::BigArray;
|
||||
#[cfg(not(any(target_os = "macos", target_os = "openbsd", target_env = "musl")))]
|
||||
use std::fs::File;
|
||||
#[cfg(not(any(target_os = "macos", target_os = "openbsd", target_env = "musl")))]
|
||||
use std::{io::Write, path::PathBuf};
|
||||
|
||||
#[test]
|
||||
fn test_invalid_arg() {
|
||||
|
|
@ -110,6 +99,12 @@ fn test_uptime_with_non_existent_file() {
|
|||
)]
|
||||
#[allow(clippy::too_many_lines, clippy::items_after_statements)]
|
||||
fn test_uptime_with_file_containing_valid_boot_time_utmpx_record() {
|
||||
use bincode::{config, serde::encode_to_vec};
|
||||
use serde::Serialize;
|
||||
use serde_big_array::BigArray;
|
||||
use std::fs::File;
|
||||
use std::{io::Write, path::PathBuf};
|
||||
|
||||
// This test will pass for freebsd but we currently don't support changing the utmpx file for
|
||||
// freebsd.
|
||||
let ts = TestScenario::new(util_name!());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue