• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

NVIDIA / nvrc / 20764469718

06 Jan 2026 10:45PM UTC coverage: 91.806% (+0.4%) from 91.416%
20764469718

Pull #90

github

web-flow
Merge 9f10dc80c into 811df9805
Pull Request #90: Code coverage v2

25 of 53 new or added lines in 4 files covered. (47.17%)

3 existing lines in 1 file now uncovered.

1210 of 1318 relevant lines covered (91.81%)

8.36 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/src/test_utils.rs
1
// SPDX-License-Identifier: Apache-2.0
2
// Copyright (c) NVIDIA CORPORATION
3

4
//! Shared test utilities. Only compiled during tests.
5

6
use nix::unistd::Uid;
7
use std::env;
8
use std::process::Command;
9

10
/// Ensure test runs as root.
11
///
12
/// Coverage builds: Panics immediately if not root. Coverage instrumentation
13
/// requires the entire test process to run as root from the start—there's no
14
/// way to escalate privileges mid-test. Run with: `sudo cargo llvm-cov`
15
///
16
/// Normal test builds: Re-executes the test binary via sudo, then exits with
17
/// the child's exit code. This allows `cargo test` to work without sudo.
18
pub fn require_root() {
36✔
19
    if Uid::effective().is_root() {
36✔
20
        return;
36✔
NEW
21
    }
×
22

23
    #[cfg(coverage)]
NEW
24
    panic!("coverage builds require root from start - run: sudo cargo llvm-cov");
×
25

26
    #[cfg(not(coverage))]
27
    {
28
        let args: Vec<String> = env::args().collect();
29
        match Command::new("sudo").args(&args).status() {
30
            Ok(status) => std::process::exit(status.code().unwrap_or(1)),
31
            Err(e) => panic!("failed to run sudo: {}", e),
32
        }
33
    }
34
}
36✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc