mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
18 lines
494 B
Python
18 lines
494 B
Python
# Copyright 2014 The Chromium Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
import os
|
|
import sys
|
|
import logging
|
|
|
|
_logger = logging.getLogger()
|
|
|
|
|
|
def set_color():
|
|
"""Run gtests with color if we're on a TTY (and we're not being told
|
|
explicitly what to do)."""
|
|
if sys.stdout.isatty() and "GTEST_COLOR" not in os.environ:
|
|
_logger.debug("Setting GTEST_COLOR=yes")
|
|
os.environ["GTEST_COLOR"] = "yes"
|