digitalmars.D.ldc - FYI: environment variables in Lit tests
- Johan Engelen (4/4) Jan 16 2019 Hi all,
- Petar Kirov [ZombineDev] (6/10) Jan 23 2019 FYI, env is a POSIX thing [1], so I think it works just by virtue
- Johan Engelen (5/14) Jan 23 2019 The cool thing is that Lit recognizes `env` and makes it work
- Petar Kirov [ZombineDev] (8/33) Jan 23 2019 Yes, I think you're right. Previously I couldn't find information
- kinke (7/9) Jan 23 2019 Not the lines, but the lit code is in
- Johan Engelen (7/9) Jan 23 2019 See e.g.
- Petar Kirov [ZombineDev] (3/13) Jan 24 2019 Thanks guys ;)
Hi all, I just found out about lit's "env" command, see: https://wiki.dlang.org/LDC_Lit-based_testsuite#Environment_variables -Johan
Jan 16 2019
On Thursday, 17 January 2019 at 00:42:23 UTC, Johan Engelen wrote:Hi all, I just found out about lit's "env" command, see: https://wiki.dlang.org/LDC_Lit-based_testsuite#Environment_variables -JohanFYI, env is a POSIX thing [1], so I think it works just by virtue of using the system shell. Unfortunately, I think you'll need to use a different thing for Windows, if the tests are not running in a msys2/mingw/cygwin environment. [1]: https://www.unix.com/man-page/posix/1posix/env/
Jan 23 2019
On Wednesday, 23 January 2019 at 11:13:06 UTC, Petar Kirov [ZombineDev] wrote:On Thursday, 17 January 2019 at 00:42:23 UTC, Johan Engelen wrote:The cool thing is that Lit recognizes `env` and makes it work cross-platform (same as e.g. `rm` and `mkdir`). -JohanHi all, I just found out about lit's "env" command, see: https://wiki.dlang.org/LDC_Lit-based_testsuite#Environment_variables -JohanFYI, env is a POSIX thing [1], so I think it works just by virtue of using the system shell.
Jan 23 2019
On Wednesday, 23 January 2019 at 12:06:21 UTC, Johan Engelen wrote:On Wednesday, 23 January 2019 at 11:13:06 UTC, Petar Kirov [ZombineDev] wrote:Yes, I think you're right. Previously I couldn't find information in the source code, but now I found this part of the documentation, which is pretty clear: https://llvm.org/docs/TestingGuide.html#writing-new-regression-testsOn Thursday, 17 January 2019 at 00:42:23 UTC, Johan Engelen wrote:The cool thing is that Lit recognizes `env` and makes it work cross-platform (same as e.g. `rm` and `mkdir`). -JohanHi all, I just found out about lit's "env" command, see: https://wiki.dlang.org/LDC_Lit-based_testsuite#Environment_variables -JohanFYI, env is a POSIX thing [1], so I think it works just by virtue of using the system shell.RUN lines are specified in the comments of the test program using the keyword RUN followed by a colon, and lastly the command (pipeline) to execute. Together, these lines form the “script” that lit executes to run the test case. The syntax of the RUN lines is similar to a shell’s syntax for pipelines including I/O redirection and variable substitution. **However, even though these lines may look like a shell script, they are not. RUN lines are interpreted by lit.** Consequently, the syntax differs from shell in a few ways. You can specify as many RUN lines as needed.Do you know where I can find the relevant lines in the source code?
Jan 23 2019
On Wednesday, 23 January 2019 at 16:53:26 UTC, Petar Kirov [ZombineDev] wrote:Do you know where I can find the relevant lines in the source code?Not the lines, but the lit code is in https://github.com/llvm-mirror/llvm/tree/master/utils/lit/lit. As a side note, when they made `cat` a builtin command, that broke some of our tests (IIRC because they forgot to ship that `builtin_commands/cat.py` for Windows or something like that).
Jan 23 2019
On Wednesday, 23 January 2019 at 16:53:26 UTC, Petar Kirov [ZombineDev] wrote:Do you know where I can find the relevant lines in the source code?See e.g. https://github.com/llvm/llvm-project/blob/master/llvm/utils/lit/lit/TestRunner.py#L823 and https://github.com/llvm/llvm-project/blob/master/llvm/utils/lit/lit/TestRunner.py#L745-L801 -Johan
Jan 23 2019
On Wednesday, 23 January 2019 at 23:56:42 UTC, Johan Engelen wrote:On Wednesday, 23 January 2019 at 16:53:26 UTC, Petar Kirov [ZombineDev] wrote:Thanks guys ;)Do you know where I can find the relevant lines in the source code?See e.g. https://github.com/llvm/llvm-project/blob/master/llvm/utils/lit/lit/TestRunner.py#L823 and https://github.com/llvm/llvm-project/blob/master/llvm/utils/lit/lit/TestRunner.py#L745-L801 -Johan
Jan 24 2019