From da8043318c3148966ea4e677d711467dccecbe36 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 14 Aug 2013 05:07:09 +0000 Subject: [PATCH] [lit] Fix tests to execute lit with same python as invoked with. llvm-svn: 188358 --- utils/lit/tests/lit.cfg | 5 ++++- utils/lit/tests/shell-parsing.py | 2 +- utils/lit/tests/unittest-adaptor.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/utils/lit/tests/lit.cfg b/utils/lit/tests/lit.cfg index f148c911aac..a8d259136ea 100644 --- a/utils/lit/tests/lit.cfg +++ b/utils/lit/tests/lit.cfg @@ -1,6 +1,7 @@ # -*- Python -*- import os +import sys import lit.formats @@ -29,7 +30,9 @@ config.environment['PYTHONPATH'] = src_root config.substitutions.append(('%{src_root}', src_root)) config.substitutions.append(('%{inputs}', os.path.join( src_root, 'tests', 'Inputs'))) -config.substitutions.append(('%{lit}', os.path.join(src_root, 'lit.py'))) +config.substitutions.append(('%{lit}', "%%{python} %s" % ( + os.path.join(src_root, 'lit.py'),))) +config.substitutions.append(('%{python}', sys.executable)) # Enable coverage.py reporting, assuming the coverage module has been installed # and sitecustomize.py in the virtualenv has been modified appropriately. diff --git a/utils/lit/tests/shell-parsing.py b/utils/lit/tests/shell-parsing.py index f644132f29d..a07e988861f 100644 --- a/utils/lit/tests/shell-parsing.py +++ b/utils/lit/tests/shell-parsing.py @@ -1,3 +1,3 @@ # Just run the ShUtil unit tests. # -# RUN: python -m lit.ShUtil +# RUN: %{python} -m lit.ShUtil diff --git a/utils/lit/tests/unittest-adaptor.py b/utils/lit/tests/unittest-adaptor.py index 243dd4191d0..7435dda4196 100644 --- a/utils/lit/tests/unittest-adaptor.py +++ b/utils/lit/tests/unittest-adaptor.py @@ -1,6 +1,6 @@ # Check the lit adaption to run under unittest. # -# RUN: python %s %{inputs}/unittest-adaptor 2> %t.err +# RUN: %{python} %s %{inputs}/unittest-adaptor 2> %t.err # RUN: FileCheck < %t.err %s # # CHECK: unittest-adaptor :: test-one.txt ... ok