Skip to content

Commit 5a4cfa9

Browse files
author
Thomas Preud'homme
committed
Expect LNT to be installed in the tests
LNT's lit is configured to be able to run the tests without LNT being installed. This is useful for testing/cPerf.py which skips all its checks if cPerf extension is not found, which happens when setup has not run and thus it has not been built. However newly added runtest/test_suite-profile.shtest expects cPerf being installed or its globbing fails. This seems a better approach because a patch author risks missing a regression if some tests are skipped. Therefore this commit removes the root of the repository from the PYTHONPATH in lit's config, thereby requiring the user running the test having lit in PYTHONPATH. Reviewed By: tnfchris Differential Revision: https://reviews.llvm.org/D94715
1 parent 0d067a2 commit 5a4cfa9

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

tests/lit.cfg

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ config.target_triple = None
2929

3030
src_root = os.path.join(config.test_source_root, '..')
3131
try:
32-
build_root = glob.glob('%s/build/lib.*' % src_root)[0]
32+
config.environment['PYTHONPATH'] = glob.glob('%s/build/lib.*' % src_root)[0]
3333
except:
34-
build_root = ''
35-
config.environment['PYTHONPATH'] = '%s:%s' % (build_root, src_root)
34+
pass
3635
# LNT needs a UTF-8 locale when running in Python 3 mode. Rely on the host
3736
# environment to provide it rather than assume a specific UTF-8 locale is
3837
# present.

tests/testing/cPerf.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
# RUN: python %s
22
import unittest, sys, os, tempfile, time, threading, json
3-
4-
try:
5-
import lnt.testing.profile.cPerf as cPerf
6-
except:
7-
# No tests to run if cPerf is not available
8-
sys.exit(0)
9-
103
from lnt.testing.profile.perf import LinuxPerfProfile
114

125
class CPerfTest(unittest.TestCase):

0 commit comments

Comments
 (0)