From 1c39ed14280c529c97541a87d8044aa5321eb8ad Mon Sep 17 00:00:00 2001 From: lethosor Date: Sat, 28 Mar 2020 13:18:31 -0400 Subject: [PATCH] Switch tests to headless mode if no TTY detected --- travis/run-tests.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/travis/run-tests.py b/travis/run-tests.py index 9b583ed6b..df62b9f7e 100644 --- a/travis/run-tests.py +++ b/travis/run-tests.py @@ -17,6 +17,10 @@ parser.add_argument('--no-quit', action='store_true', help='Do not quit DF when done') args = parser.parse_args() +if (not sys.stdin.isatty() or not sys.stdout.isatty() or not sys.stderr.isatty()) and not args.headless: + print('WARN: no TTY detected, enabling headless mode') + args.headless = True + MAX_TRIES = 5 dfhack = 'Dwarf Fortress.exe' if sys.platform == 'win32' else './dfhack'