|
51 | 51 | use std::error::Error;
|
52 | 52 | use std::ffi;
|
53 | 53 | use std::fmt;
|
54 |
| -use std::path; |
55 | 54 | use std::process;
|
56 | 55 |
|
57 | 56 | use escargot;
|
@@ -164,91 +163,6 @@ impl CommandCargoExt for process::Command {
|
164 | 163 | }
|
165 | 164 | }
|
166 | 165 |
|
167 |
| -/// Get the path to the crate's main binary. |
168 |
| -/// |
169 |
| -/// Intended for caching the location, reducing the cargo overhead. |
170 |
| -/// |
171 |
| -/// Note: only works if there one bin in the crate. |
172 |
| -/// |
173 |
| -/// # Examples |
174 |
| -/// |
175 |
| -/// ```rust |
176 |
| -/// use assert_cmd::prelude::*; |
177 |
| -/// |
178 |
| -/// use std::process::Command; |
179 |
| -/// |
180 |
| -/// let bin_under_test = assert_cmd::cargo::main_binary_path().unwrap(); |
181 |
| -/// Command::new(&bin_under_test) |
182 |
| -/// .unwrap(); |
183 |
| -/// ``` |
184 |
| -#[deprecated( |
185 |
| - since = "0.9.1", |
186 |
| - note = "For caching, using escargot directly." |
187 |
| -)] |
188 |
| -pub fn main_binary_path() -> Result<path::PathBuf, CargoError> { |
189 |
| - let runner = escargot::CargoBuild::new() |
190 |
| - .current_release() |
191 |
| - .run() |
192 |
| - .map_err(CargoError::with_cause)?; |
193 |
| - Ok(runner.path().to_owned()) |
194 |
| -} |
195 |
| - |
196 |
| -/// Get the path to the specified binary of the current crate. |
197 |
| -/// |
198 |
| -/// Intended for caching the location, reducing the cargo overhead. |
199 |
| -/// |
200 |
| -/// # Examples |
201 |
| -/// |
202 |
| -/// ```rust |
203 |
| -/// use assert_cmd::prelude::*; |
204 |
| -/// |
205 |
| -/// use std::process::Command; |
206 |
| -/// |
207 |
| -/// let bin_under_test = assert_cmd::cargo::cargo_bin_path("bin_fixture").unwrap(); |
208 |
| -/// Command::new(&bin_under_test) |
209 |
| -/// .unwrap(); |
210 |
| -/// ``` |
211 |
| -#[deprecated( |
212 |
| - since = "0.9.1", |
213 |
| - note = "For caching, using escargot directly." |
214 |
| -)] |
215 |
| -pub fn cargo_bin_path<S: AsRef<ffi::OsStr>>(name: S) -> Result<path::PathBuf, CargoError> { |
216 |
| - let runner = escargot::CargoBuild::new() |
217 |
| - .bin(name) |
218 |
| - .current_release() |
219 |
| - .run() |
220 |
| - .map_err(CargoError::with_cause)?; |
221 |
| - Ok(runner.path().to_owned()) |
222 |
| -} |
223 |
| - |
224 |
| -/// Get the path to the specified example of the current crate. |
225 |
| -/// |
226 |
| -/// Intended for caching the location, reducing the cargo overhead. |
227 |
| -/// |
228 |
| -/// # Examples |
229 |
| -/// |
230 |
| -/// ```rust |
231 |
| -/// use assert_cmd::prelude::*; |
232 |
| -/// |
233 |
| -/// use std::process::Command; |
234 |
| -/// |
235 |
| -/// let bin_under_test = assert_cmd::cargo::cargo_example_path("example_fixture").unwrap(); |
236 |
| -/// Command::new(&bin_under_test) |
237 |
| -/// .unwrap(); |
238 |
| -/// ``` |
239 |
| -#[deprecated( |
240 |
| - since = "0.9.1", |
241 |
| - note = "For caching, using escargot directly." |
242 |
| -)] |
243 |
| -pub fn cargo_example_path<S: AsRef<ffi::OsStr>>(name: S) -> Result<path::PathBuf, CargoError> { |
244 |
| - let runner = escargot::CargoBuild::new() |
245 |
| - .example(name) |
246 |
| - .current_release() |
247 |
| - .run() |
248 |
| - .map_err(CargoError::with_cause)?; |
249 |
| - Ok(runner.path().to_owned()) |
250 |
| -} |
251 |
| - |
252 | 166 | /// Error when finding crate binary.
|
253 | 167 | #[derive(Debug)]
|
254 | 168 | pub struct CargoError {
|
|
0 commit comments