Skip to content

Commit

Permalink
another regen test
Browse files Browse the repository at this point in the history
evmar committed Jun 29, 2023
1 parent ca14283 commit 31d6c98
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/basic.rs
Original file line number Diff line number Diff line change
@@ -119,6 +119,34 @@ EOT
Ok(())
}

#[cfg(unix)]
#[test]
fn generate_build_file_failure() -> anyhow::Result<()> {
// Run a project where a build rule generates the build.ninja but it fails.
let space = TestSpace::new()?;
space.write(
"build.ninja",
&[
TOUCH_RULE,
"build out: touch",
"
rule regen
command = sh ./gen.sh
generator = 1",
"build build.ninja: regen gen.sh",
"",
]
.join("\n"),
)?;
space.write("gen.sh", "exit 1")?;

// Run: regenerate and fail.
let out = space.run(&mut n2_command(vec!["out"]))?;
assert_output_contains(&out, "failed:");

Ok(())
}

#[cfg(unix)]
#[test]
fn generate_rsp_file() -> anyhow::Result<()> {

0 comments on commit 31d6c98

Please sign in to comment.