summaryrefslogtreecommitdiffstats
path: root/llvm/utils/lit/tests
diff options
context:
space:
mode:
authorDavid Tenty <daltenty@ibm.com>2019-07-24 15:04:27 +0000
committerDavid Tenty <daltenty@ibm.com>2019-07-24 15:04:27 +0000
commitb9179ff8576d5d2aac336073e1118bed4f5ef009 (patch)
treef92e38ecfcc29813f5980d8a05f56781cb34f245 /llvm/utils/lit/tests
parent4fdcabf259c4ab94654e6cd5d95d0e0313159c70 (diff)
downloadbcm5719-llvm-b9179ff8576d5d2aac336073e1118bed4f5ef009.tar.gz
bcm5719-llvm-b9179ff8576d5d2aac336073e1118bed4f5ef009.zip
[AIX][lit] Don't depend on psutil on AIX
Summary: On AIX psutil can run into problems with permissions to read the process tree, which causes problems for python timeout tests which need to kill off a test and it's children. This patch adds a workaround by invoking shell via subprocess and using a platform specific option to ps to list all the descendant processes so we can kill them. We add some checks so lit can tell whether timeout tests are supported with out exposing whether we are utilizing the psutil implementation or the alternative. Reviewers: hubert.reinterpretcast, andusy, davide, delcypher Reviewed By: delcypher Subscribers: davide, delcypher, christof, lldb-commits, libcxx-commits, llvm-commits Tags: #lldb, #libc, #llvm Differential Revision: https://reviews.llvm.org/D64251 llvm-svn: 366912
Diffstat (limited to 'llvm/utils/lit/tests')
-rw-r--r--llvm/utils/lit/tests/googletest-timeout.py2
-rw-r--r--llvm/utils/lit/tests/lit.cfg15
-rw-r--r--llvm/utils/lit/tests/shtest-timeout.py2
3 files changed, 10 insertions, 9 deletions
diff --git a/llvm/utils/lit/tests/googletest-timeout.py b/llvm/utils/lit/tests/googletest-timeout.py
index 8b7d10fc1f0..0761ad0796e 100644
--- a/llvm/utils/lit/tests/googletest-timeout.py
+++ b/llvm/utils/lit/tests/googletest-timeout.py
@@ -1,4 +1,4 @@
-# REQUIRES: python-psutil
+# REQUIRES: lit-max-individual-test-time
# Check that the per test timeout is enforced when running GTest tests.
#
diff --git a/llvm/utils/lit/tests/lit.cfg b/llvm/utils/lit/tests/lit.cfg
index 4648b1bfc9c..ebdcb5000b9 100644
--- a/llvm/utils/lit/tests/lit.cfg
+++ b/llvm/utils/lit/tests/lit.cfg
@@ -1,6 +1,7 @@
# -*- Python -*-
import os
+import platform
import sys
import lit.formats
@@ -56,10 +57,10 @@ if lit_config.params.get('check-coverage', None):
os.path.dirname(__file__), ".coveragerc")
# Add a feature to detect if psutil is available
-try:
- import psutil
- lit_config.note('Found python psutil module')
- config.available_features.add("python-psutil")
-except ImportError:
- lit_config.warning('Could not import psutil. Some tests will be skipped and'
- ' the --timeout command line argument will not work.')
+supported, errormsg = lit_config.maxIndividualTestTimeIsSupported
+if supported:
+ config.available_features.add("lit-max-individual-test-time")
+else:
+ lit_config.warning('Setting a timeout per test not supported. ' + errormsg
+ + ' Some tests will be skipped and the --timeout'
+ ' command line argument will not work.')
diff --git a/llvm/utils/lit/tests/shtest-timeout.py b/llvm/utils/lit/tests/shtest-timeout.py
index 1208e7379d0..56415fe5b3c 100644
--- a/llvm/utils/lit/tests/shtest-timeout.py
+++ b/llvm/utils/lit/tests/shtest-timeout.py
@@ -1,4 +1,4 @@
-# REQUIRES: python-psutil
+# REQUIRES: lit-max-individual-test-time
# llvm.org/PR33944
# UNSUPPORTED: system-windows
OpenPOWER on IntegriCloud