Allow tests to fake stdin/stdout/stderr is a console

We've been unable to effectively test cases where stdin/stdout/stderr
are consoles, because in our test cases they generally aren't. Allow the
command line flags `--fake-std{in,out,err}-is-console` to tell the CLI
to pretend that std{in,out,err} is a console.
This commit is contained in:
Nick Terrell
2022-12-14 15:44:09 -08:00
committed by Nick Terrell
parent 031de3c69c
commit e58a39f84e
5 changed files with 55 additions and 6 deletions
+4
View File
@@ -127,6 +127,10 @@ extern "C" {
/*-*********************************************
* Detect if isatty() and fileno() are available
*
* Note: Use UTIL_isConsole() for the zstd CLI
* instead, as it allows faking is console for
* testing.
************************************************/
#if (defined(__linux__) && (PLATFORM_POSIX_VERSION > 1)) \
|| (PLATFORM_POSIX_VERSION >= 200112L) \