2026-03-24 14:48:37 +01:00
|
|
|
// This file is part of the shadow-rs package.
|
|
|
|
|
//
|
|
|
|
|
// For the full copyright and license information, please view the LICENSE
|
|
|
|
|
// file that was distributed with this source code.
|
|
|
|
|
|
|
|
|
|
//! Shared test helpers for shadow-rs integration tests.
|
|
|
|
|
//!
|
|
|
|
|
//! Import with `#[path = "../common/mod.rs"] mod common;` in test files.
|
|
|
|
|
|
|
|
|
|
/// Skip the test when not running as root (euid != 0).
|
|
|
|
|
///
|
|
|
|
|
/// Returns `true` if the test should be skipped.
|
|
|
|
|
pub fn skip_unless_root() -> bool {
|
2026-04-22 11:26:49 +02:00
|
|
|
!rustix::process::geteuid().is_root()
|
2026-03-24 14:48:37 +01:00
|
|
|
}
|