@@ -9,7 +9,7 @@ use anyhow::{Context, Result, bail};
99use std:: io:: IsTerminal ;
1010use std:: io:: Write ;
1111use std:: path:: { Path , PathBuf } ;
12- use std:: process:: { Child , Command , ExitStatus , Stdio } ;
12+ use std:: process:: { Child , Command , Stdio } ;
1313use std:: sync:: Mutex ;
1414use std:: time:: Instant ;
1515use strum_macros:: Display ;
@@ -134,11 +134,6 @@ impl KaniSession {
134134 run_suppress ( & self . args . common_args , cmd)
135135 }
136136
137- /// Call [run_redirect] with the verbosity configured by the user.
138- pub fn run_redirect ( & self , cmd : Command , stdout : & Path ) -> Result < ExitStatus > {
139- run_redirect ( & self . args . common_args , cmd, stdout)
140- }
141-
142137 /// Call [run_piped] with the verbosity configured by the user.
143138 pub fn run_piped ( & self , cmd : Command ) -> Result < Child > {
144139 run_piped ( & self . args . common_args , cmd)
@@ -164,7 +159,6 @@ impl KaniSession {
164159// Default Quiet Verbose Default Quiet Verbose
165160// run_terminal Y N Y Y N Y (inherits terminal)
166161// run_suppress N N Y Y N Y (buffered text only)
167- // run_redirect (not applicable, always to the file) (only option where error is acceptable)
168162
169163/// Run a job, leave it outputting to terminal (unless --quiet), and fail if there's a problem.
170164pub fn run_terminal ( verbosity : & impl Verbosity , mut cmd : Command ) -> Result < ( ) > {
@@ -254,33 +248,6 @@ pub fn run_suppress(verbosity: &impl Verbosity, mut cmd: Command) -> Result<()>
254248 Ok ( ( ) )
255249}
256250
257- /// Run a job, redirect its output to a file, and allow the caller to decide what to do with failure.
258- pub fn run_redirect (
259- verbosity : & impl Verbosity ,
260- mut cmd : Command ,
261- stdout : & Path ,
262- ) -> Result < ExitStatus > {
263- if verbosity. verbose ( ) {
264- println ! (
265- "[Kani] Running: `{} > {}`" ,
266- render_command( & cmd) . to_string_lossy( ) ,
267- stdout. display( )
268- ) ;
269- }
270- let output_file = std:: fs:: File :: create ( stdout) ?;
271- cmd. stdout ( output_file) ;
272-
273- let program = cmd. get_program ( ) . to_string_lossy ( ) . to_string ( ) ;
274- with_timer (
275- verbosity,
276- || {
277- cmd. status ( )
278- . context ( format ! ( "Failed to invoke {}" , cmd. get_program( ) . to_string_lossy( ) ) )
279- } ,
280- & program,
281- )
282- }
283-
284251/// Run a job and pipe its output to this process.
285252/// Returns an error if the process could not be spawned.
286253///
0 commit comments