use super::super::{detect_family, CompilerFamily};
#[test]
fn detect_clang_family() {
assert_eq!(detect_family("clang++"), CompilerFamily::Clang);
assert_eq!(detect_family("/usr/bin/clang"), CompilerFamily::Clang);
assert_eq!(detect_family("gcc"), CompilerFamily::Gcc);
assert_eq!(detect_family("g++"), CompilerFamily::Gcc);
}
#[test]
fn detect_emcc_family() {
assert_eq!(detect_family("emcc"), CompilerFamily::Clang);
assert_eq!(detect_family("em++"), CompilerFamily::Clang);
assert_eq!(detect_family("/usr/bin/emcc"), CompilerFamily::Clang);
assert_eq!(detect_family("emcc.exe"), CompilerFamily::Clang);
assert!(CompilerFamily::Clang.supports_depfile());
}
#[test]
fn detect_msvc_family() {
assert_eq!(detect_family("cl"), CompilerFamily::Msvc);
assert_eq!(detect_family("C:\\MSVC\\cl"), CompilerFamily::Msvc);
}
#[test]
fn detect_msvc_case_insensitive() {
assert_eq!(detect_family("CL"), CompilerFamily::Msvc);
assert_eq!(detect_family("CL.EXE"), CompilerFamily::Msvc);
assert_eq!(detect_family("Cl.exe"), CompilerFamily::Msvc);
assert_eq!(detect_family("C:\\MSVC\\CL.EXE"), CompilerFamily::Msvc);
assert_eq!(
detect_family("C:\\Program Files\\MSVC\\cl.EXE"),
CompilerFamily::Msvc
);
}
#[test]
fn gcc_supports_depfile() {
assert!(CompilerFamily::Gcc.supports_depfile());
}
#[test]
fn clang_supports_depfile() {
assert!(CompilerFamily::Clang.supports_depfile());
}
#[test]
fn msvc_no_depfile() {
assert!(!CompilerFamily::Msvc.supports_depfile());
}