auric 0.1.6

CLI for the Ember-inspired Auric SPA framework
#[allow(unused)]
macro_rules! require_acceptance_testing_enabled {
    () => {{
        const TEST_ACCEPTANCE: &str = "TEST_ACCEPTANCE";
        if let Err(_) = std::env::var(TEST_ACCEPTANCE) {
            eprintln!("Skipping test because no {TEST_ACCEPTANCE} is set");
            return;
        };
    }};
}

#[allow(unused)]
pub(crate) use require_acceptance_testing_enabled;
use std::path::Path;
use std::process::Command;

#[allow(unused)]
macro_rules! require_integration_testing_enabled {
    () => {{
        const TEST_INTEGRATION: &str = "TEST_INTEGRATION";
        if let Err(_) = std::env::var(TEST_INTEGRATION) {
            eprintln!("Skipping test because no {TEST_INTEGRATION} is set");
            return;
        };
    }};
}

#[allow(unused)]
pub(crate) use require_integration_testing_enabled;

#[allow(unused)]
pub fn run_make_check(workspace: &Path) {
    eprintln!("==> make check");
    let output = Command::new("make")
        .arg("check")
        .current_dir(workspace)
        .output()
        .expect("make check");
    for line in output.stderr.split(|&c| c == b'\n') {
        let line = String::from_utf8(line.to_vec()).expect("convert stderr to string");
        eprintln!("{line}");
    }
    if !output.status.success() {
        panic!(
            "{}",
            String::from_utf8(output.stderr.to_vec()).expect("convert stderr to string")
        );
    }
}