Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4635)

Issue 199071: [PATCH] Make lit's gtest support honor config.environment (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 3 months ago by Jeffrey Yasskin
Modified:
14 years, 3 months ago
Reviewers:
daniel
CC:
llvm-commits_cs.uiuc.edu
Base URL:
https://llvm.org/svn/llvm-project/llvm/trunk/
Visibility:
Public.

Description

This will let me set LD_LIBRARY_PATH correctly when linking the unittests against an LLVM shared library.

Patch Set 1 #

Patch Set 2 : Fix 80 columns #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -8 lines) Patch
M utils/lit/lit/TestFormats.py View 1 3 chunks +14 lines, -6 lines 0 comments Download
M utils/lit/lit/Util.py View 1 chunk +3 lines, -2 lines 0 comments Download

Messages

Total messages: 2
Jeffrey Yasskin
Please take a look. The current patch is at http://codereview.appspot.com/download/issue199071_1003.diff
14 years, 3 months ago (2010-02-03 02:43:47 UTC) #1
daniel_zuster.org
14 years, 3 months ago (2010-02-05 17:56:25 UTC) #2
LGTM.

 - Daniel

On Tue, Feb 2, 2010 at 6:43 PM,  <jyasskin@gmail.com> wrote:
> Reviewers: daniel_zuster.org,
>
> Message:
> Please take a look. The current patch is at
> http://codereview.appspot.com/download/issue199071_1003.diff
>
> Description:
> This will let me set LD_LIBRARY_PATH correctly when linking the
> unittests against an LLVM shared library.
>
> Please review this at http://codereview.appspot.com/199071/show
>
> Affected files:
>  M     utils/lit/lit/TestFormats.py
>  M     utils/lit/lit/Util.py
>
>
> Index: utils/lit/lit/TestFormats.py
> ===================================================================
> --- utils/lit/lit/TestFormats.py        (revision 95191)
> +++ utils/lit/lit/TestFormats.py        (working copy)
> @@ -9,13 +9,19 @@
>         self.test_sub_dir = str(test_sub_dir)
>         self.test_suffix = str(test_suffix)
>
> -    def getGTestTests(self, path, litConfig):
> +    def getGTestTests(self, path, litConfig, localConfig):
>         """getGTestTests(path) - [name]
> -
> -        Return the tests available in gtest executable."""
>
> +        Return the tests available in gtest executable.
> +
> +        Args:
> +          path: String path to a gtest executable
> +          litConfig: LitConfig instance
> +          localConfig: TestingConfig instance"""
> +
>         try:
> -            lines = Util.capture([path, '--gtest_list_tests']).split('\n')
> +            lines = Util.capture([path, '--gtest_list_tests'],
> +                                 env=localConfig.environment).split('\n')
>         except:
>             litConfig.error("unable to discover google-tests in %r" % path)
>             raise StopIteration
> @@ -52,7 +58,8 @@
>                     execpath = os.path.join(filepath, subfilename)
>
>                     # Discover the tests in this executable.
> -                    for name in self.getGTestTests(execpath, litConfig):
> +                    for name in self.getGTestTests(execpath, litConfig,
> +                                                   localConfig):
>                         testPath = path_in_suite + (filename, subfilename,
> name)
>                         yield Test.Test(testSuite, testPath, localConfig)
>
> @@ -65,7 +72,8 @@
>             testName = os.path.join(namePrefix, testName)
>
>         cmd = [testPath, '--gtest_filter=' + testName]
> -        out, err, exitCode = TestRunner.executeCommand(cmd)
> +        out, err, exitCode = TestRunner.executeCommand(
> +            cmd, env=test.config.environment)
>
>         if not exitCode:
>             return Test.PASS,''
> Index: utils/lit/lit/Util.py
> ===================================================================
> --- utils/lit/lit/Util.py       (revision 95191)
> +++ utils/lit/lit/Util.py       (working copy)
> @@ -39,11 +39,12 @@
>         if e.errno != errno.EEXIST:
>             raise
>
> -def capture(args):
> +def capture(args, env=None):
>     import subprocess
>     """capture(command) - Run the given command (or argv list) in a shell
> and
>     return the standard output."""
> -    p = subprocess.Popen(args, stdout=subprocess.PIPE,
> stderr=subprocess.PIPE)
> +    p = subprocess.Popen(args, stdout=subprocess.PIPE,
> stderr=subprocess.PIPE,
> +                         env=env)
>     out,_ = p.communicate()
>     return out
>
>
>
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b