aboutsummaryrefslogtreecommitdiff
path: root/src/args.rs
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-03-28 00:36:23 -0600
committerMelody Horn <melody@boringcactus.com>2021-03-28 00:36:23 -0600
commit40920ea9d255f704116064d0b831666c7416caf2 (patch)
treebd0021cec78eb94cb2cb998c638d6b4cb52e3484 /src/args.rs
parent2cd4d0f968c8097566edc0c6fbee10baf4b2647a (diff)
downloadmakers-40920ea9d255f704116064d0b831666c7416caf2.tar.gz
makers-40920ea9d255f704116064d0b831666c7416caf2.zip
add (& somewhat test!) GNUful conditionals
Diffstat (limited to 'src/args.rs')
-rw-r--r--src/args.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/args.rs b/src/args.rs
index f96cba4..134f785 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -165,6 +165,13 @@ impl Args {
Self::from_given_args_and_given_env(args, env_makeflags)
}
+ #[cfg(test)]
+ pub(crate) fn empty() -> Self {
+ let env_makeflags = String::new();
+ let args = vec![OsString::from("makers")];
+ Self::from_given_args_and_given_env(args.into_iter(), env_makeflags)
+ }
+
pub(crate) fn targets(&self) -> impl Iterator<Item = &String> {
self.targets_or_macros.iter().filter(|x| !x.contains('='))
}