[LNT] r264039 - [test-suite] --only-test: don't absolutify paths eagerly
James Molloy via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 22 04:45:31 PDT 2016
Author: jamesm
Date: Tue Mar 22 06:45:30 2016
New Revision: 264039
URL: http://llvm.org/viewvc/llvm-project?rev=264039&view=rev
Log:
[test-suite] --only-test: don't absolutify paths eagerly
If we call os.path.abspath(only_test) too soon, we cannot properly concatenate it with the build directory to find the directory we actually want to chdir too (because os.path.join(path, '/path') == '/path').
Keep the path relative until a later stage.
Modified:
lnt/trunk/lnt/tests/test_suite.py
Modified: lnt/trunk/lnt/tests/test_suite.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/tests/test_suite.py?rev=264039&r1=264038&r2=264039&view=diff
==============================================================================
--- lnt/trunk/lnt/tests/test_suite.py (original)
+++ lnt/trunk/lnt/tests/test_suite.py Tue Mar 22 06:45:30 2016
@@ -279,11 +279,12 @@ class TestSuiteTest(BuiltinTest):
# test_suite_root + dirname(opts.only_test) must be a directory.
path = os.path.join(self.opts.test_suite_root, opts.only_test)
parent_path = os.path.dirname(path)
-
+
if os.path.isdir(path):
- opts.only_test = (path, None)
+ opts.only_test = (opts.only_test, None)
elif os.path.isdir(parent_path):
- opts.only_test = (parent_path, os.path.basename(path))
+ opts.only_test = (os.path.dirname(opts.only_test),
+ os.path.basename(opts.only_test))
else:
parser.error("--only-test argument not understood (must be a " +
" test or directory name)")
More information about the llvm-commits
mailing list