Skip to content

[SYCL][E2E LIT] Don't spoil current directory with temporary files #9078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

aelovikov-intel
Copy link
Contributor

After #8854 it's possible to run llvm-lit from anywhere and not be restricted to the end-to-end tests' build directory. However, lit.cfg.py performs auto-detection of some features by creating and compiling small test files. Make sure that those are kept in the build directory no matter where we run llvm-lit from.

After intel#8854 it's possible to run
llvm-lit from anywhere and not be restricted to the end-to-end tests'
build directory. However, lit.cfg.py performs auto-detection of some
features by creating and compiling small test files. Make sure that
those are kept in the build directory no matter where we run llvm-lit
from.
@aelovikov-intel aelovikov-intel requested a review from a team as a code owner April 14, 2023 21:10
@aelovikov-intel
Copy link
Contributor Author

Tagging @frasercrmck

@aelovikov-intel aelovikov-intel temporarily deployed to aws April 14, 2023 23:06 — with GitHub Actions Inactive
@aelovikov-intel aelovikov-intel temporarily deployed to aws April 14, 2023 23:58 — with GitHub Actions Inactive
@steffenlarsen steffenlarsen merged commit e80b888 into intel:sycl Apr 17, 2023
@aelovikov-intel aelovikov-intel deleted the in-tree-e2e-chdir branch May 1, 2023 16:14
frasercrmck added a commit to frasercrmck/llvm that referenced this pull request Jul 11, 2024
Since intel#9078 (itself a fix for intel#8854), the SYCL E2E lit config would
change the working directory and never set it back. This impeded LIT's
ability to discover tests and test suites, when tasked with sourcing multiple.

For example:

    llvm-lit sycl/test/A sycl/test/B

LIT would discover test 'A' by appending its relative path to the CWD
(e.g., root/sycl/test/A) and load up the SYCL E2E lit.cfg. This would
change directory into the SYCL build directory. When discovering test
'B' it would append its relative path to the SYCL binary dir and fail to
find it (e.g., root/build/tools/sycl/test-e2e/sycl/test/B).

This would also have the effect of load the SYCL E2E LIT config
a second time, even though it was already loaded.

With this change, we maintain the CWD but open the temp files using
absolute paths. This allows us to run multiple tests from multiple
different paths at the same time, even ones from different suites:

    llvm-lit sycl/test/A clang/test/B llvm/test/C

Running multiple individual SYCL tests on the same command line will
also only load the SYCL config the once.
aelovikov-intel pushed a commit that referenced this pull request Jul 11, 2024
Since #9078 (itself a fix for #8854), the SYCL E2E lit config would
change the working directory and never set it back. This impeded LIT's
ability to discover tests and test suites, when tasked with sourcing
multiple.

For example:

    llvm-lit sycl/test/A sycl/test/B

LIT would discover test 'A' by appending its relative path to the CWD
(e.g., `root/sycl/test/A`) and load up the SYCL E2E lit.cfg. This would
change directory into the SYCL build directory. When discovering test
'B' it would append its relative path to the SYCL binary dir and fail to
find it (e.g., `root/build/tools/sycl/test-e2e/sycl/test/B`).

This would also have the effect of loading the SYCL E2E LIT config a
second time, even though it was already loaded.

With this change, we maintain the CWD but open the temp files using
absolute paths. This allows us to run multiple tests from multiple
different paths at the same time, even ones from different suites:

    llvm-lit sycl/test/A clang/test/B llvm/test/C

Running multiple individual SYCL tests on the same command line will
also only load the SYCL config the once.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants