mirror of
https://github.com/Noratrieb/cargo-minimize.git
synced 2026-01-14 16:35:01 +01:00
Support --script properly... hopefully
This commit is contained in:
parent
f649289b01
commit
5ac406e650
4 changed files with 184 additions and 53 deletions
3
tests/always_success.sh
Executable file
3
tests/always_success.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
exit 0 # we reproduce! aren't we great?!
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
mod helper;
|
||||
|
||||
use std::path::Path;
|
||||
|
||||
use anyhow::Result;
|
||||
|
||||
use helper::run_test;
|
||||
|
|
@ -44,3 +46,27 @@ fn unused() -> Result<()> {
|
|||
},
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(windows, ignore)]
|
||||
fn custom_script_success() -> Result<()> {
|
||||
let script_path = Path::new(file!())
|
||||
.parent()
|
||||
.unwrap()
|
||||
.join("always_success.sh")
|
||||
.canonicalize()?;
|
||||
|
||||
run_test(
|
||||
r##"
|
||||
fn main() {}
|
||||
"##,
|
||||
r##"
|
||||
fn main() {
|
||||
loop {}
|
||||
}
|
||||
"##,
|
||||
|opts| {
|
||||
opts.script_path = Some(script_path);
|
||||
},
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue