Skip to content
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

Do not provide the test-helper feature #18

Closed
tarsius opened this issue Jun 30, 2024 · 5 comments · Fixed by #19
Closed

Do not provide the test-helper feature #18

tarsius opened this issue Jun 30, 2024 · 5 comments · Fixed by #19

Comments

@tarsius
Copy link
Contributor

tarsius commented Jun 30, 2024

test-helper.el isn't a library intended to be loaded with require. Instead it is loaded with load by ert-runner itself and that does not use require to do so.

Because of that, it is confusing to provide a feature. It also wouldn't be possible to use require to reliably load test-helper because that might, depending on the order of load-path, load the test-helper.el of another package.

There aren't many packages left that have that defect but that's only because I got them to fix this issue. It would be great if you could fix it in your package as well.

This is also discussed at rejeep/ert-runner.el#38.

@tarsius
Copy link
Contributor Author

tarsius commented Jun 30, 2024

Thanks!

@tarsius
Copy link
Contributor Author

tarsius commented Jun 30, 2024

Uh, unfortunately it looks like you'll have to use load with a relative file name.

@tarsius
Copy link
Contributor Author

tarsius commented Jun 30, 2024

I've I remember correctly, the safest way looks something like:

(load (expand-file-name "test-helper.el"
                        (file-name-directory
                         (or load-file-name buffer-file-name))))

@CeleritasCelery
Copy link
Contributor

CeleritasCelery commented Jun 30, 2024

Thanks. I fat finger the keys and push it to the main branch instead of a PR branch I could run CI against.

@tarsius
Copy link
Contributor Author

tarsius commented Jun 30, 2024

Thanks again!

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 a pull request may close this issue.

2 participants