Check for eprintln on CI

This commit is contained in:
Aleksey Kladov 2020-04-06 16:58:16 +02:00
parent 2603a9e628
commit bf569f8b29
7 changed files with 38 additions and 12 deletions

View file

@ -2,6 +2,21 @@
use std::{cell::Cell, fmt};
#[inline(always)]
pub fn is_ci() -> bool {
option_env!("CI").is_some()
}
#[macro_export]
macro_rules! eprintln {
($($tt:tt)*) => {{
if $crate::is_ci() {
panic!("Forgot to remove debug-print?")
}
std::eprintln!($($tt)*)
}}
}
/// Appends formatted string to a `String`.
#[macro_export]
macro_rules! format_to {