diff --git a/src/tests/main.cpp b/src/tests/main.cpp index 2afbdcec5..5cc0eb42a 100644 --- a/src/tests/main.cpp +++ b/src/tests/main.cpp @@ -31,6 +31,16 @@ auto find_data(const char* datum) -> char* { return strdup(p.c_str()); } +auto is_test_tty(FILE* fp) -> bool { + int fd = fileno(fp); + if(fd >= 0){ + if(isatty(fd)){ + return true; + } + } + return false; +} + static void handle_opts(const char** argv){ bool inarg = false; diff --git a/src/tests/main.h b/src/tests/main.h index 1e1af41a6..01a697847 100644 --- a/src/tests/main.h +++ b/src/tests/main.h @@ -10,6 +10,7 @@ #include #include "internal.h" +auto is_test_tty(FILE* fp) -> bool; auto find_data(const char* datum) -> char*; auto testing_notcurses() -> struct notcurses*; auto ncreel_validate(const ncreel* n) -> bool;