rush_sh/lib.rs
1//! Rush Shell Library
2//!
3//! This library provides the core functionality of the Rush shell,
4//! exposing modules for external use such as benchmarking and testing.
5
6pub mod arithmetic;
7pub mod brace_expansion;
8pub mod builtins;
9pub mod completion;
10pub mod executor;
11pub mod lexer;
12pub mod parameter_expansion;
13pub mod parser;
14pub mod script_engine;
15pub mod state;
16
17// Re-export main types for convenience
18pub use executor::execute;
19pub use lexer::Token;
20pub use parser::{Ast, ShellCommand};
21pub use state::ShellState;
22
23// Global test synchronization mutexes
24// These are always available but only used in tests
25#[doc(hidden)]
26pub mod test_sync {
27 use std::sync::Mutex;
28
29 /// Mutex to serialize tests that modify job control state
30 /// Job control tests MUST use this mutex to prevent race conditions
31 /// when accessing the global job table through ShellState
32 pub static JOB_CONTROL_LOCK: Mutex<()> = Mutex::new(());
33
34 /// Mutex to serialize tests that modify environment variables
35 pub static ENV_LOCK: Mutex<()> = Mutex::new(());
36
37 /// Mutex to serialize tests that change the current directory
38 pub static DIR_CHANGE_LOCK: Mutex<()> = Mutex::new(());
39}