aboutsummaryrefslogtreecommitdiff
path: root/tests/conditional_assignment_inheritance.rs
blob: cb7e80618a58df5fc36bce75e7f33051bbad683c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
mod utils;

use std::fs;
use utils::{make, R};

#[test]
#[cfg(feature = "full")]
fn conditional_assignment_inheritance_test() -> R {
    let dir = tempfile::tempdir()?;

    let file_a = "
EGG = bug
include file_b.mk
check:
\t@echo $(EGG)
";
    fs::write(dir.path().join("Makefile"), file_a)?;
    let file_b = "
EGG ?= nope
";
    fs::write(dir.path().join("file_b.mk"), file_b)?;

    let result = make(&dir)?;
    assert!(result.status.success());
    assert_eq!(String::from_utf8(result.stdout)?.trim(), "bug");

    Ok(())
}