Skip to content

Replace the absolute paths to test files with the relative paths #632

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 2 commits into from
Jun 26, 2025

Conversation

Pavel-Irzhauski
Copy link
Contributor

@Pavel-Irzhauski Pavel-Irzhauski commented Jun 26, 2025

As long as the absolute path env!("CARGO_MANIFEST_DIR") is used to access the test files it is often impossible to test a cross-platform build on the target platform since the corresponding path can't be created. On the other hand according to The Cargo Book

The working directory when running each unit and integration test is set to the root directory of the package the test belongs to. Setting the working directory of tests to the package's root directory makes it possible for tests to reliably access the package's files using relative paths, regardless from where cargo test was executed from.

@Pavel-Irzhauski Pavel-Irzhauski marked this pull request as ready for review June 26, 2025 14:35
@mrobinson mrobinson added this pull request to the merge queue Jun 26, 2025
Merged via the queue into servo:main with commit f2c7020 Jun 26, 2025
6 checks passed
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