Troy Johnson via llvm-dev
2018-Nov-16 17:20 UTC
[llvm-dev] [LNT] How to set an env var before executing a test?
Does the LNT test-suite provide a way to have an environment variable set when executing a test? I can set it outside of LNT (i.e. have it in my environment when LNT is launched) and that works fine, but there does not appear to be a way to set it as part of a test's configuration. There are some lit.local.cfg files scattered throughout the test-suite repository, but messing with os.environ in those seems to have no effect (and I'm not quite sure what LNT is doing with LIT configs anyway). -Troy -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181116/a90f9151/attachment.html>
Chris Matthews via llvm-dev
2018-Nov-16 18:26 UTC
[llvm-dev] [LNT] How to set an env var before executing a test?
It does not. The prefers way to customize is to use a cmake define. Briefly, LNT is first running cmake, then make to build the tests. Then running Lit to execute them and collect the performance data. I believe via cmake there are ways to change both the test builds and execution.> On Nov 16, 2018, at 9:20 AM, Troy Johnson via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Does the LNT test-suite provide a way to have an environment variable set when executing a test? I can set it outside of LNT (i.e. have it in my environment when LNT is launched) and that works fine, but there does not appear to be a way to set it as part of a test’s configuration. There are some lit.local.cfg files scattered throughout the test-suite repository, but messing with os.environ in those seems to have no effect (and I’m not quite sure what LNT is doing with LIT configs anyway). > > -Troy > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3411 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181116/484de3c3/attachment.bin>
Troy Johnson via llvm-dev
2018-Nov-16 19:21 UTC
[llvm-dev] [LNT] How to set an env var before executing a test?
So you're referring to llvm_test_prepare? There aren't many examples of
that being used. I tried adding a call to it in my test directory's
CMakeLists.txt like so:
llvm_test_prepare(WORKDIR ${CMAKE_CURRENT_BINARY_DIR}
export MY_VAR=42
)
In the hopes that something would happen, even an error, but it had no effect.
Nothing at http://llvm.org/docs/lnt/tests.html explains how to use these cmake
macros, so I'm looking at
test-suite/External/SPEC/CINT2000/175.vpr/CMakeLists.txt for an example. The
tests that I have added are under a subdirectory of test-suite/SingleSource, but
the comment at the top of test-suite/cmake/modules/SingleMultiSource.cmake has
me worried that nothing new is supposed to go in there. Maybe I should move
everything under test-suite/External and more closely mimic these SPEC
CMakeLists.txt?
-Troy
> -----Original Message-----
> From: chris.matthews at apple.com <chris.matthews at apple.com>
> Sent: Friday, November 16, 2018 12:26 PM
> To: Troy Johnson <troyj at cray.com>
> Cc: llvm-dev at lists.llvm.org
> Subject: Re: [llvm-dev] [LNT] How to set an env var before executing a
test?
>
> It does not. The prefers way to customize is to use a cmake define.
>
> Briefly, LNT is first running cmake, then make to build the tests. Then
running Lit
> to execute them and collect the performance data.
>
> I believe via cmake there are ways to change both the test builds and
execution.
>
> > On Nov 16, 2018, at 9:20 AM, Troy Johnson via llvm-dev <llvm-
> dev at lists.llvm.org> wrote:
> >
> > Does the LNT test-suite provide a way to have an environment variable
set
> when executing a test? I can set it outside of LNT (i.e. have it in my
environment
> when LNT is launched) and that works fine, but there does not appear to be
a
> way to set it as part of a test’s configuration. There are some
lit.local.cfg files
> scattered throughout the test-suite repository, but messing with os.environ
in
> those seems to have no effect (and I’m not quite sure what LNT is doing
with LIT
> configs anyway).
> >
> > -Troy
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev