[lldb] Set the TERM environment variable for the API tests
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 22 Mar 2022 02:18:29 +0000 (19:18 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 22 Mar 2022 18:01:38 +0000 (11:01 -0700)
Avoid "TERM environment variable not set" by either propagating the TERM
environment variable or defaulting to vt100. All of our CI is already
doing this explicitly through the --env dotest arg, but it's easy to
forget when setting up a new job. I don't see any downside in making it
the default.

lldb/test/API/lit.cfg.py

index 8120c4f7160527bfd89c5bdcffe05082eb052423..48bb5662dc8b50ababc539296590ef1ae7eac8c9 100644 (file)
@@ -235,6 +235,9 @@ import lldbtest
 # testFormat: The test format to use to interpret tests.
 config.test_format = lldbtest.LLDBTest(dotest_cmd)
 
+# Propagate TERM or default to vt100.
+config.environment['TERM'] = os.getenv('TERM', default='vt100')
+
 # Propagate FREEBSD_LEGACY_PLUGIN
 if 'FREEBSD_LEGACY_PLUGIN' in os.environ:
   config.environment['FREEBSD_LEGACY_PLUGIN'] = os.environ[